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
eb8ff4663c80d101b3129d8d4928eb4975349877
SQL
RWShelton/Galatea
/CRSFF_DB/read_CSV.sql
UTF-8
6,247
4.28125
4
[ "MIT" ]
permissive
CREATE TABLE CSV_import ( author_first TEXT, author_last TEXT, title TEXT, source TEXT, editor_first TEXT, editor_last TEXT, year INTEGER, language TEXT, place_of_publication TEXT, publisher TEXT, page_start TEXT, page_end TEXT, translator_first TEXT, translator_last TEXT, edition TEXT, keyword TEXT, original_year INTEGER, searchable BOOLEAN ); .separator "," .import db_data.csv CSV_import --Create temp tables with unique constraints (don't need all tables to have temps) CREATE TABLE Source_Temp ( source_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL CHECK (name != ""), place_of_publication TEXT, year INTEGER, original_year INTEGER, edition TEXT, language TEXT NOT NULL, searchable BOOLEAN, UNIQUE (name, year, edition, language, searchable) ); CREATE TABLE Section_Temp ( section_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, source_id INTEGER NOT NULL, title TEXT NOT NULL CHECK (title != ""), page_start TEXT, page_end TEXT, UNIQUE (title, page_start, page_end), FOREIGN KEY (source_id) REFERENCES Source(source_id) ON UPDATE CASCADE ON DELETE CASCADE ); CREATE TABLE Author_Temp ( author_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, author_first_name TEXT, author_last_name TEXT, UNIQUE (author_first_name, author_last_name) ); CREATE TABLE Editor_Temp ( editor_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, editor_first_name TEXT, editor_last_name TEXT, UNIQUE (editor_first_name, editor_last_name) ); CREATE TABLE Translator_Temp ( translator_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, translator_first_name TEXT, translator_last_name TEXT, UNIQUE (translator_first_name, translator_last_name) ); CREATE TABLE Publisher_Temp ( publisher_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, publisher_name TEXT NOT NULL CHECK (publisher_name != ""), UNIQUE (publisher_name) ); INSERT OR IGNORE INTO Source_Temp (name, place_of_publication, year, original_year, edition, language, searchable) SELECT source, place_of_publication, year, original_year, edition, language, searchable FROM CSV_import; INSERT or IGNORE into Source SELECT * FROM Source_Temp; --need script for: Section --insert values into Section that are from the join of Source and CSV_import on all their common attributes. --every section will be associated with a source --does this need a WHERE clause? INSERT OR IGNORE INTO Section_Temp (source_id, title, page_start, page_end) SELECT source_id, title, page_start, page_end FROM Source JOIN CSV_import ON Source.name = CSV_import.source AND Source.year = CSV_import.year AND Source.original_year = CSV_import.original_year AND Source.language = CSV_import.language AND Source.place_of_publication = CSV_import.place_of_publication AND Source.edition = CSV_import.edition AND Source.searchable = CSV_import.searchable; INSERT OR IGNORE INTO Author_Temp (author_first_name, author_last_name) SELECT author_first, author_last FROM CSV_import; INSERT OR IGNORE INTO Editor_Temp (editor_first_name, editor_last_name) SELECT editor_first, editor_last FROM CSV_import; INSERT OR IGNORE INTO Translator_Temp (translator_first_name, translator_last_name) SELECT translator_first, translator_last FROM CSV_import; INSERT OR IGNORE INTO Publisher_Temp (publisher_name) SELECT publisher FROM CSV_import; INSERT or IGNORE into Section SELECT * FROM Section_Temp; INSERT or IGNORE into Author SELECT * FROM Author_Temp; INSERT or IGNORE into Editor SELECT * FROM Editor_Temp; INSERT or IGNORE into Translator SELECT * FROM Translator_Temp; INSERT or IGNORE into Publisher SELECT * FROM Publisher_Temp; INSERT or IGNORE INTO Authors_source (source_id, author_id) SELECT source_id, author_id FROM Author JOIN CSV_import ON Author.author_first_name = CSV_import.author_first AND Author.author_last_name = CSV_import.author_last JOIN Source ON Source.name = CSV_import.source WHERE CSV_import.title IS NULL OR CSV_import.title = ""; INSERT or IGNORE INTO Edits_source (source_id, editor_id) SELECT source_id, editor_id FROM Editor JOIN CSV_import ON Editor.editor_first_name = CSV_import.editor_first AND Editor.editor_last_name = CSV_import.editor_last JOIN Source ON Source.name = CSV_import.source; INSERT or IGNORE INTO Translates_source (source_id, translator_id) SELECT source_id, translator_id FROM Translator JOIN CSV_import ON Translator.translator_first_name = CSV_import.translator_first AND Translator.translator_last_name = CSV_import.translator_last JOIN Source ON Source.name = CSV_import.source; INSERT or IGNORE INTO Publishes_source (source_id, publisher_id) SELECT source_id, publisher_id FROM Publisher JOIN CSV_import ON Publisher.publisher_name = CSV_import.publisher JOIN Source ON Source.name = CSV_import.source; INSERT or IGNORE INTO Authors_section (section_id, author_id) SELECT section_id, author_id FROM Author JOIN CSV_import ON Author.author_first_name = CSV_import.author_first AND Author.author_last_name = CSV_import.author_last JOIN Section ON Section.title = CSV_import.title JOIN SOURCE ON Section.source_id = Source.source_id WHERE CSV_import.source = Source.name; INSERT or IGNORE INTO Edits_section (section_id, editor_id) SELECT section_id, editor_id FROM Editor JOIN CSV_import ON Editor.editor_first_name = CSV_import.editor_first AND Editor.editor_last_name = CSV_import.editor_last JOIN Section ON Section.title = CSV_import.title JOIN SOURCE ON Section.source_id = Source.source_id WHERE CSV_import.source = Source.name;; INSERT or IGNORE INTO Translates_section (section_id, translator_id) SELECT section_id, translator_id FROM Translator JOIN CSV_import ON Translator.translator_first_name = CSV_import.translator_first AND Translator.translator_last_name = CSV_import.translator_last JOIN Section ON Section.title = CSV_import.title JOIN SOURCE ON Section.source_id = Source.source_id WHERE CSV_import.source = Source.name; Drop table Source_Temp; Drop table Section_Temp; Drop table Author_Temp; Drop table Editor_Temp; Drop table Publisher_Temp; Drop table Translator_Temp; Drop table CSV_import; --Then copy all temp tables into real tables (attributes are in same order, so Select all)
true
74dd2e61fb74b27d1a26dcdf99ab7d6e29687f7a
SQL
dsuru1499/siri-xlite-quarkus-hr
/src/main/resources/db/migration/V1.0.0__Initiale_version.sql
UTF-8
14,237
2.9375
3
[]
no_license
-- -- PostgreSQL database dump -- -- Dumped from database version 12.6 -- Dumped by pg_dump version 12.6 -- -- Name: call; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.call ( id integer NOT NULL, actualarrivaltime time without time zone, actualdeparturetime time without time zone, aimedarrivaltime time without time zone, aimeddeparturetime time without time zone, aimedheadwayinterval bigint, arrivalplatformname character varying(255), arrivalproximitytext character varying(255), arrivalstatus integer, cancellation boolean, departureboardingactivity integer, departureplatformname character varying(255), departurestatus integer, destinationdisplay character varying(255), distancefromstop bigint, expectedarrivaltime time without time zone, expecteddeparturetime time without time zone, expectedheadwayinterval bigint, extracall boolean, index integer, numberofstopsaway bigint, sequence integer, origindisplay character varying(255), platformtraversal boolean, situationrefs text, vehicleatstop boolean, stoppoint_stoppointref character varying(255), vehiclejourney_datedvehiclejourneyref character varying(255) ); ALTER TABLE public.call OWNER TO "siri-xlite"; -- -- Name: call_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.call_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.call_seq OWNER TO "siri-xlite"; -- -- Name: destination; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.destination ( id integer NOT NULL, destinationref character varying(255), placename character varying(255), line_lineref character varying(255) ); ALTER TABLE public.destination OWNER TO "siri-xlite"; -- -- Name: destination_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.destination_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.destination_seq OWNER TO "siri-xlite"; -- -- Name: hibernate_sequence; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.hibernate_sequence START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.hibernate_sequence OWNER TO "siri-xlite"; -- -- Name: interchange_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.interchange_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.interchange_seq OWNER TO "siri-xlite"; -- -- Name: journeypart; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.journeypart ( id integer NOT NULL, journeypartref character varying(255), trainnumberref character varying(255), vehiclejourney_datedvehiclejourneyref character varying(255) ); ALTER TABLE public.journeypart OWNER TO "siri-xlite"; -- -- Name: journeypart_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.journeypart_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.journeypart_seq OWNER TO "siri-xlite"; -- -- Name: line; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.line ( lineref character varying(255) NOT NULL, linename character varying(255), monitored boolean, recordedattime timestamp without time zone ); ALTER TABLE public.line OWNER TO "siri-xlite"; -- -- Name: line_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.line_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.line_seq OWNER TO "siri-xlite"; -- -- Name: stoppoint; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.stoppoint ( stoppointref character varying(255) NOT NULL, linerefs text, latitude double precision, longitude double precision, recordedattime timestamp without time zone, stopname character varying(255), parent character varying(255) ); ALTER TABLE public.stoppoint OWNER TO "siri-xlite"; -- -- Name: stoppoint_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.stoppoint_seq START WITH 1 INCREMENT BY 1000 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.stoppoint_seq OWNER TO "siri-xlite"; -- -- Name: targetedinterchange; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.targetedinterchange ( interchangecode character varying(255) NOT NULL, connectioncode character varying(255), frequenttravellerduration bigint, guaranteed boolean, impairedaccessduration bigint, interchangeduration bigint, maximumwaittime bigint, occasionaltravellerduration bigint, recordedattime timestamp without time zone, stayseated boolean, call_id integer, distributorvehiclejourney_datedvehiclejourneyref character varying(255), stoppoint_stoppointref character varying(255) ); ALTER TABLE public.targetedinterchange OWNER TO "siri-xlite"; -- -- Name: targetinterchange_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.targetinterchange_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.targetinterchange_seq OWNER TO "siri-xlite"; -- -- Name: vehiclejourney; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.vehiclejourney ( datedvehiclejourneyref character varying(255) NOT NULL, bearing double precision, cancellation boolean, delay bigint, destinationaimedarrivaltime time without time zone, destinationdisplay character varying(255), destinationexpectedarrivaltime time without time zone, destinationname character varying(255), destinationref character varying(255), directionname character varying(255), directionref character varying(255), extrajourney boolean, firstorlastjourney integer, headwayservice boolean, incongestion boolean, inpanic boolean, journeynotes text, journeypatternname character varying(255), journeypatternref character varying(255), monitored boolean, monitoringerror character varying(255), occupancy integer, operatorref character varying(255), originaimeddeparturetime time without time zone, origindisplay character varying(255), originexpecteddeparturetime time without time zone, originname character varying(255), originref character varying(255), productcategoryref character varying(255), publishedlinename character varying(255), recordedattime timestamp without time zone, routeref character varying(255), servicefeaturerefs text, situationrefs text, trainnumbers text, vehiclefeaturerefs text, vehiclejourneyname character varying(255), latitude double precision, longitude double precision, vehiclemodes integer, line_lineref character varying(255) ); ALTER TABLE public.vehiclejourney OWNER TO "siri-xlite"; -- -- Name: vehiclejourney_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.vehiclejourney_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.vehiclejourney_seq OWNER TO "siri-xlite"; -- -- Name: via; Type: TABLE; Schema: public; Owner: siri-xlite -- CREATE TABLE public.via ( id integer NOT NULL, placename character varying(255), placeref character varying(255), vehiclejourney_datedvehiclejourneyref character varying(255) ); ALTER TABLE public.via OWNER TO "siri-xlite"; -- -- Name: via_seq; Type: SEQUENCE; Schema: public; Owner: siri-xlite -- CREATE SEQUENCE public.via_seq START WITH 1 INCREMENT BY 100 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.via_seq OWNER TO "siri-xlite"; -- -- Name: call call_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.call ADD CONSTRAINT call_pkey PRIMARY KEY (id); -- -- Name: destination destination_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.destination ADD CONSTRAINT destination_pkey PRIMARY KEY (id); -- -- Name: journeypart journeypart_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.journeypart ADD CONSTRAINT journeypart_pkey PRIMARY KEY (id); -- -- Name: line line_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.line ADD CONSTRAINT line_pkey PRIMARY KEY (lineref); -- -- Name: stoppoint stoppoint_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.stoppoint ADD CONSTRAINT stoppoint_pkey PRIMARY KEY (stoppointref); -- -- Name: targetedinterchange targetedinterchange_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.targetedinterchange ADD CONSTRAINT targetedinterchange_pkey PRIMARY KEY (interchangecode); -- -- Name: vehiclejourney vehiclejourney_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.vehiclejourney ADD CONSTRAINT vehiclejourney_pkey PRIMARY KEY (datedvehiclejourneyref); -- -- Name: via via_pkey; Type: CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.via ADD CONSTRAINT via_pkey PRIMARY KEY (id); -- -- Name: call_stoppoint_stoppointref_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX call_stoppoint_stoppointref_idx ON public.call USING btree (stoppoint_stoppointref); -- -- Name: call_vehiclejourney_datedvehiclejourneyref_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX call_vehiclejourney_datedvehiclejourneyref_idx ON public.call USING btree (vehiclejourney_datedvehiclejourneyref); -- -- Name: destination_line_lineref_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX destination_line_lineref_idx ON public.destination USING btree (line_lineref); -- -- Name: journeypart_vehiclejourney_datedvehiclejourneyref_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX journeypart_vehiclejourney_datedvehiclejourneyref_idx ON public.journeypart USING btree (vehiclejourney_datedvehiclejourneyref); -- -- Name: stoppoint_latitude_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX stoppoint_latitude_idx ON public.stoppoint USING btree (latitude); -- -- Name: stoppoint_longitude_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX stoppoint_longitude_idx ON public.stoppoint USING btree (longitude); -- -- Name: stoppoint_parent_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX stoppoint_parent_idx ON public.stoppoint USING btree (parent); -- -- Name: vehiclejourney_line_lineref_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX vehiclejourney_line_lineref_idx ON public.vehiclejourney USING btree (line_lineref); -- -- Name: via_vehiclejourney_datedvehiclejourneyref_idx; Type: INDEX; Schema: public; Owner: siri-xlite -- CREATE INDEX via_vehiclejourney_datedvehiclejourneyref_idx ON public.via USING btree (vehiclejourney_datedvehiclejourneyref); -- -- Name: destination destination_line_lineref_fkey; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.destination ADD CONSTRAINT destination_line_lineref_fkey FOREIGN KEY (line_lineref) REFERENCES public.line(lineref); -- -- Name: targetedinterchange fk7c936plcttkubgcvht0vi60is; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.targetedinterchange ADD CONSTRAINT fk7c936plcttkubgcvht0vi60is FOREIGN KEY (distributorvehiclejourney_datedvehiclejourneyref) REFERENCES public.vehiclejourney(datedvehiclejourneyref); -- -- Name: targetedinterchange fk9rtiv48aub7a8ya0w24beou27; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.targetedinterchange ADD CONSTRAINT fk9rtiv48aub7a8ya0w24beou27 FOREIGN KEY (call_id) REFERENCES public.call(id); -- -- Name: call fkemb5dta4x350378h6lfj6vs4; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.call ADD CONSTRAINT fkemb5dta4x350378h6lfj6vs4 FOREIGN KEY (vehiclejourney_datedvehiclejourneyref) REFERENCES public.vehiclejourney(datedvehiclejourneyref); -- -- Name: journeypart fkfg61q1ivn81v7iqmcugmd5fmo; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.journeypart ADD CONSTRAINT fkfg61q1ivn81v7iqmcugmd5fmo FOREIGN KEY (vehiclejourney_datedvehiclejourneyref) REFERENCES public.vehiclejourney(datedvehiclejourneyref); -- -- Name: targetedinterchange fkmfprim4s8ylsyym4cxa5ysutc; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.targetedinterchange ADD CONSTRAINT fkmfprim4s8ylsyym4cxa5ysutc FOREIGN KEY (stoppoint_stoppointref) REFERENCES public.stoppoint(stoppointref); -- -- Name: via fknw4iqb08e2pg5ahu3wvxc163r; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.via ADD CONSTRAINT fknw4iqb08e2pg5ahu3wvxc163r FOREIGN KEY (vehiclejourney_datedvehiclejourneyref) REFERENCES public.vehiclejourney(datedvehiclejourneyref); -- -- Name: vehiclejourney fko8c4fc1mae7fdq7brnhb3fb3t; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.vehiclejourney ADD CONSTRAINT fko8c4fc1mae7fdq7brnhb3fb3t FOREIGN KEY (line_lineref) REFERENCES public.line(lineref); -- -- Name: call fkqq39y0p9tk6orgk5gy64cb97t; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.call ADD CONSTRAINT fkqq39y0p9tk6orgk5gy64cb97t FOREIGN KEY (stoppoint_stoppointref) REFERENCES public.stoppoint(stoppointref); -- -- Name: stoppoint stoppoint_parent_fkey; Type: FK CONSTRAINT; Schema: public; Owner: siri-xlite -- ALTER TABLE ONLY public.stoppoint ADD CONSTRAINT stoppoint_parent_fkey FOREIGN KEY (parent) REFERENCES public.stoppoint(stoppointref); -- -- PostgreSQL database dump complete --
true
46f61414bed44e42c9449a7f1ac75a79c68d8a78
SQL
bakink/DBA_Oracle
/oem_db_listener.sql
UTF-8
700
2.78125
3
[]
no_license
col host_name for a30 col target_name for a38 col property_name for a20 col property_value for a5 SELECT mgmt$target.host_name , mgmt$target.target_name --, mgmt$target.target_type , mgmt$target_properties.property_name , mgmt$target_properties.property_value FROM mgmt$target , mgmt$target_properties WHERE ( mgmt$target.target_name = mgmt$target_properties.target_name ) AND ( mgmt$target.target_type = mgmt$target_properties.target_type ) and ( mgmt$target.target_type = 'oracle_listener' ) and ( mgmt$target_properties.property_name = 'Port' ) and upper(mgmt$target.target_name) like '%&1%'; col host_name clear col target_name clear col property_name clear col property_value clear
true
240c232f59dce55ccb38d6396fcd9a1be274da13
SQL
bayardg/Base-de-don-nes
/u.sql
UTF-8
1,835
3.71875
4
[]
no_license
--Requete 1 --Cas d un forfait DI : SELECT prix FROM ForfaitDI WHERE idForfait = 'VeloElecGuillaume'; --Cas d un forfait DL : SELECT (dateFin-dateDebut)*24*prix FROM ForfaitDL WHERE idForfait = 'VeloGuillaume'; -- Le .java est beaucoup plus précis. --Requete 2 SELECT v.idV, SUM(DateArrivee - DateDepart)/(COUNT (*)) FROM Deplacement d, Vehicule v where v.idV=d.idV AND DateDepart Between TO_DATE('01-01-1990', 'MM-DD-YYYY') and TO_DATE('01-31-1990','MM-DD-YYYY') AND DateArrivee Between TO_DATE('01-01-1990', 'MM-DD-YYYY') and TO_DATE('01-31-1990','MM-DD-YYYY') GROUP BY v.idV; --Requete 3 SELECT v.idV, SUM(DateArrivee - DateDepart)/(COUNT (*)) FROM Deplacement d, Vehicule v where v.idV=d.idV AND catV='Velo Electrique' AND DateDepart Between TO_DATE('01-01-1990', 'MM-DD-YYYY') and TO_DATE('01-31-1990','MM-DD-YYYY') AND DateArrivee Between TO_DATE('01-01-1990', 'MM-DD-YYYY') and TO_DATE('01-31-1990','MM-DD-YYYY') GROUP BY catV, v.idV; --requête 4 SELECT dateNaissance FROM Utilisateur; SELECT v.catV FROM Deplacement d,Utilisateur u, Vehicule v WHERE d.numCB=u.numCB AND v.idV=d.idV GROUP BY v.catV HAVING sum(d.DateDepart-d.DateArrivee)= (SELECT max(sum(d.DateDepart-d.DateArrivee)) FROM Deplacement d,Utilisateur u, Vehicule v WHERE d.numCB=u.numCB AND v.idV=d.idV GROUP BY v.catV ); --requêtes 5 SELECT count(MAX(DateArrivee)) AS NB FROM Deplacement WHERE stationArrivee='Chavant' AND DateArrivee IS NOT NULL AND DateArrivee<'14-NOV-90' AND DateDepart<'14-NOV-90' GROUP BY idV; SELECT nbPlacesVelE FROM Station WHERE nom_station='Chavant'; SELECT nbPlacesVoiE FROM Station WHERE nom_station='Chavant'; SELECT nbPlacesVrem FROM Station WHERE nom_station='Chavant'; SELECT nbPlacesUtil FROM Station WHERE nom_station='Chavant'; SELECT nbPlacesVelo FROM Station WHERE nom_station='Chavant';
true
197d0cccf77f755d88d3465bbcfe44be89c9e65e
SQL
TmanishaT/Functional-Programming
/raiseSalaryProc.sql
UTF-8
765
3.53125
4
[]
no_license
SET SERVEROUTPUT ON CREATE OR REPLACE PROCEDURE raiseEmpSalary ( p_emp_id MyEmployees.employee_id%TYPE, p_sal_raise NUMBER ) AS v_emp_update_count INTEGER:=0; BEGIN UPDATE MyEmployees set salary = (salary*p_sal_raise/100)+salary where employee_id = p_emp_id; v_emp_update_count := SQL%ROWCOUNT; IF v_emp_update_count = 0 THEN RAISE NO_DATA_FOUND; ELSE INSERT INTO HW1Log (message) VALUES ('Employee ' || p_emp_id || ' was raised by ' || p_sal_raise || ' percent.'); END IF; COMMIT; EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE(SQLERRM); DBMS_OUTPUT.PUT_LINE('Encountered while trying to give employee '|| p_emp_id ||' a raise.'); WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Some other error.'); END raiseEmpSalary;
true
5519aae937c95549c20f8f97e691e8322b0cac96
SQL
zvezdomirov/sql-course
/05_table-relations/exercise/05_ex-solutions.sql
UTF-8
5,795
4.0625
4
[]
no_license
#problem 1 CREATE TABLE passports( `passport_id` INT NOT NULL AUTO_INCREMENT, `passport_number` CHAR(8) UNIQUE NOT NULL, PRIMARY KEY (`passport_id`) ); ALTER TABLE passports AUTO_INCREMENT = 101; CREATE TABLE persons( `person_id` INT NOT NULL AUTO_INCREMENT, `first_name` VARCHAR(50) NOT NULL, `salary` FIXED(10, 2), `passport_id` INT UNIQUE NOT NULL, PRIMARY KEY (`person_id`), FOREIGN KEY (`passport_id`) REFERENCES passports(`passport_id`) ON DELETE CASCADE ); INSERT INTO passports(`passport_number`) VALUES ('N34FG21B'), ('K65LO4R7'), ('ZE657QP2'); INSERT INTO persons(`first_name`, `salary`, `passport_id`) VALUES ('Roberto', '43300.00', 102), ('Tom', '56100.00', 103), ('Yana', '60200.00', 101); #problem 2 CREATE TABLE manufacturers( `manufacturer_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, `established_on` DATE NOT NULL, PRIMARY KEY (`manufacturer_id`) ); CREATE TABLE models( `model_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, `manufacturer_id` INT NOT NULL, PRIMARY KEY (`model_id`), FOREIGN KEY (`manufacturer_id`) REFERENCES manufacturers(`manufacturer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) AUTO_INCREMENT = 101; INSERT INTO manufacturers (`name`, `established_on`) VALUES ('BMW', '1916-03-01'), ('Tesla', '2003-01-01'), ('Lada', '1966-05-01'); INSERT INTO models (`name`, `manufacturer_id`) VALUES ('X1', 1), ('i6', 1), ('Model S', 2), ('Model X', 2), ('Model 3', 2), ('Nova', 3); #problem 3 CREATE TABLE students( `student_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`student_id`) ); CREATE TABLE exams( `exam_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`exam_id`) ) AUTO_INCREMENT = 101; CREATE TABLE students_exams( `student_id` INT NOT NULL, `exam_id` INT NOT NULL, FOREIGN KEY (`student_id`) REFERENCES students(`student_id`), FOREIGN KEY (`exam_id`) REFERENCES exams(`exam_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ); INSERT INTO students (`name`) VALUES ('Mila'), ('Toni'), ('Ron'); INSERT INTO exams(`name`) VALUES ('Spring MVC'), ('Neo4j'), ('Oracle 11g'); INSERT INTO students_exams(`student_id`, `exam_id`) VALUES (1, 101), (1, 102), (2, 101), (3, 103), (2, 102), (2, 103); #problem 4 CREATE TABLE teachers( `teacher_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, `manager_id` INT, PRIMARY KEY (`teacher_id`), FOREIGN KEY (`manager_id`) REFERENCES teachers(`teacher_id`) )AUTO_INCREMENT = 101; INSERT INTO teachers (`name`) VALUES ('John'), ('Maya'), ('Silvia'), ('Ted'), ('Mark'), ('Greta'); UPDATE teachers SET `manager_id` = (CASE WHEN `teacher_id` = 101 THEN NULL WHEN `teacher_id` = 102 THEN 106 WHEN `teacher_id` = 103 THEN 106 WHEN `teacher_id` = 104 THEN 105 WHEN `teacher_id` = 105 THEN 101 WHEN `teacher_id` = 106 THEN 101 END); #problem 6 CREATE TABLE majors( `major_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`major_id`) ); CREATE TABLE students( `student_id` INT NOT NULL AUTO_INCREMENT, `student_number` VARCHAR(12) NOT NULL, `student_name` VARCHAR(50) NOT NULL, `major_id` INT, PRIMARY KEY(`student_id`), FOREIGN KEY (`major_id`) REFERENCES majors(`major_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE payments( `payment_id` INT NOT NULL AUTO_INCREMENT, `payment_date` DATE NOT NULL, `payment_amount` DECIMAL(8, 2) NOT NULL, `student_id` INT NOT NULL, PRIMARY KEY (`payment_id`), FOREIGN KEY (`student_id`) REFERENCES students(`student_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE subjects( `subject_id` INT NOT NULL AUTO_INCREMENT, `subject_name` VARCHAR(50) NOT NULL, PRIMARY KEY (`subject_id`) ); CREATE TABLE agenda( `student_id` INT NOT NULL, `subject_id` INT NOT NULL, PRIMARY KEY (`student_id`, `subject_id`), FOREIGN KEY (`student_id`) REFERENCES students(`student_id`), FOREIGN KEY (`subject_id`) REFERENCES subjects(`subject_id`) ON DELETE CASCADE ON UPDATE CASCADE ); #problem 5 CREATE TABLE cities( `city_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`city_id`) ); CREATE TABLE customers( `customer_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, `birthday` DATE, `city_id` INT NOT NULL, PRIMARY KEY (`customer_id`), FOREIGN KEY (`city_id`) REFERENCES cities(`city_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE orders( `order_id` INT NOT NULL AUTO_INCREMENT, `customer_id` INT NOT NULL, PRIMARY KEY (`order_id`), FOREIGN KEY (`customer_id`) REFERENCES customers (`customer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE item_types( `item_type_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`item_type_id`) ); CREATE TABLE items( `item_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, `item_type_id` INT NOT NULL, PRIMARY KEY (`item_id`), FOREIGN KEY (`item_type_id`) REFERENCES item_types(`item_type_id`) ); CREATE TABLE order_items( `order_id` INT NOT NULL, `item_id` INT NOT NULL, PRIMARY KEY (`order_id`, `item_id`), FOREIGN KEY (`order_id`) REFERENCES orders(`order_id`), FOREIGN KEY (`item_id`) REFERENCES items(`item_id`) ); #problem 9 SELECT m.`mountain_range`, p.`peak_name`, p.`elevation` AS `peak_elevation` FROM peaks p JOIN mountains m ON m.`id` = p.`mountain_id` WHERE m.`mountain_range` = 'Rila' ORDER BY `peak_elevation` DESC; #problem 10
true
c6335ebfebab452d3e6b399086b23b93bd698eb9
SQL
ZVlad1980/adm_scripts
/sql/cbo/tuning_sets/example_select_cursor_chache.sql
UTF-8
4,110
3.96875
4
[]
no_license
-- Get sql ids and sql text for statements with 500 buffer gets. SELECT sql_id, sql_text FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE('buffer_gets > 500')) ORDER BY sql_id; -- Get all the information we have about a particular statement. SELECT * FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE('sql_id = ''4rm4183czbs7j''')); -- Notice that some statements can have multiple plans. The output of the -- SELECT_XXX table functions is unique by (sql_id, plan_hash_value). This is -- because a data source can store multiple plans per sql statement. SELECT sql_id, plan_hash_value FROM table(dbms_sqltune.select_cursor_cache('sql_id = ''ay1m3ssvtrh24''')) ORDER BY sql_id, plan_hash_value; -- PL/SQL examples: load_sqlset is called after opening a cursor, along the -- lines given below -- Select all statements in the shared SQL area. DECLARE cur sys_refcursor; BEGIN OPEN cur FOR SELECT value(P) FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE) P; -- Process each statement (or pass cursor to load_sqlset). CLOSE cur; END;/ -- Look for statements not parsed by SYS. DECLARE cur sys_refcursor; BEGIN OPEN cur for SELECT VALUE(P) FROM table( DBMS_SQLTUNE.SELECT_CURSOR_CACHE('parsing_schema_name <> ''SYS''')) P; -- Process each statement (or pass cursor to load_sqlset). CLOSE cur; end;/ -- All statements from a particular module/action. DECLARE cur sys_refcursor; BEGIN OPEN cur FOR SELECT VALUE(P) FROM table( DBMS_SQLTUNE.SELECT_CURSOR_CACHE( 'module = ''MY_APPLICATION'' and action = ''MY_ACTION''')) P; -- Process each statement (or pass cursor to load_sqlset) CLOSE cur; END;/ -- all statements that ran for at least five seconds DECLARE cur sys_refcursor; BEGIN OPEN cur FOR SELECT VALUE(P) FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE('elapsed_time > 5000000')) P; -- Process each statement (or pass cursor to load_sqlset) CLOSE cur; end;/ -- select all statements that pass a simple buffer_gets threshold and -- are coming from an APPS user DECLARE cur sys_refcursor; BEGIN OPEN cur FOR SELECT VALUE(P) FROM table( DBMS_SQLTUNE.SELECT_CURSOR_CACHE( 'buffer_gets > 100 and parsing_schema_name = ''APPS'''))P; -- Process each statement (or pass cursor to load_sqlset) CLOSE cur; end;/ -- select all statements exceeding 5 seconds in elapsed time, but also -- select the plans (by default we only select execution stats and binds -- for performance reasons - in this case the SQL_PLAN attribute of sqlset_row -- is NULL) DECLARE cur sys_refcursor; BEGIN OPEN cur FOR SELECT VALUE(P) FROM table(dbms_sqltune.select_cursor_cache( 'elapsed_time > 5000000', NULL, NULL, NULL, NULL, 1, NULL, 'EXECUTION_STATISTICS, SQL_BINDS, SQL_PLAN')) P; -- Process each statement (or pass cursor to load_sqlset) CLOSE cur; END; / -- Select the top 100 statements in the shared SQL area ordering by elapsed_time. DECLARE cur sys_refcursor; BEGIN OPEN cur FOR SELECT VALUE(P) FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE(NULL, NULL, 'ELAPSED_TIME', NULL, NULL, 1, 100)) P; -- Process each statement (or pass cursor to load_sqlset) CLOSE cur; end;/ -- Select the set of statements which cumulatively account for 90% of the -- buffer gets in the shared SQL area. This means that the buffer gets of all -- of these statements added up is approximately 90% of the sum of all -- statements currently in the cache. DECLARE cur sys_refcursor; BEGIN OPEN cur FOR SELECT VALUE(P) FROM table(DBMS_SQLTUNE.SELECT_CURSOR_CACHE(NULL, NULL, 'BUFFER_GETS', NULL, NULL, .9)) P; -- Process each statement (or pass cursor to load_sqlset). CLOSE cur; END; /
true
eafd5e7737bd01a68998b7548bec0755d45bd8af
SQL
lrichiewl/SeckillAPI
/src/main/sql/schema.sql
UTF-8
2,192
3.921875
4
[]
no_license
/** * @author RyanLu * 本文件为脚本文件,在终端运行,不在IDEA上运行。 */ CREATE DATABASE seckill; use seckill; CREATE TABLE seckill( `seckill_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '商品库存ID', `name` varchar(120) NOT NULL COMMENT '商品名称', `number` int NOT NULL COMMENT '库存数量', `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '抢购开始时间', `end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '抢购结束时间', `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', -- 最后一个KEY哪里不能有逗号!!!在这里错了很久 PRIMARY KEY (seckill_id), KEY idx_start_time(start_time), KEY idx_end_time(end_time), KEY idx_create_time(create_time) )ENGINE =InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='库存列表'; -- 对数据进行初始化 INSERT INTO seckill(name,number,start_time,end_time) VALUES ('X宝双十一大促-1000元抢购商品A',500,'2019-05-31 00:00:00','2019-07-01 00:00:00'), ('X宝双十一大促-500元抢购商品B',250,'2019-05-31 00:00:00','2019-07-01 00:00:00'), ('X宝双十一大促-300元抢购商品C',100,'2019-05-31 00:00:00','2019-07-01 00:00:00'), ('X宝双十一大促-100元抢购商品D',150,'2019-05-31 00:00:00','2019-07-01 00:00:00') -- 记录抢购成功的明细表。由于本项目不含用户管理模块,所以用户登录认证相关的信息也放在这里 CREATE TABLE success_seckill( `seckill_id` BIGINT NOT NULL COMMENT '下单商品ID', `user_phone_num` BIGINT NOT NULL COMMENT '用户手机号码', `state` TINYINT NOT NULL DEFAULT -1 COMMENT '状态标识:-1无效,0下单成功,1已付款', `create_time` TIMESTAMP NOT NULL COMMENT '下单创建时间', -- 主键使用联合主键,用两个独一无二数据来确定下单的唯一性,同时防止同一用户对于同一产品重复下单 PRIMARY KEY(seckill_id, user_phone_num), key idx_create_time(create_time) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='成功下单的明细表'; -- 连接数据库控制台 mySQL -uroot -p
true
92e6113a50f60f851ddb7bf6a512606a8e8bdbe3
SQL
maltablock/eosio_chaindb
/sql/chaindb_dbtables.sql
UTF-8
5,017
3.59375
4
[]
no_license
CREATE DATABASE chaindb; CREATE USER 'chaindb'@'localhost' IDENTIFIED BY 'ce5Sxish'; GRANT ALL ON chaindb.* TO 'chaindb'@'localhost'; grant SELECT on chaindb.* to 'chaindbro'@'%' identified by 'chaindbro'; use chaindb; CREATE TABLE TRANSFERS ( network VARCHAR(15) NOT NULL, seq BIGINT UNSIGNED NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, trx_id VARCHAR(64) NOT NULL, contract VARCHAR(13) NOT NULL, currency VARCHAR(8) NOT NULL, amount BIGINT NOT NULL, decimals TINYINT NOT NULL, tx_from VARCHAR(13) NULL, tx_to VARCHAR(13) NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX TRANSFERS_i01 ON TRANSFERS (network,seq); CREATE INDEX TRANSFERS_I02 ON TRANSFERS (network,block_num); CREATE INDEX TRANSFERS_I04 ON TRANSFERS (network,trx_id(8)); CREATE INDEX TRANSFERS_I05 ON TRANSFERS (network,tx_from, contract, currency, block_num); CREATE INDEX TRANSFERS_I06 ON TRANSFERS (network,tx_to, contract, currency, block_num); CREATE INDEX TRANSFERS_I07 ON TRANSFERS (network,tx_to, block_num); CREATE INDEX TRANSFERS_I08 ON TRANSFERS (network,tx_from, block_num); CREATE INDEX TRANSFERS_I09 ON TRANSFERS (network,contract, block_num); CREATE TABLE ISSUANCES ( network VARCHAR(15) NOT NULL, seq BIGINT UNSIGNED NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, trx_id VARCHAR(64) NOT NULL, contract VARCHAR(13) NOT NULL, currency VARCHAR(8) NOT NULL, amount BIGINT NOT NULL, decimals TINYINT NOT NULL, tx_to VARCHAR(13) NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX ISSUANCES_i01 ON ISSUANCES (network,seq); CREATE INDEX ISSUANCES_I02 ON ISSUANCES (network,block_num); CREATE INDEX ISSUANCES_I04 ON ISSUANCES (network,trx_id(8)); CREATE INDEX ISSUANCES_I05 ON ISSUANCES (network,tx_to, contract, currency, block_num); CREATE INDEX ISSUANCES_I06 ON ISSUANCES (network,tx_to, block_num); CREATE INDEX ISSUANCES_I07 ON ISSUANCES (network,contract, block_num); CREATE TABLE BALANCES ( network VARCHAR(15) NOT NULL, account_name VARCHAR(13) NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, contract VARCHAR(13) NOT NULL, currency VARCHAR(8) NOT NULL, amount BIGINT NOT NULL, decimals TINYINT NOT NULL, deleted TINYINT NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX BALANCES_I01 ON BALANCES (network, account_name, contract, currency, block_num); CREATE INDEX BALANCES_I02 ON BALANCES (network, block_num); CREATE TABLE BALANCES_EXT ( network VARCHAR(15) NOT NULL, account_name VARCHAR(13) NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, contract VARCHAR(13) NOT NULL, field VARCHAR(14) NOT NULL, value VARCHAR(256) NOT NULL, deleted TINYINT NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX BALANCES_EXT_I01 ON BALANCES_EXT (network, account_name, contract, field, block_num); CREATE INDEX BALANCES_EXT_I02 ON BALANCES_EXT (network, account_name, contract, field, value); CREATE INDEX BALANCES_EXT_I03 ON BALANCES_EXT (network, block_num); CREATE TABLE DELBAND ( network VARCHAR(15) NOT NULL, account_name VARCHAR(13) NOT NULL, del_from VARCHAR(13) NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, cpu_weight BIGINT UNSIGNED NOT NULL, net_weight BIGINT UNSIGNED NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX DELBAND_I01 ON DELBAND (network, account_name, del_from, block_num); CREATE INDEX DELBAND_I02 ON DELBAND (network, del_from, block_num); CREATE INDEX DELBAND_I03 ON DELBAND (network, block_num); CREATE TABLE USERRES ( network VARCHAR(15) NOT NULL, account_name VARCHAR(13) NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, cpu_weight BIGINT UNSIGNED NOT NULL, net_weight BIGINT UNSIGNED NOT NULL, ram_bytes BIGINT UNSIGNED NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX USERRES_I01 ON USERRES (network, account_name, block_num); CREATE INDEX USERRES_I02 ON USERRES (network, block_num); CREATE TABLE REXFUND ( network VARCHAR(15) NOT NULL, account_name VARCHAR(13) NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, balance BIGINT UNSIGNED NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX REXFUND_I01 ON REXFUND (network, account_name, block_num); CREATE INDEX REXFUND_I02 ON REXFUND (network, block_num); CREATE TABLE REXBAL ( network VARCHAR(15) NOT NULL, account_name VARCHAR(13) NOT NULL, block_num BIGINT NOT NULL, block_time DATETIME NOT NULL, vote_stake BIGINT UNSIGNED NOT NULL, rex_balance BIGINT UNSIGNED NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX REXBAL_I01 ON REXBAL (network, account_name, block_num); CREATE INDEX REXBAL_I02 ON REXBAL (network, block_num);
true
0781ef4a98159b03c622d99d9f71e68fcee66db4
SQL
Polina10034/SqlDB-Project
/SQL/recordstudio_record.sql
UTF-8
2,408
3.0625
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64) -- -- Host: localhost Database: recordstudio -- ------------------------------------------------------ -- Server version 8.0.15 /*!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 `record` -- DROP TABLE IF EXISTS `record`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `record` ( `r_id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `beginning` date NOT NULL, `ending` date NOT NULL, `num_of_songs` int(11) NOT NULL, PRIMARY KEY (`r_id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `record` -- LOCK TABLES `record` WRITE; /*!40000 ALTER TABLE `record` DISABLE KEYS */; INSERT INTO `record` VALUES (1,'Views','2016-05-03','2017-01-01',3),(2,'The Eminem Show','2002-01-07','2002-10-20',2),(3,'Infidels','1885-02-03','1885-06-04',4),(4,'Blackstar','2017-02-28','2017-04-17',1),(5,'Like a Virgin','1984-02-10','1984-05-01',3),(6,'Lemonaid','2017-03-02','2018-11-20',9),(7,'Highway 61 Revisited','1965-01-06','1965-08-30',7),(8,'Moody Blue','1966-12-03','1967-07-29',6),(9,'4:44','2016-01-12','2017-06-20',10),(10,'Homecoming','2019-01-13','2019-04-21',5); /*!40000 ALTER TABLE `record` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2019-07-30 16:53:32
true
24a822ea872883130b9b33ea42bcf81a5fd26840
SQL
hatefi-arman/Modules
/Fuel/FuelReportImporter/Database/Import Voyages.sql
UTF-8
364
3
3
[]
no_license
INSERT INTO Fuel.Voyage SELECT [VoyageNumber] ,[VoyageNumber] AS [Description] ,1 AS [VesselInCompanyId] --For ABBA In SAPID ,11 AS CompanyId -- SAPID ,[StartDateTime] AS [StartDate] ,[EndDateTime] AS [EndDate] ,[IsActive] FROM dbo.SAPIDVoyagesView INNER JOIN Fuel.Vessel ON Vessel.Code COLLATE Arabic_CI_AS = SAPIDVoyagesView.VesselCode WHERE IsActive = 1
true
7facc0ab89f7a28df35a28da6a2d8114d78bc0a0
SQL
FUUK/fuuk
/fuuk/people/models/sql/updates/update-0.11-human.mysql.sql
UTF-8
1,187
3.234375
3
[]
no_license
ALTER TABLE people_human ADD COLUMN subtitle varchar(200); ALTER TABLE people_human ADD COLUMN subtitle_en varchar(200); ALTER TABLE people_human ADD COLUMN subtitle_cs varchar(200); ALTER TABLE people_human ADD COLUMN cv longtext; ALTER TABLE people_human ADD COLUMN cv_en longtext; ALTER TABLE people_human ADD COLUMN cv_cs longtext; ALTER TABLE people_human ADD COLUMN interests longtext; ALTER TABLE people_human ADD COLUMN interests_en longtext; ALTER TABLE people_human ADD COLUMN interests_cs longtext; ALTER TABLE people_human ADD COLUMN stays longtext; ALTER TABLE people_human ADD COLUMN stays_en longtext; ALTER TABLE people_human ADD COLUMN stays_cs longtext; UPDATE people_human AS t1 INNER JOIN people_humantranslation AS t2 ON t1.id=t2.master_id SET t1.subtitle_en=t2.subtitle, t1.cv_en=t2.cv, t1.interests_en=t2.interests, t1.stays_en=t2.stays WHERE t2.language_code='en'; UPDATE people_human AS t1 INNER JOIN people_humantranslation AS t2 ON t1.id=t2.master_id SET t1.subtitle_cs=t2.subtitle, t1.cv_cs=t2.cv, t1.interests_cs=t2.interests, t1.stays_cs=t2.stays WHERE t2.language_code='cs';
true
108c39bef1cc324253bbcd5e2859c3f9489d0504
SQL
k2003/HospitalOSV3
/HospitalOSV3/app/database/dental/dental_update_1.sql
UTF-8
12,435
3.328125
3
[]
no_license
---------------------------------------------------------- DENTAL Version 1.1.070707---------------------------------------- --- สร้างตาราง t_dental_order ใหม่ เนื่องจากมีการเปลี่ยนแปลง Flow การทำงาน DROP TABLE t_dental_order; CREATE TABLE t_dental_order ( t_dental_order_id character varying(255) NOT NULL, t_patient_id character varying(255), t_visit_id character varying(255), t_order_id character varying(255), b_dental_item_subgroup_id character varying(255), b_dental_uom_id character varying(255), dental_order_doctor character varying(255), dental_order_comment character varying(4000), dental_order_staff_record character varying(255), dental_order_staff_modify character varying(255), dental_order_record_date_time character varying(255), dental_order_modify_date_time character varying(255) ); ALTER TABLE ONLY t_dental_order ADD CONSTRAINT t_dental_order_pkey PRIMARY KEY (t_dental_order_id); ALTER INDEX public.t_dental_order_pkey OWNER TO postgres; --- สร้างตาราง t_dental_treat ใหม่ เนื่องจากมีการเปลี่ยนแปลง Flow การทำงาน DROP TABLE t_dental_treat; CREATE TABLE t_dental_treat ( t_dental_treat_id character varying(255) NOT NULL, t_patient_id character varying(255), t_visit_id character varying(255), t_diag_icd_10_id character varying(255), t_dental_order_id character varying(255) , t_order_id character varying(255) , f_dental_treat_type_id character varying(255), dental_treat_tooth character varying(255), dental_treat_side_m character varying(255), dental_treat_side_l character varying(255), dental_treat_side_d character varying(255), dental_treat_side_b character varying(255), dental_treat_side_o character varying(255), dental_treat_side_r character varying(255), b_dental_organ_id character varying(255) ); ALTER TABLE ONLY t_dental_treat ADD CONSTRAINT t_dental_treat_pkey PRIMARY KEY (t_dental_treat_id); ALTER INDEX public.t_dental_treat_pkey OWNER TO postgres; --ลบสิทธิในระบบทันตกรรม delete from f_employee_authentication where f_employee_authentication_id = '14' and employee_authentication_description = 'ทันตกรรม'; --ลบ icd9 ที่ไม่เป็นมาตรฐานสากล delete from b_icd9 where b_icd9_id >= '0541592369604' and b_icd9_id <= '0541592369647'; --ลบ icd10 ที่ไม่เป็นมาตรฐานสากล delete from b_icd10 where b_icd10_id >= '550000039053' and b_icd10_id <= '550000039379'; CREATE TABLE b_dental_employee ( b_dental_employee_id character varying(255) NOT NULL, b_employee_id character varying(255), employee_login character varying(255), employee_firstname character varying(255), employee_lastname character varying(255) ); ALTER TABLE ONLY b_dental_employee ADD CONSTRAINT b_dental_employee_pkey PRIMARY KEY (b_dental_employee_id); ALTER INDEX public.b_dental_employee_pkey OWNER TO postgres; CREATE TABLE b_dentalrp_service_point ( b_dentalrp_service_point_id character varying(255) NOT NULL, b_service_point_id character varying(255), service_point_description character varying(255) ); ALTER TABLE ONLY b_dentalrp_service_point ADD CONSTRAINT b_dentalrp_service_point_pkey PRIMARY KEY (b_dentalrp_service_point_id); ALTER INDEX public.b_dentalrp_service_point_pkey OWNER TO postgres; -- ตารางสำหรับรายงานกระทรวง CREATE TABLE f_dentalrp_government_part1_plan ( f_dentalrp_government_part1_plan_id character varying(255) NOT NULL, f_dentalrp_government_part1_plan_description character varying(255) ); ALTER TABLE ONLY f_dentalrp_government_part1_plan ADD CONSTRAINT f_dentalrp_government_part1_plan_pkey PRIMARY KEY (f_dentalrp_government_part1_plan_id); ALTER INDEX public.f_dentalrp_government_part1_plan_pkey OWNER TO postgres; INSERT INTO f_dentalrp_government_part1_plan VALUES ('1', 'ข้าราชการ/รัฐวิสาหกิจ/เบิกต้นสังกัด (ครั้ง)'); INSERT INTO f_dentalrp_government_part1_plan VALUES ('2', 'ประกันสังคม (ครั้ง)'); INSERT INTO f_dentalrp_government_part1_plan VALUES ('3', 'สิทธิ UC (ครั้ง)'); INSERT INTO f_dentalrp_government_part1_plan VALUES ('4', 'สิทธิอื่นๆ (ครั้ง)'); CREATE TABLE b_dentalrp_government_part1_general ( b_dentalrp_government_part1_general_id character varying(255) NOT NULL, f_dentalrp_government_part1_plan_id character varying(255), b_contract_plans_id character varying(255), b_contract_plans_number character varying(255), b_contract_plans_description character varying(255) ); ALTER TABLE ONLY b_dentalrp_government_part1_general ADD CONSTRAINT b_dentalrp_government_part1_general_pkey PRIMARY KEY (b_dentalrp_government_part1_general_id); ALTER INDEX public.b_dentalrp_government_part1_general_pkey OWNER TO postgres; CREATE TABLE f_dentalrp_government_part2_item ( f_dentalrp_government_part2_item_id character varying(255) NOT NULL, f_dentalrp_government_part2_item_description character varying(255) ); ALTER TABLE ONLY f_dentalrp_government_part2_item ADD CONSTRAINT f_dentalrp_government_part2_item_pkey PRIMARY KEY (f_dentalrp_government_part2_item_id); ALTER INDEX public.f_dentalrp_government_part2_item_pkey OWNER TO postgres; INSERT INTO f_dentalrp_government_part2_item VALUES ('1', 'ตรวจสุขภาพช่องปาก (ครั้ง)'); INSERT INTO f_dentalrp_government_part2_item VALUES ('2', 'sealant (ครั้ง/ซี่)'); INSERT INTO f_dentalrp_government_part2_item VALUES ('3', 'ฟลูออไรด์ (ครั้ง)'); INSERT INTO f_dentalrp_government_part2_item VALUES ('4', 'PRR (ครั้ง/ซี่)'); INSERT INTO f_dentalrp_government_part2_item VALUES ('5', 'การฝึกปฏิบัติแปรงฟัน (ครั้ง)'); INSERT INTO f_dentalrp_government_part2_item VALUES ('6', 'ทำความสะอาดช่องปาก (ครั้ง)'); CREATE TABLE b_dentalrp_government_part2_support_protect ( b_dentalrp_government_part2_support_protect_id character varying(255) NOT NULL, f_dentalrp_government_part2_item_id character varying(255), b_item_id character varying(255), b_item_number character varying(255), b_item_common_name character varying(255) ); ALTER TABLE ONLY b_dentalrp_government_part2_support_protect ADD CONSTRAINT b_dentalrp_government_part2_support_protect_pkey PRIMARY KEY (b_dentalrp_government_part2_support_protect_id); ALTER INDEX public.b_dentalrp_government_part2_support_protect_pkey OWNER TO postgres; CREATE TABLE f_dentalrp_government_part3_item ( f_dentalrp_government_part3_item_id character varying(255) NOT NULL, f_dentalrp_government_part3_item_description character varying(255) ); ALTER TABLE ONLY f_dentalrp_government_part3_item ADD CONSTRAINT f_dentalrp_government_part3_item_pkey PRIMARY KEY (f_dentalrp_government_part3_item_id); ALTER INDEX public.f_dentalrp_government_part3_item_pkey OWNER TO postgres; INSERT INTO f_dentalrp_government_part3_item VALUES ('1', 'ถอนฟัน (ครั้ง/ซี่)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('2', 'อุดฟัน (ครั้ง/ซี่)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('3', 'ขูดหินปูนทั้งปาก (ครั้ง)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('4', 'ศัลยกรรมช่องปาก (ครั้ง)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('5', 'ทันตกรรมหัตถการ (ครั้ง/ซี่)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('6', 'รักษาคลองรากฟัน (ครั้ง/ซี่)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('7', 'ปริทันต์ (ครั้ง)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('8', 'ทันตกรรมสำหรับเด็ก (ครั้ง)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('9', 'ทันตกรรมประดิษฐ์ (ครั้ง/ชิ้น)'); INSERT INTO f_dentalrp_government_part3_item VALUES ('10', 'ทันตกรรมจัดฟัน (คน/ครั้ง)'); CREATE TABLE b_dentalrp_government_part3_treat ( b_dentalrp_government_part3_treat_id character varying(255) NOT NULL, f_dentalrp_government_part3_item_id character varying(255), b_item_id character varying(255), b_item_number character varying(255), b_item_common_name character varying(255) ); ALTER TABLE ONLY b_dentalrp_government_part3_treat ADD CONSTRAINT b_dentalrp_government_part3_treat_pkey PRIMARY KEY (b_dentalrp_government_part3_treat_id); ALTER INDEX public.b_dentalrp_government_part3_treat_pkey OWNER TO postgres; CREATE TABLE f_dentalrp_government_part4_plan ( f_dentalrp_government_part4_plan_id character varying(255) NOT NULL, f_dentalrp_government_part4_plan_description character varying(255) ); ALTER TABLE ONLY f_dentalrp_government_part4_plan ADD CONSTRAINT f_dentalrp_government_part4_plan_pkey PRIMARY KEY (f_dentalrp_government_part4_plan_id); ALTER INDEX public.f_dentalrp_government_part4_plan_pkey OWNER TO postgres; INSERT INTO f_dentalrp_government_part4_plan VALUES ('1', 'ข้าราชการ/รัฐวิสาหกิจ'); INSERT INTO f_dentalrp_government_part4_plan VALUES ('2', 'ประกันสังคม'); INSERT INTO f_dentalrp_government_part4_plan VALUES ('3', 'UC ผู้สูงอายุ'); INSERT INTO f_dentalrp_government_part4_plan VALUES ('4', 'สิทธิ UC อื่น'); INSERT INTO f_dentalrp_government_part4_plan VALUES ('5', 'สิทธิอื่น'); CREATE TABLE f_dentalrp_government_part4_item ( f_dentalrp_government_part4_item_id character varying(255) NOT NULL, f_dentalrp_government_part4_item_description character varying(255) ); ALTER TABLE ONLY f_dentalrp_government_part4_item ADD CONSTRAINT f_dentalrp_government_part4_item_pkey PRIMARY KEY (f_dentalrp_government_part4_item_id); ALTER INDEX public.f_dentalrp_government_part4_item_pkey OWNER TO postgres; INSERT INTO f_dentalrp_government_part4_item VALUES ('1', 'ARPD (คน/ชิ้น)'); INSERT INTO f_dentalrp_government_part4_item VALUES ('2', 'MRPD,Removeable Bridge (คน/ชิ้น)'); INSERT INTO f_dentalrp_government_part4_item VALUES ('3', 'Single Complete Denture (คน)'); INSERT INTO f_dentalrp_government_part4_item VALUES ('4', 'Complete Denture (คน)'); CREATE TABLE b_dentalrp_government_part4_invent_plan ( b_dentalrp_government_part4_invent_plan_id character varying(255) NOT NULL, f_dentalrp_government_part4_plan_id character varying(255), b_contract_plans_id character varying(255), b_contract_plans_number character varying(255), b_contract_plans_description character varying(255) ); ALTER TABLE ONLY b_dentalrp_government_part4_invent_plan ADD CONSTRAINT b_dentalrp_government_part4_invent_plan_pkey PRIMARY KEY (b_dentalrp_government_part4_invent_plan_id); ALTER INDEX public.b_dentalrp_government_part4_invent_plan_pkey OWNER TO postgres; CREATE TABLE b_dentalrp_government_part4_invent_item ( b_dentalrp_government_part4_invent_item_id character varying(255) NOT NULL, f_dentalrp_government_part4_item_id character varying(255), b_item_id character varying(255), b_item_number character varying(255), b_item_common_name character varying(255) ); ALTER TABLE ONLY b_dentalrp_government_part4_invent_item ADD CONSTRAINT b_dentalrp_government_part4_invent_item_pkey PRIMARY KEY (b_dentalrp_government_part4_invent_item_id); ALTER INDEX public.b_dentalrp_government_part4_invent_item_pkey OWNER TO postgres; INSERT INTO s_dental_version VALUES ('9730000000002', '2', 'Dental Module Version 1', '1.1.070707', '1.1.070707', '2550-07-07 17:33:33'); ---------------------------------------------------------- END OF Version 1.1.070707-----------------------------------------
true
ebdab90d5a03bfaa66d1aed135dd1b4dcf05bb26
SQL
deadbird1980/ams
/app/db/visa_application.sql
UTF-8
603
2.625
3
[]
no_license
DROP TABLE IF EXISTS `visa_application`; CREATE TABLE `visa_application` ( `id` int(11) NOT NULL, `application_id` int(11) NOT NULL, `type` char(10) NOT NULL DEFAULT '', `start_date` date NOT NULL, `passport_no` char(10) NOT NULL DEFAULT '', `passport_start_date` date NOT NULL, `passport_end_date` date NOT NULL, `birthday` date NOT NULL, `organization` char(50) NOT NULL, `passport_name` char(50) NOT NULL DEFAULT '', `visa_start_date` date NOT NULL, `visa_end_date` date NOT NULL, `address` char(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
true
41d260545fc4444d4d6ff16f8783e031e0092f6b
SQL
lisamarie616/sql-crowdfunding-lab-v-000
/lib/insert.sql
UTF-8
1,845
2.640625
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
INSERT INTO projects (id, title, category, funding_goal, start_date, end_date) VALUES (1, "Cat Mansion Renovation", "Cats", 150000, "12/30/2015", "12/31/2015"), (2, "Cat Toy Replacement", "Cats", 10000, "01/15/2016", "01/31/2016"), (3, "Cat Food Stock-up", "Cats", 25000, "01/01/2016", "01/07/2016"), (4, "Dog House Renovation", "Dogs", 1000000, "12/30/2015", "12/31/2015"), (5, "Dog Toy Replacement", "Dogs", 50000, "01/01/2016", "01/15/2016"), (6, "Dog Food Stock-up", "Dogs", 25000, "01/01/2016", "01/07/2016"), (7, "Film Awesome Movie", "Entertainment", 250000, "02/05/2016", "02/28/2016"), (8, "Start amazing new company", "Entrepreneurship", 175000, "01/01/2016", "01/01/2016"), (9, "Set up new art studio", "Art", 75000, "03/01/2016", "03/22/2016"), (10, "Make soundtrack for awesome movie", "Entertainment", 22000, "03/01/2016", "03/16/2016"); INSERT INTO users (id, name, age) VALUES (1, "Scotty", 9), (2, "Teddy", 8), (3, "Matthew", 33), (4, "Lisa", 30), (5, "Pan", 27), (6, "Sarah", 26), (7, "Melissa", 25), (8, "Kelly", 28), (9, "Nikki", 29), (10, "Rita", 37), (11, "Marissa", 34), (12, "Alicia", 27), (13, "Andrew", 29), (14, "Lynn", 27), (15, "Molly", 30), (16, "Zach", 29), (17, "Danielle", 32), (18, "Jamie", 32), (19, "Heather", 31), (20, "Sara", 30); INSERT INTO pledges (id, amount, user_id, project_id) VALUES (1, 100, 1, 10), (2, 200, 2, 9), (3, 150, 3, 9), (4, 100, 4, 8), (5, 100, 5, 8), (6, 150, 6, 8), (7, 1000, 7, 7), (8, 248, 8, 6), (9, 9830, 9, 2), (10, 28, 10, 8), (11, 99, 11, 1), (12, 97, 12, 2), (13, 18, 14, 4), (14, 1999, 15, 5), (15, 900, 16, 6), (16, 1000, 17, 4), (17, 300, 19, 5), (18, 300, 19, 6), (19, 300, 19, 7), (20, 300, 19, 8), (21, 99, 11, 1), (22, 99, 11, 2), (23, 99, 11, 3), (24, 99, 11, 4), (25, 99, 11, 5), (26, 99, 11, 6), (27, 20, 1, 10), (28, 20, 1, 9), (29, 20, 1, 8), (30, 20, 1, 7);
true
0e5b435a2655acc83832455866c4f811bf4fb9e1
SQL
AlinaSadovskaya/DataMola_course
/U2/lw7/scripts/mv_model_clouse.sql
UTF-8
1,392
3.640625
4
[]
no_license
DROP MATERIALIZED VIEW mv_PRICE_SALES_MONTHLY; CREATE MATERIALIZED VIEW mv_PRICE_SALES_MONTHLY BUILD IMMEDIATE REFRESH COMPLETE ON DEMAND START WITH SYSDATE NEXT (SYSDATE + 1/1440) AS SELECT /*+ parallel(ff 8 prg 8)*/ DISTINCT PRODUCT_NAME AS PRODUCT , NVL(PROMOTION, 'ALL SALES') AS PROMOTION , price , price_percent FROM SA_CUSTOMERS.sa_transaction WHERE TRUNC ( DATE_TRANSACTION, 'mm' ) = TO_DATE ( '06.01.20' , 'MM.DD.YY' ) group by CUBE(PRODUCT_NAME, promotion) HAVING PRODUCT_NAME IS NOT NULL MODEL DIMENSION BY ( PRODUCT_NAME, PROMOTION) MEASURES ( SUM(price) PRICE, SUM ( price_percent*price/100) price_percent) RULES ( PRICE [NULL, FOR promotion IN (SELECT promotion FROM DW_CL.dw_cl_transaction group by promotion)] = SUM ( PRICE )[any, cv(promotion)], price_percent [NULL, FOR promotion IN (SELECT promotion FROM DW_CL.dw_cl_transaction group by promotion)] = SUM ( price_percent )[any, cv(promotion)] ) ORDER BY PRODUCT_NAME, price_percent desc; SELECT * FROM MV_PRICE_SALES_MONTHLY; UPDATE SA_CUSTOMERS.sa_transaction set PRICE=PRICE/2 where PRODUCT_NAME = 'Andrew Marc' AND PROMOTION = 'sale 8%'; COMMIT;
true
b3e0e75a0d13b645f201c742f1d173058f62f0ec
SQL
liyasthomas/feedie
/database/feedie_base (Test Build).sql
UTF-8
40,528
3.34375
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 10, 2018 at 03:26 PM -- Server version: 10.1.29-MariaDB -- PHP Version: 7.2.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `feedie_base` -- -- -------------------------------------------------------- -- -- Table structure for table `feeds` -- CREATE TABLE `feeds` ( `feed_no` int(6) NOT NULL, `st_username` varchar(50) NOT NULL, `te_username` varchar(50) NOT NULL, `sub_code` varchar(7) NOT NULL, `sub_name` varchar(50) NOT NULL, `class` varchar(20) NOT NULL, `q1` int(2) DEFAULT NULL, `q2` int(2) DEFAULT NULL, `q3` int(2) DEFAULT NULL, `q4` int(2) DEFAULT NULL, `q5` int(2) DEFAULT NULL, `q6` int(2) DEFAULT NULL, `q7` int(2) DEFAULT NULL, `q8` int(2) DEFAULT NULL, `q9` int(2) DEFAULT NULL, `q10` int(2) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `hods` -- CREATE TABLE `hods` ( `hod_username` varchar(50) NOT NULL, `password` varchar(30) NOT NULL, `dept` varchar(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `hods` -- INSERT INTO `hods` (`hod_username`, `password`, `dept`) VALUES ('AUEHOD', 'auehod', 'AUE'), ('CSEHOD', 'csehod', 'CSE'), ('ECEHOD', 'eceecehod', 'ECE'), ('EEEHOD', 'eeehod', 'EEE'), ('MEHOD', 'mehod', 'ME'); -- -------------------------------------------------------- -- -- Table structure for table `maintainers` -- CREATE TABLE `maintainers` ( `ma_username` varchar(30) NOT NULL, `password` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `maintainers` -- INSERT INTO `maintainers` (`ma_username`, `password`) VALUES ('master', 'master'); -- -------------------------------------------------------- -- -- Table structure for table `questions` -- CREATE TABLE `questions` ( `quest_id` int(2) NOT NULL, `quest_content` varchar(250) DEFAULT NULL, `quest_value` int(2) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `questions` -- INSERT INTO `questions` (`quest_id`, `quest_content`, `quest_value`) VALUES (1, 'The teacher covers the entire syllabus', 0), (2, 'The teacher discusses topics in detail', 0), (3, 'The teacher possesses deep knowledge of the subject taught', 0), (4, 'The teacher communicate clearly', 0), (5, 'The teacher inspires me by his/her knowledge in the subject', 0), (6, 'The teacher is punctual to the class', 0), (7, 'The teacher engages the class for the full duration and completes the course in time', 0), (8, 'The teacher comes fully prepared for the class', 0), (9, 'The teacher provide guidance outside/inside the class', 0), (10, 'The teacher was available to answer questions in office hours', 0); -- -------------------------------------------------------- -- -- Table structure for table `ratings` -- CREATE TABLE `ratings` ( `r_no` int(1) NOT NULL, `r_value` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `ratings` -- INSERT INTO `ratings` (`r_no`, `r_value`) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); -- -------------------------------------------------------- -- -- Table structure for table `students` -- CREATE TABLE `students` ( `rollno` varchar(10) NOT NULL, `st_username` varchar(25) NOT NULL, `class` varchar(8) NOT NULL, `password` varchar(30) DEFAULT NULL, `done` int(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `students` -- INSERT INTO `students` (`rollno`, `st_username`, `class`, `password`, `done`) VALUES /* S2 CSE-A (TOTAL: 31) */ ('NCE15CS053', 'Harikrishnan C H', 'CSE-A S2', 'nce15cs053', 0), ('NCE17CS001', 'Adith S', 'CSE-A S2', 'nce17cs001', 0), ('NCE17CS002', 'Afseena A', 'CSE-A S2', 'nce17cs002', 0), ('NCE17CS003', 'Aiswarya M', 'CSE-A S2', 'nce17cs003', 0), ('NCE17CS004', 'Akarsh K Murthy', 'CSE-A S2', 'nce17cs004', 0), ('NCE17CS005', 'Akshay Sanker M', 'CSE-A S2', 'nce17cs005', 0), ('NCE17CS006', 'Amrutha R', 'CSE-A S2', 'nce17cs006', 0), ('NCE17CS008', 'Anu P', 'CSE-A S2', 'nce17cs008', 0), ('NCE17CS009', 'Anupama V S', 'CSE-A S2', 'nce17cs009', 0), ('NCE17CS010', 'Deepika R', 'CSE-A S2', 'nce17cs010', 0), ('NCE17CS011', 'Devika S Nair', 'CSE-A S2', 'nce17cs011', 0), ('NCE17CS012', 'Divya P', 'CSE-A S2', 'nce17cs012', 0), ('NCE17CS013', 'Fathima Nasreen K H', 'CSE-A S2', 'nce17cs013', 0), ('NCE17CS014', 'Goutham Gopinath', 'CSE-A S2', 'nce17cs014', 0), ('NCE17CS015', 'Leenu Mathew', 'CSE-A S2', 'nce17cs015', 0), ('NCE17CS016', 'Likha', 'CSE-A S2', 'nce17cs016', 0), ('NCE17CS017', 'Nishana N', 'CSE-A S2', 'nce17cs017', 0), ('NCE17CS018', 'Risna C M', 'CSE-A S2', 'nce17cs018', 0), ('NCE17CS019', 'Rohit Bhaskar Uday', 'CSE-A S2', 'nce17cs019', 0), ('NCE17CS020', 'S Suhaila ', 'CSE-A S2', 'nce17cs020', 0), ('NCE17CS021', 'Sahla K', 'CSE-A S2', 'nce17cs021', 0), ('NCE17CS022', 'Sanmayanandkrishna A H', 'CSE-A S2', 'nce17cs022', 0), ('NCE17CS023', 'Shibila S', 'CSE-A S2', 'nce17cs023', 0), ('NCE17CS024', 'Shinu ', 'CSE-A S2', 'nce17cs024', 0), ('NCE17CS025', 'Silpa C ', 'CSE-A S2', 'nce17cs025', 0), ('NCE17CS026', 'Silpa M S', 'CSE-A S2', 'nce17cs026', 0), ('NCE17CS027', 'Sneha A', 'CSE-A S2', 'nce17cs027', 0), ('NCE17CS028', 'Vipindas V R', 'CSE-A S2', 'nce17cs028', 0), ('NCE17CS029', 'Vishnu H', 'CSE-A S2', 'nce17cs029', 0), ('NCE17CS030', 'Vishnu S', 'CSE-A S2', 'nce17cs030', 0), /* S4 CSE-A (TOTAL: 58) */ ('NCE16CS001', 'Abhijith P U', 'CSE-A S4', 'nce16cs001', 0), ('NCE16CS002', 'Abhijith Warrier', 'CSE-A S4', 'nce16cs002', 0), ('NCE16CS003', 'Abhinand N ', 'CSE-A S4', 'nce16cs003', 0), ('NCE16CS004', 'Abijith P', 'CSE-A S4', 'nce16cs004', 0), ('NCE16CS005', 'Acksa Varghese', 'CSE-A S4', 'nce16cs005', 0), ('NCE16CS006', 'Adarsh R', 'CSE-A S4', 'nce16cs006', 0), ('NCE16CS007', 'Adithyan D', 'CSE-A S4', 'nce16cs007', 0), ('NCE16CS008', 'Aditya Padmanabhan', 'CSE-A S4', 'nce16cs008', 0), ('NCE16CS009', 'Agil Krishna', 'CSE-A S4', 'nce16cs009', 0), ('NCE16CS010', 'Ahlad V K', 'CSE-A S4', 'nce16cs010', 0), ('NCE16CS011', 'Aiswarya Jagadeesh', 'CSE-A S4', 'nce16cs011', 0), ('NCE16CS012', 'Aiswarya Raj', 'CSE-A S4', 'nce16cs012', 0), ('NCE16CS013', 'Ajay E K', 'CSE-A S4', 'nce16cs013', 0), ('NCE16CS014', 'Ajmal Roshan K C', 'CSE-A S4', 'nce16cs014', 0), ('NCE16CS015', 'Akhila V', 'CSE-A S4', 'nce16cs015', 0), ('NCE16CS017', 'Akhil K P ', 'CSE-A S4', 'nce16cs017', 0), ('NCE16CS018', 'Akhil M', 'CSE-A S4', 'nce16cs018', 0), ('NCE16CS019', 'Akhil T P', 'CSE-A S4', 'nce16cs019', 0), ('NCE16CS020', 'Akshay Kumar R', 'CSE-A S4', 'nce16cs020', 0), ('NCE16CS022', 'Amrutha.R', 'CSE-A S4', 'nce16cs022', 0), ('NCE16CS023', 'Anand Krishnan N M', 'CSE-A S4', 'nce16cs023', 0), ('NCE16CS024', 'Anjana R', 'CSE-A S4', 'nce16cs024', 0), ('NCE16CS026', 'Ansar A', 'CSE-A S4', 'nce16cs026', 0), ('NCE16CS027', 'Anupriya Vijayan E K', 'CSE-A S4', 'nce16cs027', 0), ('NCE16CS028', 'Archana R', 'CSE-A S4', 'nce16cs028', 0), ('NCE16CS029', 'Ardra P', 'CSE-A S4', 'nce16cs029', 0), ('NCE16CS030', 'Arjun Balachandran', 'CSE-A S4', 'nce16cs030', 0), ('NCE16CS031', 'Arun P', 'CSE-A S4', 'nce16cs031', 0), ('NCE16CS033', 'Athira Murali T E', 'CSE-A S4', 'nce16cs033', 0), ('NCE16CS034', 'Atul I Nair', 'CSE-A S4', 'nce16cs034', 0), ('NCE16CS035', 'Ayisha', 'CSE-A S4', 'nce16cs035', 0), ('NCE16CS036', 'Ayisha Showkath ', 'CSE-A S4', 'nce16cs036', 0), ('NCE16CS037', 'Beneetta P B', 'CSE-A S4', 'nce16cs037', 0), ('NCE16CS038', 'Bijith Kaladharan', 'CSE-A S4', 'nce16cs038', 0), ('NCE16CS039', 'Chaithra K M', 'CSE-A S4', 'nce16cs039', 0), ('NCE16CS040', 'Cheloor Saravanan', 'CSE-A S4', 'nce16cs040', 0), ('NCE16CS041', 'Deepthidas R', 'CSE-A S4', 'nce16cs041', 0), ('NCE16CS042', 'Dhanish I', 'CSE-A S4', 'nce16cs042', 0), ('NCE16CS043', 'Dhanya V ', 'CSE-A S4', 'nce16cs043', 0), ('NCE16CS044', 'Dhaya V Nair', 'CSE-A S4', 'nce16cs044', 0), ('NCE16CS045', 'Dhrishya Vijayan', 'CSE-A S4', 'nce16cs045', 0), ('NCE16CS046', 'Fidha C S', 'CSE-A S4', 'nce16cs046', 0), ('NCE16CS047', 'Girish C', 'CSE-A S4', 'nce16cs047', 0), ('NCE16CS048', 'Gopika G Nair', 'CSE-A S4', 'nce16cs048', 0), ('NCE16CS049', 'Gopika J', 'CSE-A S4', 'nce16cs049', 0), ('NCE16CS050', 'Gopika V', 'CSE-A S4', 'nce16cs050', 0), ('NCE16CS051', 'Gowtham Kumar J', 'CSE-A S4', 'nce16cs051', 0), ('NCE16CS052', 'Greeshma Surendran', 'CSE-A S4', 'nce16cs052', 0), ('NCE16CS053', 'Hareesh P V', 'CSE-A S4', 'nce16cs053', 0), ('NCE16CS055', 'Hijaz Ibrahim', 'CSE-A S4', 'nce16cs055', 0), ('NCE16CS056', 'Hridya A H', 'CSE-A S4', 'nce16cs056', 0), ('NCE16CS057', 'I B Amritha', 'CSE-A S4', 'nce16cs057', 0), ('NCE16CS060', 'Jishnu Raj', 'CSE-A S4', 'nce16cs060', 0), ('NCE16CS061', 'Jithin B', 'CSE-A S4', 'nce16cs061', 0), ('NCE16CS062', 'Karthik K S', 'CSE-A S4', 'nce16cs062', 0), ('NCE15CS039', 'Megha A U', 'CSE-A S4', 'nce15cs039', 0), ('NCE15CS053', 'Prasanth S', 'CSE-A S4', 'nce15cs053', 0), ('NCE15CS054', 'Rahul Dev', 'CSE-A S4', 'nce15cs054', 0), /* S4 CSE-B (TOTAL: 57) */ ('LNCE16CS123', 'Vinduja Narayanan K', 'CSE-B S4', 'lnce16cs123', 0), ('NCE15CS052', 'Prasad D', 'CSE-B S4', 'nce15cs052', 0), ('NCE16CS063', 'Kavya Prasad', 'CSE-B S4', 'nce16cs063', 0), ('NCE16CS064', 'Layana T V', 'CSE-B S4', 'nce16cs064', 0), ('NCE16CS065', 'Madheena Beegam A', 'CSE-B S4', 'nce16cs065', 0), ('NCE16CS066', 'Manju K M', 'CSE-B S4', 'nce16cs066', 0), ('NCE16CS067', 'Manu M', 'CSE-B S4', 'nce16cs067', 0), ('NCE16CS068', 'Mathew Albert Shibu', 'CSE-B S4', 'nce16cs068', 0), ('NCE16CS069', 'Minu O', 'CSE-B S4', 'nce16cs069', 0), ('NCE16CS070', 'Mohammed Faisal K V', 'CSE-B S4', 'nce16cs070', 0), ('NCE16CS071', 'Mridula Parthan', 'CSE-B S4', 'nce16cs071', 0), ('NCE16CS072', 'Muhammad Mubashir T', 'CSE-B S4', 'nce16cs072', 0), ('NCE16CS073', 'Muhammad Niyas K K', 'CSE-B S4', 'nce16cs073', 0), ('NCE16CS074', 'Nair Krishnanjali ', 'CSE-B S4', 'nce16cs074', 0), ('NCE16CS075', 'Navaneeth K', 'CSE-B S4', 'nce16cs075', 0), ('NCE16CS076', 'Nikhil M', 'CSE-B S4', 'nce16cs076', 0), ('NCE16CS079', 'Niyas S', 'CSE-B S4', 'nce16cs079', 0), ('NCE16CS080', 'Parvathi P', 'CSE-B S4', 'nce16cs080', 0), ('NCE16CS081', 'Parvathy M', 'CSE-B S4', 'nce16cs081', 0), ('NCE16CS082', 'P Goutham', 'CSE-B S4', 'nce16cs082', 0), ('NCE16CS083', 'Pooja Krishnan', 'CSE-B S4', 'nce16cs083', 0), ('NCE16CS084', 'Pooja S Nair', 'CSE-B S4', 'nce16cs084', 0), ('NCE16CS085', 'Pranav A K', 'CSE-B S4', 'nce16cs085', 0), ('NCE16CS087', 'Prasad Praveen', 'CSE-B S4', 'nce16cs087', 0), ('NCE16CS088', 'Priyamvada K', 'CSE-B S4', 'nce16cs088', 0), ('NCE16CS089', 'Rajkiran V R', 'CSE-B S4', 'nce16cs089', 0), ('NCE16CS090', 'Ramsiya M', 'CSE-B S4', 'nce16cs090', 0), ('NCE16CS091', 'Rasikh Mohammed K', 'CSE-B S4', 'nce16cs091', 0), ('NCE16CS092', 'Reema N B', 'CSE-B S4', 'nce16cs092', 0), ('NCE16CS093', 'Renjith Krishna Menon', 'CSE-B S4', 'nce16cs093', 0), ('NCE16CS094', 'Reshma ', 'CSE-B S4', 'nce16cs094', 0), ('NCE16CS095', 'Reshma Vijayakumar', 'CSE-B S4', 'nce16cs095', 0), ('NCE16CS096', 'Rohith T R', 'CSE-B S4', 'nce16cs096', 0), ('NCE16CS097', 'Roshin Sosa Philip', 'CSE-B S4', 'nce16cs097', 0), ('NCE16CS099', 'Shafeeq Rahman C P', 'CSE-B S4', 'nce16cs099', 0), ('NCE16CS100', 'Shahad S', 'CSE-B S4', 'nce16cs100', 0), ('NCE16CS101', 'Shahina V', 'CSE-B S4', 'nce16cs101', 0), ('NCE16CS102', 'Shree Parvathy Devi M', 'CSE-B S4', 'nce16cs102', 0), ('NCE16CS103', 'Sivarajan M', 'CSE-B S4', 'nce16cs103', 0), ('NCE16CS104', 'Sneha T', 'CSE-B S4', 'nce16cs104', 0), ('NCE16CS105', 'Sreejith D Nair', 'CSE-B S4', 'nce16cs105', 0), ('NCE16CS106', 'Sreejith S Kumar', 'CSE-B S4', 'nce16cs106', 0), ('NCE16CS107', 'Sreeju S', 'CSE-B S4', 'nce16cs107', 0), ('NCE16CS108', 'Sreelakshmi Girisan', 'CSE-B S4', 'nce16cs108', 0), ('NCE16CS109', 'Sreelakshmi T V', 'CSE-B S4', 'nce16cs109', 0), ('NCE16CS110', 'Sreeshma M', 'CSE-B S4', 'nce16cs110', 0), ('NCE16CS111', 'Srinath G', 'CSE-B S4', 'nce16cs111', 0), ('NCE16CS112', 'Surjith Shankar S', 'CSE-B S4', 'nce16cs112', 0), ('NCE16CS113', 'Swetha N V', 'CSE-B S4', 'nce16cs113', 0), ('NCE16CS114', 'Thasini A', 'CSE-B S4', 'nce16cs114', 0), ('NCE16CS115', 'Ummer Hashim M', 'CSE-B S4', 'nce16cs115', 0), ('NCE16CS116', 'Vani Suresh', 'CSE-B S4', 'nce16cs116', 0), ('NCE16CS117', 'Vignesh C R', 'CSE-B S4', 'nce16cs117', 0), ('NCE16CS118', 'Vinayak Dev M', 'CSE-B S4', 'nce16cs118', 0), ('NCE16CS119', 'Vishnu Prasad E', 'CSE-B S4', 'nce16cs119', 0), ('NCE16CS120', 'Viswas ', 'CSE-B S4', 'nce16cs120', 0), ('NCE16CS121', 'Vydehi K', 'CSE-B S4', 'nce16cs121', 0), /* S6 CSE-A (TOTAL: 39) */ ('NCE15CS001', 'Aathira V E', 'CSE-A S6', 'nce15cs001', 0), ('NCE15CS002', 'Abhijith C', 'CSE-A S6', 'nce15cs002', 0), ('NCE15CS004', 'Adith K V', 'CSE-A S6', 'nce15cs004', 0), ('NCE15CS006', 'Aishwarya Ravi', 'CSE-A S6', 'nce15cs006', 0), ('NCE15CS007', 'Aiswarya S Prakash', 'CSE-A S6', 'nce15cs007', 0), ('NCE15CS008', 'Ajith P G', 'CSE-A S6', 'nce15cs008', 0), ('NCE15CS010', 'Akhila Keshav', 'CSE-A S6', 'nce15cs010', 0), ('NCE15CS011', 'Akhila N', 'CSE-A S6', 'nce15cs011', 0), ('NCE15CS012', 'Amrutha K B', 'CSE-A S6', 'nce15cs012', 0), ('NCE15CS013', 'Anagha S Thadathil', 'CSE-A S6', 'nce15cs013', 0), ('NCE15CS014', 'Anjali Sunil', 'CSE-A S6', 'nce15cs014', 0), ('NCE15CS015', 'Anjana Das', 'CSE-A S6', 'nce15cs015', 0), ('NCE15CS016', 'Anusha K A', 'CSE-A S6', 'nce15cs016', 0), ('NCE15CS017', 'Arjun Jayesh', 'CSE-A S6', 'nce15cs017', 0), ('NCE15CS018', 'Aswathy M K', 'CSE-A S6', 'nce15cs018', 0), ('NCE15CS019', 'Athulya M K', 'CSE-A S6', 'nce15cs019', 0), ('NCE15CS020', 'Baby Shafna K M', 'CSE-A S6', 'nce15cs020', 0), ('NCE15CS022', 'Bindhuja P', 'CSE-A S6', 'nce15cs022', 0), ('NCE15CS023', 'Chandni Chakkungal', 'CSE-A S6', 'nce15cs023', 0), ('NCE15CS024', 'Devkiran M', 'CSE-A S6', 'nce15cs024', 0), ('NCE15CS025', 'Diya Lakshmi P', 'CSE-A S6', 'nce15cs025', 0), ('NCE15CS026', 'Geethu Seby', 'CSE-A S6', 'nce15cs026', 0), ('NCE15CS027', 'Heera Mohan', 'CSE-A S6', 'nce15cs027', 0), ('NCE15CS028', 'Ijas Ali', 'CSE-A S6', 'nce15cs028', 0), ('NCE15CS029', 'Jayalakshmi S', 'CSE-A S6', 'nce15cs029', 0), ('NCE15CS030', 'Jayaraj A', 'CSE-A S6', 'nce15cs030', 0), ('NCE15CS031', 'Jijo Daniel', 'CSE-A S6', 'nce15cs031', 0), ('NCE15CS033', 'Jithin P Ganesh', 'CSE-A S6', 'nce15cs033', 0), ('NCE15CS032', 'Jithin Palathingal', 'CSE-A S6', 'nce15cs032', 0), ('NCE15CS034', 'Jovial John George', 'CSE-A S6', 'nce15cs034', 0), ('NCE15CS035', 'Keerthana Unnikrishnan', 'CSE-A S6', 'nce15cs035', 0), ('NCE15CS037', 'Liyas Thomas', 'CSE-A S6', 'nce15cs037', 0), ('NCE15CS038', 'Meera M', 'CSE-A S6', 'nce15cs038', 0), ('NCE15CS040', 'Merin George C', 'CSE-A S6', 'nce15cs040', 0), ('NCE15CS041', 'Mohammed Anoop P N', 'CSE-A S6', 'nce15cs041', 0), ('NCE15CS042', 'Muvin M', 'CSE-A S6', 'nce15cs042', 0), ('NCE15CS043', 'Namitha H', 'CSE-A S6', 'nce15cs043', 0), ('NCE15CS044', 'Nandini V K', 'CSE-A S6', 'nce15cs044', 0), ('NCE15CS045', 'Nidhi K S', 'CSE-A S6', 'nce15cs045', 0), /* S6 CSE-B (TOTAL: 39) */ ('NCE15CS046', 'Nikhil Nair', 'CSE-B S6', 'nce15cs046', 0), ('NCE15CS047', 'Nirmal K', 'CSE-B S6', 'nce15cs047', 0), ('NCE15CS048', 'Nithin P', 'CSE-B S6', 'nce15cs048', 0), ('NCE15CS049', 'Noel Jackson', 'CSE-B S6', 'nce15cs049', 0), ('NCE15CS050', 'Nusaiba K K', 'CSE-B S6', 'nce15cs050', 0), ('NCE15CS051', 'Pranav P S', 'CSE-B S6', 'nce15cs051', 0), ('NCE15CS055', 'Rahul K', 'CSE-B S6', 'nce15cs055', 0), ('NCE15CS056', 'Raphel Shaji', 'CSE-B S6', 'nce15cs056', 0), ('NCE15CS057', 'Rehana K C', 'CSE-B S6', 'nce15cs057', 0), ('NCE15CS058', 'Resmi M', 'CSE-B S6', 'nce15cs058', 0), ('NCE15CS059', 'Rishika P P', 'CSE-B S6', 'nce15cs059', 0), ('NCE15CS060', 'Rohit', 'CSE-B S6', 'nce15cs060', 0), ('NCE15CS061', 'Rohith M S', 'CSE-B S6', 'nce15cs061', 0), ('NCE15CS062', 'Roopesh R', 'CSE-B S6', 'nce15cs062', 0), ('NCE15CS063', 'Safna A M', 'CSE-B S6', 'nce15cs063', 0), ('NCE15CS064', 'Sanjai A', 'CSE-B S6', 'nce15cs064', 0), ('NCE15CS065', 'Shafna S', 'CSE-B S6', 'nce15cs065', 0), ('NCE15CS066', 'Shahana P B', 'CSE-B S6', 'nce15cs066', 0), ('NCE15CS067', 'Shyam Prakash S', 'CSE-B S6', 'nce15cs067', 0), ('NCE15CS068', 'Shyamaprasad V', 'CSE-B S6', 'nce15cs068', 0), ('NCE15CS069', 'Sindhuja M S', 'CSE-B S6', 'nce15cs069', 0), ('NCE15CS070', 'Sneha C', 'CSE-B S6', 'nce15cs070', 0), ('NCE15CS071', 'Sreejith E R', 'CSE-B S6', 'nce15cs071', 0), ('NCE15CS072', 'Sruthi P', 'CSE-B S6', 'nce15cs072', 0), ('NCE15CS074', 'Sufyan P K', 'CSE-B S6', 'nce15cs074', 0), ('NCE15CS075', 'Sumayya Sherin S', 'CSE-B S6', 'nce15cs075', 0), ('NCE15CS076', 'Swathi S', 'CSE-B S6', 'nce15cs076', 0), ('NCE15CS077', 'Swetha Subrahmanian P', 'CSE-B S6', 'nce15cs077', 0), ('NCE15CS078', 'Swetha V Devan', 'CSE-B S6', 'nce15cs078', 0), ('NCE15CS079', 'Thushara Thulasidas Nair', 'CSE-B S6', 'nce15cs079', 0), ('NCE15CS080', 'Vaishnavi Santhosh', 'CSE-B S6', 'nce15cs080', 0), ('NCE15CS081', 'Varadarajan A H', 'CSE-B S6', 'nce15cs081', 0), ('NCE15CS082', 'Vineeth V', 'CSE-B S6', 'nce15cs082', 0), ('NCE15CS083', 'Vineetha V', 'CSE-B S6', 'nce15cs083', 0), ('NCE15CS084', 'Vishnu B', 'CSE-B S6', 'nce15cs084', 0), ('NCE15CS086', 'Vishnu Prasad M K', 'CSE-B S6', 'nce15cs086', 0), ('NCE15CS085', 'Vishnu R', 'CSE-B S6', 'nce15cs085', 0), ('NCE15CS087', 'Vivek T V', 'CSE-B S6', 'nce15cs087', 0), ('PCE15CS005', 'Jeffi Reji', 'CSE-B S6', 'pce15cs005', 0), /* EEE-A S6 (TOTAL: 63) */ ('NCE15EE001', 'Abhijit Krishnan A', 'EEE-A S6', 'nce15ee001', 0), ('NCE15EE002', 'Abhiram C K', 'EEE-A S6', 'nce15ee002', 0), ('NCE15EE003', 'Aboo Faris', 'EEE-A S6', 'nce15ee003', 0), ('NCE15EE004', 'Adithya Krishna', 'EEE-A S6', 'nce15ee004', 0), ('NCE15EE005', 'Ambili V', 'EEE-A S6', 'nce15ee005', 0), ('NCE15EE006', 'Anjali A', 'EEE-A S6', 'nce15ee006', 0), ('NCE15EE007', 'Anjith. R. Nair', 'EEE-A S6', 'nce15ee007', 0), ('NCE15EE008', 'Arjun A', 'EEE-A S6', 'nce15ee008', 0), ('NCE15EE009', 'Arjun Sasikumar', 'EEE-A S6', 'nce15ee009', 0), ('NCE15EE010', 'Arjun Surendran', 'EEE-A S6', 'nce15ee010', 0), ('NCE15EE011', 'Arshifa A', 'EEE-A S6', 'nce15ee011', 0), ('NCE15EE012', 'Arun V P', 'EEE-A S6', 'nce15ee012', 0), ('NCE15EE013', 'Arun Mohan V', 'EEE-A S6', 'nce15ee013', 0), ('NCE15EE014', 'Aswathy A', 'EEE-A S6', 'nce15ee014', 0), ('NCE15EE015', 'Athira S', 'EEE-A S6', 'nce15ee015', 0), ('NCE15EE016', 'Athul Kamal R', 'EEE-A S6', 'nce15ee016', 0), ('NCE15EE017', 'Basil P. Poulose', 'EEE-A S6', 'nce15ee017', 0), ('NCE15EE018', 'Binu Raj C', 'EEE-A S6', 'nce15ee018', 0), ('NCE15EE019', 'Davis Varghese', 'EEE-A S6', 'nce15ee019', 0), ('NCE15EE020', 'Deon Mohammed', 'EEE-A S6', 'nce15ee020', 0), ('NCE15EE021', 'Diya R', 'EEE-A S6', 'nce15ee021', 0), ('NCE15EE022', 'Gayathri Muralidharan', 'EEE-A S6', 'nce15ee022', 0), ('NCE15EE023', 'Greeshma K', 'EEE-A S6', 'nce15ee023', 0), ('NCE15EE024', 'Harikrishna P', 'EEE-A S6', 'nce15ee024', 0), ('NCE15EE025', 'Hima M', 'EEE-A S6', 'nce15ee025', 0), ('NCE15EE026', 'Hima M M', 'EEE-A S6', 'nce15ee026', 0), ('NCE15EE027', 'Jagath G', 'EEE-A S6', 'nce15ee027', 0), ('NCE15EE028', 'Jayakrishnan K', 'EEE-A S6', 'nce15ee028', 0), ('NCE15EE029', 'Karthik R Revi', 'EEE-A S6', 'nce15ee029', 0), ('NCE15EE030', 'Kripa Krishna A', 'EEE-A S6', 'nce15ee030', 0), ('NCE15EE031', 'Krishnadas K', 'EEE-A S6', 'nce15ee031', 0), ('NCE15EE032', 'P Krishnakumar', 'EEE-A S6', 'nce15ee032', 0), ('NCE15EE033', 'Lesly Catherine', 'EEE-A S6', 'nce15ee033', 0), ('NCE15EE034', 'Midun S', 'EEE-A S6', 'nce15ee034', 0), ('NCE15EE035', 'Mohammed Ibrahim N', 'EEE-A S6', 'nce15ee035', 0), ('NCE15EE036', 'Nelson P O', 'EEE-A S6', 'nce15ee036', 0), ('NCE15EE037', 'Nirmal Prasad', 'EEE-A S6', 'nce15ee037', 0), ('NCE15EE038', 'Parameswaran T K ', 'EEE-A S6', 'nce15ee038', 0), ('NCE15EE039', 'Pavan Krishnan K A', 'EEE-A S6', 'nce15ee039', 0), ('NCE15EE040', 'Prajitha K Nair', 'EEE-A S6', 'nce15ee040', 0), ('NCE15EE041', 'Pranavkumar S', 'EEE-A S6', 'nce15ee041', 0), ('NCE15EE042', 'Premjith V K', 'EEE-A S6', 'nce15ee042', 0), ('NCE15EE043', 'Rajalakshmy S', 'EEE-A S6', 'nce15ee043', 0), ('NCE15EE044', 'Reshma Raj K', 'EEE-A S6', 'nce15ee044', 0), ('NCE15EE045', 'Sai Krishnan', 'EEE-A S6', 'nce15ee045', 0), ('NCE15EE046', 'Sandeep T C', 'EEE-A S6', 'nce15ee046', 0), ('NCE15EE047', 'Sangeetha V', 'EEE-A S6', 'nce15ee047', 0), ('NCE15EE048', 'Sanjay.S', 'EEE-A S6', 'nce15ee048', 0), ('NCE15EE049', 'Shanila P', 'EEE-A S6', 'nce15ee049', 0), ('NCE15EE050', 'Shareefa P A', 'EEE-A S6', 'nce15ee050', 0), ('NCE15EE051', 'Shilpa Manikandan', 'EEE-A S6', 'nce15ee051', 0), ('NCE15EE052', 'Sruthi Ram Kumar', 'EEE-A S6', 'nce15ee052', 0), ('NCE15EE053', 'Sujith V', 'EEE-A S6', 'nce15ee053', 0), ('NCE15EE054', 'Susmitha P', 'EEE-A S6', 'nce15ee054', 0), ('NCE15EE055', 'Vishnu V', 'EEE-A S6', 'nce15ee055', 0), ('NCE15EE056', 'Vishnu Menon P', 'EEE-A S6', 'nce15ee056', 0), ('LNCE15EE057', 'Aravind S Sankar', 'EEE-A S6', 'lnce15ee057', 0), ('LNCE15EE058', 'Faisal P M', 'EEE-A S6', 'lnce15ee058', 0), ('LNCE15EE059', 'Jeevan', 'EEE-A S6', 'lnce15ee059', 0), ('LNCE15EE060', 'Jomon George', 'EEE-A S6', 'lnce15ee060', 0), ('LNCE15EE061', 'Nived M Jayan', 'EEE-A S6', 'lnce15ee061', 0), ('LNCE15EE062', 'Rony C Joshy', 'EEE-A S6', 'lnce15ee062', 0), ('LNCE15EE063', 'Sreejith V S', 'EEE-A S6', 'lnce15ee063', 0), /* EEE-A S4 (TOTAL: 43) */ ('NCE16EE001', 'Aardhra T V', 'EEE-A S4', 'nce16ee001', 0), ('NCE16EE002', 'Abhijith S', 'EEE-A S4', 'nce16ee002', 0), ('NCE16EE003', 'Abhishek P M', 'EEE-A S4', 'nce16ee003', 0), ('NCE16EE004', 'Adithian S', 'EEE-A S4', 'nce16ee004', 0), ('NCE16EE005', 'Adithyan K G', 'EEE-A S4', 'nce16ee005', 0), ('NCE16EE006', 'Aghil K B', 'EEE-A S4', 'nce16ee006', 0), ('NCE16EE007', 'Aiswarya Nair A', 'EEE-A S4', 'nce16ee007', 0), ('NCE16EE008', 'Ajay Ram P Nair', 'EEE-A S4', 'nce16ee008', 0), ('NCE16EE009', 'Ajmal M', 'EEE-A S4', 'nce16ee009', 0), ('NCE16EE010', 'Akhil T R', 'EEE-A S4', 'nce16ee010', 0), ('NCE16EE011', 'Akshay G', 'EEE-A S4', 'nce16ee011', 0), ('NCE16EE014', 'Anne Mary Thomas', 'EEE-A S4', 'nce16ee014', 0), ('NCE16EE015', 'Arun K Narayanan', 'EEE-A S4', 'nce16ee015', 0), ('NCE16EE016', 'Arun K S', 'EEE-A S4', 'nce16ee016', 0), ('NCE16EE018', 'Athul B', 'EEE-A S4', 'nce16ee018', 0), ('NCE16EE019', 'Bavin B', 'EEE-A S4', 'nce16ee019', 0), ('NCE16EE020', 'Bhavana V', 'EEE-A S4', 'nce16ee020', 0), ('NCE16EE021', 'Dona Clinfard P', 'EEE-A S4', 'nce16ee021', 0), ('NCE16EE022', 'Gopika Krishnan K', 'EEE-A S4', 'nce16ee022', 0), ('NCE16EE023', 'Gopika S', 'EEE-A S4', 'nce16ee023', 0), ('NCE16EE025', 'Karthika K', 'EEE-A S4', 'nce16ee025', 0), ('NCE16EE026', 'Kiran K Narayanan', 'EEE-A S4', 'nce16ee026', 0), ('NCE16EE027', 'Meera.M', 'EEE-A S4', 'nce16ee027', 0), ('NCE16EE028', 'Megha G', 'EEE-A S4', 'nce16ee028', 0), ('NCE16EE029', 'Mohammed Nizamudheen', 'EEE-A S4', 'nce16ee029', 0), ('NCE16EE030', 'Muahammed Faisal K T', 'EEE-A S4', 'nce16ee030', 0), ('NCE16EE031', 'Naveen Ravindran', 'EEE-A S4', 'nce16ee031', 0), ('NCE16EE032', 'Nithin Babu', 'EEE-A S4', 'nce16ee032', 0), ('NCE16EE033', 'Pradeep J', 'EEE-A S4', 'nce16ee033', 0), ('NCE16EE034', 'P Sruthi', 'EEE-A S4', 'nce16ee034', 0), ('NCE16EE035', 'Ramadas K', 'EEE-A S4', 'nce16ee035', 0), ('NCE16EE036', 'R Harikrishnan', 'EEE-A S4', 'nce16ee036', 0), ('NCE16EE037', 'Rohith V', 'EEE-A S4', 'nce16ee037', 0), ('NCE16EE038', 'Salini M', 'EEE-A S4', 'nce16ee038', 0), ('NCE16EE039', 'Sanjana S', 'EEE-A S4', 'nce16ee039', 0), ('NCE16EE040', 'Sidharth S Menon', 'EEE-A S4', 'nce16ee040', 0), ('NCE16EE041', 'Sooraj M S', 'EEE-A S4', 'nce16ee041', 0), ('NCE16EE042', 'Susmitha T M', 'EEE-A S4', 'nce16ee042', 0), ('NCE16EE043', 'Ujjwal K Menon', 'EEE-A S4', 'nce16ee043', 0), ('NCE16EE044', 'Vikas V', 'EEE-A S4', 'nce16ee044', 0), ('NCE16EE045', 'Vipin V', 'EEE-A S4', 'nce16ee045', 0), /* ('', 'Anil K R', 'EEE-A S4', '', 0), */ /* ('', 'Cyril Joseph', 'EEE-A S4', '', 0), */ /* MTR-A S4 (TOTAL: 47) */ ('NCE16MC001', 'Abdul Hameed V M', 'MTR-A S4', 'nce16mc001', 0), ('NCE16MC002', 'Adith Sunder C', 'MTR-A S4', 'nce16mc002', 0), ('NCE16MC003', 'Akash Krishnan A', 'MTR-A S4', 'nce16mc003', 0), ('NCE16MC004', 'Akhil Reghunath', 'MTR-A S4', 'nce16mc004', 0), ('NCE16MC005', 'Amal Das T S', 'MTR-A S4', 'nce16mc005', 0), ('NCE16MC006', 'Amal J Antony', 'MTR-A S4', 'nce16mc006', 0), ('NCE16MC007', 'Amaljith K', 'MTR-A S4', 'nce16mc007', 0), ('NCE16MC008', 'Amal M A', 'MTR-A S4', 'nce16mc008', 0), ('NCE16MC009', 'Anil C A', 'MTR-A S4', 'nce16mc009', 0), ('NCE16MC010', 'Anselm Linson', 'MTR-A S4', 'nce16mc010', 0), ('NCE16MC011', 'Antony Komban Winson', 'MTR-A S4', 'nce16mc011', 0), ('NCE16MC013', 'Athul Krishna M J', 'MTR-A S4', 'nce16mc013', 0), ('NCE16MC014', 'Basil Joy', 'MTR-A S4', 'nce16mc014', 0), ('NCE16MC015', 'Ceril Sabu Joseph', 'MTR-A S4', 'nce16mc015', 0), ('NCE16MC016', 'C R Athul Sreeraj', 'MTR-A S4', 'nce16mc016', 0), ('NCE16MC018', 'Govardhan P B', 'MTR-A S4', 'nce16mc018', 0), ('NCE16MC019', 'Issac K Joy', 'MTR-A S4', 'nce16mc019', 0), ('NCE16MC020', 'Jijay Krishna M', 'MTR-A S4', 'nce16mc020', 0), ('NCE16MC021', 'Jithin Cheriyan', 'MTR-A S4', 'nce16mc021', 0), ('NCE16MC022', 'Jithin T ', 'MTR-A S4', 'nce16mc022', 0), ('NCE16MC023', 'Jithin T J', 'MTR-A S4', 'nce16mc023', 0), ('NCE16MC025', 'Kirandev K S', 'MTR-A S4', 'nce16mc025', 0), ('NCE16MC026', 'Merril Daniel Roy', 'MTR-A S4', 'nce16mc026', 0), ('NCE16MC027', 'Muhammed Basil S', 'MTR-A S4', 'nce16mc027', 0), ('NCE16MC028', 'Muhammed Shafi K', 'MTR-A S4', 'nce16mc028', 0), ('NCE16MC029', 'Nikhil', 'MTR-A S4', 'nce16mc029', 0), ('NCE16MC030', 'Nourin', 'MTR-A S4', 'nce16mc030', 0), ('NCE16MC031', 'Prathibha P K', 'MTR-A S4', 'nce16mc031', 0), ('NCE16MC032', 'Rahul Ramesh', 'MTR-A S4', 'nce16mc032', 0), ('NCE16MC033', 'Ramees N', 'MTR-A S4', 'nce16mc033', 0), ('NCE16MC034', 'Robin Joseph', 'MTR-A S4', 'nce16mc034', 0), ('NCE16MC036', 'Roshan Sathar A', 'MTR-A S4', 'nce16mc036', 0), ('NCE16MC037', 'R Vishnu Prasath ', 'MTR-A S4', 'nce16mc037', 0), ('NCE16MC038', 'Sanjay S', 'MTR-A S4', 'nce16mc038', 0), ('NCE16MC039', 'Shahid S', 'MTR-A S4', 'nce16mc039', 0), ('NCE16MC040', 'Sharooque Shajahan', 'MTR-A S4', 'nce16mc040', 0), ('NCE16MC041', 'Sidharth S', 'MTR-A S4', 'nce16mc041', 0), ('NCE16MC042', 'Simon Thomas', 'MTR-A S4', 'nce16mc042', 0), ('NCE16MC043', 'Smruthi Ranjith', 'MTR-A S4', 'nce16mc043', 0), ('NCE16MC044', 'Sreehari K Nair', 'MTR-A S4', 'nce16mc044', 0), ('NCE16MC045', 'Sumith P S', 'MTR-A S4', 'nce16mc045', 0), ('NCE16MC046', 'Vikas.V', 'MTR-A S4', 'nce16mc046', 0), ('NCE16MC047', 'Vishnu P', 'MTR-A S4', 'nce16mc047', 0), ('NCE16MC048', 'Vishnuprakash V U', 'MTR-A S4', 'nce16mc048', 0), ('NCE16MC049', 'Vyshnav C V', 'MTR-A S4', 'nce16mc049', 0), ('NCE15MC047', 'Rinshil', 'MTR-A S4', 'nce15mc047', 0), ('LNCE16MC050', 'Midhun Headly Lawrance', 'MTR-A S4', 'lnce16mc050', 0), /* MTR-A S6 (TOTAL: 67) */ ('NCE15MC001', 'Abhijith Dinesh', 'MTR-A S6', 'nce15mc001', 0), ('NCE15MC002', 'Abijith U K', 'MTR-A S6', 'nce15mc002', 0), ('NCE15MC003', 'Adithya Suresh', 'MTR-A S6', 'nce15mc003', 0), ('NCE15MC004', 'Adithya Mohan', 'MTR-A S6', 'nce15mc004', 0), ('NCE15MC005', 'Ajay Anand C', 'MTR-A S6', 'nce15mc005', 0), ('NCE15MC006', 'Akash A', 'MTR-A S6', 'nce15mc006', 0), ('NCE15MC007', 'Akhil Chand P P', 'MTR-A S6', 'nce15mc007', 0), ('NCE15MC008', 'Akshaylal M R', 'MTR-A S6', 'nce15mc008', 0), ('NCE15MC009', 'Albin Leo', 'MTR-A S6', 'nce15mc009', 0), ('NCE15MC010', 'Alind Roy', 'MTR-A S6', 'nce15mc010', 0), ('NCE15MC011', 'Amarjith Vinod', 'MTR-A S6', 'nce15mc011', 0), ('NCE15MC012', 'Antony Sebastian Kachapally', 'MTR-A S6', 'nce15mc012', 0), ('NCE15MC013', 'Anupama R Nath', 'MTR-A S6', 'nce15mc013', 0), ('NCE15MC014', 'Arjun S', 'MTR-A S6', 'nce15mc014', 0), ('NCE15MC015', 'Athira Menon', 'MTR-A S6', 'nce15mc015', 0), ('NCE15MC016', 'Athul K A', 'MTR-A S6', 'nce15mc016', 0), ('NCE15MC017', 'Athul Vaishnav C', 'MTR-A S6', 'nce15mc017', 0), ('NCE15MC019', 'Daril Silva', 'MTR-A S6', 'nce15mc019', 0), ('NCE15MC020', 'Deepak R', 'MTR-A S6', 'nce15mc020', 0), ('NCE15MC021', 'Deepak Sunil', 'MTR-A S6', 'nce15mc021', 0), ('NCE15MC022', 'Deepu Vinil', 'MTR-A S6', 'nce15mc022', 0), ('NCE15MC023', 'Govind K A', 'MTR-A S6', 'nce15mc023', 0), ('NCE15MC024', 'Hariharan C G', 'MTR-A S6', 'nce15mc024', 0), ('NCE15MC025', 'Jefina Teresa Johnson', 'MTR-A S6', 'nce15mc025', 0), ('NCE15MC026', 'Jerom Mathew Paul', 'MTR-A S6', 'nce15mc026', 0), ('NCE15MC027', 'Jithin T.J', 'MTR-A S6', 'nce15mc027', 0), ('NCE15MC028', 'Johnson K Jose', 'MTR-A S6', 'nce15mc028', 0), ('NCE15MC029', 'Joseph Jithin Paul', 'MTR-A S6', 'nce15mc029', 0), ('NCE15MC030', 'Jovin Davis T', 'MTR-A S6', 'nce15mc030', 0), ('NCE15MC031', 'Juby Elizebeth John', 'MTR-A S6', 'nce15mc031', 0), ('NCE15MC032', 'Justin Jose', 'MTR-A S6', 'nce15mc032', 0), ('NCE15MC033', 'Kenes Chris', 'MTR-A S6', 'nce15mc033', 0), ('NCE15MC034', 'Kiran George', 'MTR-A S6', 'nce15mc034', 0), ('NCE15MC035', 'Marshel Martin', 'MTR-A S6', 'nce15mc035', 0), ('NCE15MC036', 'Mohammed Hani Sherif', 'MTR-A S6', 'nce15mc036', 0), ('NCE15MC037', 'Mohamed Junaid M C', 'MTR-A S6', 'nce15mc037', 0), ('NCE15MC038', 'Mohamed Sharook Khan', 'MTR-A S6', 'nce15mc038', 0), ('NCE15MC040', 'Mohammed Suhail T S', 'MTR-A S6', 'nce15mc040', 0), ('NCE15MC041', 'Muhammed Nameer P', 'MTR-A S6', 'nce15mc041', 0), ('NCE15MC042', 'Nakul Bhaskar', 'MTR-A S6', 'nce15mc042', 0), ('NCE15MC043', 'Nirmal C Ravindran', 'MTR-A S6', 'nce15mc043', 0), ('NCE15MC044', 'Rahul A M', 'MTR-A S6', 'nce15mc044', 0), ('NCE15MC045', 'Rajeev P T', 'MTR-A S6', 'nce15mc045', 0), ('NCE15MC046', 'Reshma S', 'MTR-A S6', 'nce15mc046', 0), ('NCE15MC048', 'Rohit Jacob Robert', 'MTR-A S6', 'nce15mc048', 0), ('NCE15MC049', 'Sachin A S', 'MTR-A S6', 'nce15mc049', 0), ('NCE15MC050', 'Sagar Johny C', 'MTR-A S6', 'nce15mc050', 0), ('NCE15MC051', 'Saras Mohan', 'MTR-A S6', 'nce15mc051', 0), ('NCE15MC052', 'Sarun R Kumar', 'MTR-A S6', 'nce15mc052', 0), ('NCE15MC053', 'Spencer David', 'MTR-A S6', 'nce15mc053', 0), ('NCE15MC054', 'Sreejith S', 'MTR-A S6', 'nce15mc054', 0), ('NCE15MC055', 'Sreerag K R', 'MTR-A S6', 'nce15mc055', 0), ('NCE15MC056', 'Sudharshan K', 'MTR-A S6', 'nce15mc056', 0), ('NCE15MC057', 'Sudheesh S', 'MTR-A S6', 'nce15mc057', 0), ('NCE15MC058', 'Vishnu P V', 'MTR-A S6', 'nce15mc058', 0), ('NCE15MC059', 'Vishnu Chandran N', 'MTR-A S6', 'nce15mc059', 0), ('NCE15MC060', 'Vishnu Raj P', 'MTR-A S6', 'nce15mc060', 0), ('NCE15MC061', 'Yadukrishnan K', 'MTR-A S6', 'nce15mc061', 0), ('LNCE15MC062', 'Abinav T V', 'MTR-A S6', 'lnce15mc062', 0), ('LNCE15MC063', 'Akshay Sivan', 'MTR-A S6', 'lnce15mc063', 0), ('LNCE15MC064', 'Alan V Reji', 'MTR-A S6', 'lnce15mc064', 0), ('LNCE15MC065', 'Ashique Anand', 'MTR-A S6', 'lnce15mc065', 0), ('LNCE15MC066', 'Avinash Ramanujan', 'MTR-A S6', 'lnce15mc066', 0), ('LNCE15MC067', 'Dheeraj S', 'MTR-A S6', 'lnce15mc067', 0), ('LNCE15MC068', 'Jayakrishnan A R', 'MTR-A S6', 'lnce15mc068', 0), ('LNCE15MC069', 'Jobin Joseph', 'MTR-A S6', 'lnce15mc069', 0), ('LNCE15MC070', 'Sreevinayak P V', 'MTR-A S6', 'lnce15mc070', 0), /* MCE-A S4 (TOTAL: ) */ ('NCE16ME061', 'Jobin Raju', 'MCE-A S4', 'nce16me061', 0), ('NCE16ME062', 'Joseph S', 'MCE-A S4', 'nce16me062', 0), ('NCE16ME063', 'Lahashad C A', 'MCE-A S4', 'nce16me063', 0), ('NCE16ME064', 'L Vignesh Aravind', 'MCE-A S4', 'nce16me064', 0), ('NCE16ME065', 'Midhun Raj K', 'MCE-A S4', 'nce16me065', 0), ('NCE16ME066', 'Midun C', 'MCE-A S4', 'nce16me066', 0), ('NCE16ME068', 'Mohammed Rashad A T', 'MCE-A S4', 'nce16me068', 0), ('NCE16ME069', 'Muhammed Anees', 'MCE-A S4', 'nce16me069', 0), ('NCE16ME070', 'Muhammed Haseebussaman N K', 'MCE-A S4', 'nce16me070', 0), ('NCE16ME071', 'Muhammed Mubariz A P', 'MCE-A S4', 'nce16me071', 0), ('NCE16ME072', 'Navaneeth Krishnan P T', 'MCE-A S4', 'nce16me072', 0), ('NCE16ME073', 'Niveth Krishnan', 'MCE-A S4', 'nce16me073', 0), ('NCE16ME075', 'Paul Jims', 'MCE-A S4', 'nce16me075', 0), ('NCE16ME076', 'Prajith P', 'MCE-A S4', 'nce16me076', 0), ('NCE16ME077', 'Pratheev Kumar K', 'MCE-A S4', 'nce16me077', 0), ('NCE16ME078', 'R Adharsh', 'MCE-A S4', 'nce16me078', 0), ('NCE16ME079', 'Rafeek T S', 'MCE-A S4', 'nce16me079', 0), ('NCE16ME080', 'Rahul M R', 'MCE-A S4', 'nce16me080', 0), ('NCE16ME081', 'Rahul R', 'MCE-A S4', 'nce16me081', 0), ('NCE16ME083', 'Ranjith O', 'MCE-A S4', 'nce16me083', 0), ('NCE16ME084', 'Robin Roy', 'MCE-A S4', 'nce16me084', 0), ('NCE16ME085', 'Rohin R', 'MCE-A S4', 'nce16me085', 0), ('NCE16ME086', 'Rohit Babu M K', 'MCE-A S4', 'nce16me086', 0), ('NCE16ME088', 'Rohith P', 'MCE-A S4', 'nce16me088', 0), ('NCE16ME089', 'Rubeek B', 'MCE-A S4', 'nce16me089', 0), ('NCE16ME090', 'Sabith Muhsin', 'MCE-A S4', 'nce16me090', 0), ('NCE16ME091', 'Sarath K', 'MCE-A S4', 'nce16me091', 0), ('NCE16ME092', 'Sarath V P', 'MCE-A S4', 'nce16me092', 0), ('NCE16ME094', 'Sayuj M J', 'MCE-A S4', 'nce16me094', 0), ('NCE16ME095', 'Shabeer Ali', 'MCE-A S4', 'nce16me095', 0), ('NCE16ME096', 'Shalif P S', 'MCE-A S4', 'nce16me096', 0), ('NCE16ME097', 'Sharan S Menon', 'MCE-A S4', 'nce16me097', 0), ('NCE16ME098', 'Shijo Joshy', 'MCE-A S4', 'nce16me098', 0), ('NCE16ME099', 'Shiju V', 'MCE-A S4', 'nce16me099', 0), ('NCE16ME100', 'Shiyas M', 'MCE-A S4', 'nce16me100', 0), ('NCE16ME101', 'Shyam M A', 'MCE-A S4', 'nce16me101', 0), ('NCE16ME102', 'Sooraj Sivadasan', 'MCE-A S4', 'nce16me102', 0), ('NCE16ME103', 'Sravan T', 'MCE-A S4', 'nce16me103', 0), ('NCE16ME104', 'Sreehari Madhu', 'MCE-A S4', 'nce16me104', 0), ('NCE16ME105', 'Sreehari Unnikrishnan', 'MCE-A S4', 'nce16me105', 0), ('NCE16ME106', 'Sreenath K J', 'MCE-A S4', 'nce16me106', 0), ('NCE16ME107', 'Suraj S', 'MCE-A S4', 'nce16me107', 0), ('NCE16ME108', 'Thejus Jayaseelan', 'MCE-A S4', 'nce16me108', 0), ('NCE16ME109', 'Tibin T R', 'MCE-A S4', 'nce16me109', 0), ('NCE16ME110', 'Vaisakh Pradeep', 'MCE-A S4', 'nce16me110', 0), ('NCE16ME111', 'Vignesh M', 'MCE-A S4', 'nce16me111', 0), ('NCE16ME113', 'Vineeth N V', 'MCE-A S4', 'nce16me113', 0), ('NCE16ME114', 'Vipin K', 'MCE-A S4', 'nce16me114', 0), ('NCE16ME115', 'Vishnu K Anilkumar', 'MCE-A S4', 'nce16me115', 0), ('NCE16ME116', 'Vishnu K P', 'MCE-A S4', 'nce16me116', 0), ('NCE16ME117', 'Vishnu Suresh P U', 'MCE-A S4', 'nce16me117', 0), ('NCE16ME118', 'Vivek Nair P A', 'MCE-A S4', 'nce16me118', 0), ('NCE16ME119', 'V Mubarak', 'MCE-A S4', 'nce16me119', 0), ('NCE15ME072', 'Nithin Krishnan K', 'MCE-A S4', 'nce15me072', 0), ('NCE15ME107', 'Sivaprasad O B', 'MCE-A S4', 'nce15me107', 0), /* MCE-A S6 (TOTAL: ) */ ('NCE15ME065', 'Melvin Johnson', 'MCE-A S6', 'nce15me065', 0), ('NCE15ME066', 'Mithun Gopinath', 'MCE-A S6', 'nce15me066', 0), ('NCE15ME067', 'Mohamed Jasil C', 'MCE-A S6', 'nce15me067', 0), ('NCE15ME068', 'Mohammed Safarulla H', 'MCE-A S6', 'nce15me068', 0), ('NCE15ME069', 'Muhammed Kunhi M P', 'MCE-A S6', 'nce15me069', 0), ('NCE15ME070', 'Najmal K Jamal', 'MCE-A S6', 'nce15me070', 0), ('NCE15ME071', 'Nandagopan K S', 'MCE-A S6', 'nce15me071', 0), ('NCE15ME073', 'Nijil C R', 'MCE-A S6', 'nce15me073', 0), ('NCE15ME074', 'Nithin A M', 'MCE-A S6', 'nce15me074', 0), ('NCE15ME075', 'Nithin K P', 'MCE-A S6', 'nce15me075', 0), ('NCE15ME076', 'Nithin R K', 'MCE-A S6', 'nce15me076', 0), ('NCE15ME078', 'Noel T John', 'MCE-A S6', 'nce15me078', 0), ('NCE15ME079', 'Noushad C N', 'MCE-A S6', 'nce15me079', 0), ('NCE15ME081', 'Prajith T', 'MCE-A S6', 'nce15me081', 0), ('NCE15ME082', 'Rahul K.R', 'MCE-A S6', 'nce15me082', 0), ('NCE15ME083', 'Rahul K R', 'MCE-A S6', 'nce15me083', 0), ('NCE15ME084', 'Ramshid S M', 'MCE-A S6', 'nce15me084', 0), ('NCE15ME085', 'Renjith N P', 'MCE-A S6', 'nce15me085', 0), ('NCE15ME086', 'Ridhinjith M P', 'MCE-A S6', 'nce15me086', 0), ('NCE15ME087', 'Robin Rappai', 'MCE-A S6', 'nce15me087', 0), ('NCE15ME088', 'Rohit I J', 'MCE-A S6', 'nce15me088', 0), ('NCE15ME089', 'Rohith Krishnan R', 'MCE-A S6', 'nce15me089', 0), ('NCE15ME090', 'Rojan V Thanjan', 'MCE-A S6', 'nce15me090', 0), ('NCE15ME091', 'Roshan Ahamed N A', 'MCE-A S6', 'nce15me091', 0), ('NCE15ME092', 'Sabiq Zayan S', 'MCE-A S6', 'nce15me092', 0), ('NCE15ME093', 'Sachin Das', 'MCE-A S6', 'nce15me093', 0), ('NCE15ME094', 'Sahal T', 'MCE-A S6', 'nce15me094', 0), ('NCE15ME095', 'Sai Krishna K B', 'MCE-A S6', 'nce15me095', 0), ('NCE15ME096', 'Sajith Sreenivasan', 'MCE-A S6', 'nce15me096', 0), ('NCE15ME097', 'Sanal V Cyriac', 'MCE-A S6', 'nce15me097', 0), ('NCE15ME098', 'Sandeep D', 'MCE-A S6', 'nce15me098', 0), ('NCE15ME101', 'Saurav P S', 'MCE-A S6', 'nce15me101', 0), ('NCE15ME103', 'Shibin S', 'MCE-A S6', 'nce15me103', 0), ('NCE15ME104', 'Shibli K', 'MCE-A S6', 'nce15me104', 0), ('NCE15ME105', 'Shravan Gopal P', 'MCE-A S6', 'nce15me105', 0), ('NCE15ME108', 'Sreejith.S', 'MCE-A S6', 'nce15me108', 0), ('NCE15ME109', 'Sreejith V K', 'MCE-A S6', 'nce15me109', 0), ('NCE15ME110', 'Sreekanth K', 'MCE-A S6', 'nce15me110', 0), ('NCE15ME111', 'Sreekanth J Marar', 'MCE-A S6', 'nce15me111', 0), ('NCE15ME112', 'Sreerag A G', 'MCE-A S6', 'nce15me112', 0), ('NCE15ME113', 'Sreerag K', 'MCE-A S6', 'nce15me113', 0), ('NCE15ME114', 'Sreerag P V', 'MCE-A S6', 'nce15me114', 0), ('NCE15ME115', 'Sudheesh C', 'MCE-A S6', 'nce15me115', 0), ('NCE15ME117', 'Sufvan', 'MCE-A S6', 'nce15me117', 0), ('NCE15ME118', 'V S Surabish', 'MCE-A S6', 'nce15me118', 0), ('NCE15ME119', 'Vaishnav V ', 'MCE-A S6', 'nce15me119', 0), ('NCE15ME120', 'Vishagh V', 'MCE-A S6', 'nce15me120', 0), ('NCE15ME121', 'Vishnu K N', 'MCE-A S6', 'nce15me121', 0), ('NCE15ME122', 'Vishnu Prabhakar', 'MCE-A S6', 'nce15me122', 0), ('NCE15ME123', 'Viswajith S Nair', 'MCE-A S6', 'nce15me123', 0), ('NCE15ME124', 'Vysagh V', 'MCE-A S6', 'nce15me124', 0), ('NCE15ME125', 'Vyshkh P', 'MCE-A S6', 'nce15me125', 0), ('LNCE15ME127', 'Bharadwaj R Govind', 'MCE-A S6', 'lnce15me127', 0), ('LNCE15ME128', 'Harikrishnan V', 'MCE-A S6', 'lnce15me128', 0), ('LNCE15ME129', 'Krishna Raj', 'MCE-A S6', 'lnce15me129', 0); /* ('', 'Jithin P J', 'MCE-A S6', '', 0), */ /* ('', 'Sudheer G', 'MCE-A S6', '', 0), */ -- -------------------------------------------------------- -- -- Table structure for table `teachers` -- CREATE TABLE `teachers` ( `te_username` varchar(50) NOT NULL, `password` varchar(30) NOT NULL, `dept` varchar(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `teachers` -- INSERT INTO `teachers` (`te_username`, `password`, `dept`) VALUES ('ARUN K', 'arun', 'CSE'), ('BIJI K P', 'biji', 'CSE'), ('DEEPTHI', 'deepthi', 'CSE'), ('AKHILA', 'akhila', 'CSE'), ('RESHMI H', 'reshmi', 'ECE'), ('S4 CSE-A TEACHER 1', 'TEACHER1', 'CSE'), ('S4 CSE-A TEACHER 2', 'TEACHER2', 'CSE'), ('S4 CSE-A TEACHER 3', 'TEACHER3', 'CSE'), ('S4 CSE-A TEACHER 4', 'TEACHER4', 'CSE'), ('S4 CSE-A TEACHER 5', 'TEACHER5', 'CSE'), ('S4 CSE-A TEACHER 6', 'TEACHER6', 'CSE'), ('S4 CSE-B TEACHER 1', 'TEACHER1', 'CSE'), ('S4 CSE-B TEACHER 2', 'TEACHER2', 'CSE'), ('S4 CSE-B TEACHER 3', 'TEACHER3', 'CSE'), ('S4 CSE-B TEACHER 4', 'TEACHER4', 'CSE'), ('S4 CSE-B TEACHER 5', 'TEACHER5', 'CSE'), ('S4 CSE-B TEACHER 6', 'TEACHER6', 'CSE'), ('S6 CSE-B TEACHER 1', 'TEACHER1', 'CSE'), ('S6 CSE-B TEACHER 2', 'TEACHER2', 'CSE'), ('S6 CSE-B TEACHER 3', 'TEACHER3', 'CSE'), ('S6 CSE-B TEACHER 4', 'TEACHER4', 'CSE'), ('S6 CSE-B TEACHER 5', 'TEACHER5', 'CSE'), ('S6 CSE-B TEACHER 6', 'TEACHER6', 'CSE'), ('SRUTHY M R', 'sruthy', 'CSE'); -- -------------------------------------------------------- -- -- Table structure for table `teachersinfo` -- CREATE TABLE `teachersinfo` ( `info_no` int(6) NOT NULL, `te_username` varchar(50) NOT NULL, `class` varchar(8) NOT NULL, `sub_name` varchar(50) NOT NULL, `sub_code` varchar(7) NOT NULL, `class_dept` varchar(5) NOT NULL, `overall` int(3) DEFAULT NULL, `class_strength` int(3) NOT NULL, `feed_applied` int(3) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `teachersinfo` -- INSERT INTO `teachersinfo` (`info_no`, `te_username`, `class`, `sub_name`, `sub_code`, `class_dept`, `overall`, `class_strength`, `feed_applied`) VALUES (1, 'ARUN K', 'CSE-A S6', 'Computer Networking', 'CS306', 'CSE', NULL, 39, 0), (2, 'RESHMI H', 'CSE-A S6', 'Principles of Management', 'HS300', 'CSE', NULL, 39, 0), (2, 'AKHILA', 'CSE-A S6', 'Mobile Computing', 'CS364', 'CSE', NULL, 39, 0), (3, 'SRUTHY M R', 'CSE-A S6', 'Design and Analysis of Algorithms', 'CS302', 'CSE', NULL, 39, 0), (4, 'DEEPTHI', 'CSE-A S6', 'Compiler Design', 'CS304', 'CSE', NULL, 39, 0), (5, 'BIJI K P', 'CSE-A S6', 'Software Engineering', 'CS308', 'CSE', NULL, 39, 0), (6, 'ARUN K', 'CSE-A S6', 'Web Technologies', 'CS368', 'CSE', NULL, 39, 0), (7, 'AKHILA', 'CSE-B S6', 'Design and Analysis of Algorithms', 'CS302', 'CSE', NULL, 39, 0), (8, 'SHIJI', 'CSE-B S6', 'Compiler Design', 'CS304', 'CSE', NULL, 39, 0), (9, 'SILJA', 'CSE-B S6', 'Computer Networking', 'CS306', 'CSE', NULL, 39, 0), (10, 'VYSAKH', 'CSE-B S6', 'Software Engineering', 'CS308', 'CSE', NULL, 39, 0), (11, 'ARUN K', 'CSE-B S6', 'Web Technologies', 'CS368', 'CSE', NULL, 39, 0), (12, 'GIRISH', 'CSE-B S6', 'Principles of Management', 'HS300', 'CSE', NULL, 39, 0), (13, 'S4 CSE-A TEACHER 1', 'CSE-A S4', 'SUBJECT 1', 'CS101', 'CSE', NULL, 58, 0), (14, 'S4 CSE-A TEACHER 2', 'CSE-A S4', 'SUBJECT 2', 'CS102', 'CSE', NULL, 58, 0), (15, 'S4 CSE-A TEACHER 3', 'CSE-A S4', 'SUBJECT 3', 'CS103', 'CSE', NULL, 58, 0), (16, 'S4 CSE-A TEACHER 4', 'CSE-A S4', 'SUBJECT 4', 'CS104', 'CSE', NULL, 58, 0), (17, 'S4 CSE-A TEACHER 5', 'CSE-A S4', 'SUBJECT 5', 'CS105', 'CSE', NULL, 58, 0), (18, 'S4 CSE-A TEACHER 6', 'CSE-A S4', 'SUBJECT 6', 'CS106', 'CSE', NULL, 58, 0), (19, 'S4 CSE-B TEACHER 1', 'CSE-B S4', 'SUBJECT 1', 'CS101', 'CSE', NULL, 57, 0), (20, 'S4 CSE-B TEACHER 2', 'CSE-B S4', 'SUBJECT 2', 'CS102', 'CSE', NULL, 57, 0), (21, 'S4 CSE-B TEACHER 3', 'CSE-B S4', 'SUBJECT 3', 'CS103', 'CSE', NULL, 57, 0), (22, 'S4 CSE-B TEACHER 4', 'CSE-B S4', 'SUBJECT 4', 'CS104', 'CSE', NULL, 57, 0), (23, 'S4 CSE-B TEACHER 5', 'CSE-B S4', 'SUBJECT 5', 'CS105', 'CSE', NULL, 57, 0), (24, 'S4 CSE-B TEACHER 6', 'CSE-B S4', 'SUBJECT 6', 'CS106', 'CSE', NULL, 57, 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `feeds` -- ALTER TABLE `feeds` ADD PRIMARY KEY (`feed_no`), ADD KEY `st_username` (`st_username`), ADD KEY `te_username` (`te_username`); -- -- Indexes for table `hods` -- ALTER TABLE `hods` ADD PRIMARY KEY (`hod_username`), ADD KEY `hod_username` (`hod_username`); -- -- Indexes for table `maintainers` -- ALTER TABLE `maintainers` ADD UNIQUE KEY `ma_username` (`ma_username`); -- -- Indexes for table `questions` -- ALTER TABLE `questions` ADD UNIQUE KEY `quest_id` (`quest_id`); -- -- Indexes for table `ratings` -- ALTER TABLE `ratings` ADD PRIMARY KEY (`r_no`); -- -- Indexes for table `students` -- ALTER TABLE `students` ADD PRIMARY KEY (`st_username`), ADD KEY `st_username` (`st_username`), ADD KEY `rollno` (`rollno`); -- -- Indexes for table `teachers` -- ALTER TABLE `teachers` ADD PRIMARY KEY (`te_username`), ADD KEY `te_username` (`te_username`); -- -- Indexes for table `teachersinfo` -- ALTER TABLE `teachersinfo` ADD UNIQUE KEY `info_no` (`info_no`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `feeds` -- ALTER TABLE `feeds` MODIFY `feed_no` int(6) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `teachersinfo` -- ALTER TABLE `teachersinfo` MODIFY `info_no` int(6) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; 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
bc5559a163c1ec27199673393faf964fee3b1330
SQL
NatanMelo95/Serratec
/Banco de dados/produtos.sql
UTF-8
827
2.875
3
[]
no_license
Criando coluna desconto ALTER TABLE produto ADD COLUMN desconto double precision; Criando coluna valor_desconto ALTER TABLE produto ADD COLUMN valor_desconto double precision; Criando coluna valor_com_desconto ALTER TABLE produto ADD COLUMN valor_com_desconto double precision; Atribuindo percentual do desconto a coluna desconto update produto set desconto = 0.05 where categoria like '%Eletro%' update produto set desconto = 0.15 where categoria like '%Entretenimento%' update produto set desconto = 0.1 where categoria like '%Casa%' Atribuindo valor do desconto a coluna valor_desconto update produto set valor_com_desconto = valor * desconto Atribuindo valor já descontado a coluna valor_com_desconto update produto set valor_com_desconto = valor - valor_desconto Verificando atribuições feitas select*from produto
true
517e329f1f9d4d281c530d8ccd6a9874816b0b6e
SQL
MohamedSoliman2022/BI-First-Enquiry-scripts-Scedual-Doctors-clinics
/ACtual vs apology vs planed clinics- OPD live.sql
WINDOWS-1256
1,936
3.71875
4
[]
no_license
SELECT * FROM [opd].BK_PatternInstance i left join [opd].PHS_OPDPattern o on o.id = i.PatternID and o.PhysicianID=168 where i.StartDateTime between '2020-10-11 01:00:00.000'and '2020-10-11 23:00:00.000' and o.PhysicianID=168 and i.IsActive=1 order by i.StartDateTime desc ---------------------- select bb.PhysicianID,bb.PhysicianArName,pin.StartDateTime,pin.EndDateTime,pin.PatternID , aa.OPDPatternID ,* from OPD.PHS_PatternException aa left outer join opd.BK_PatternInstance pin on pin.PatternID = aa.OPDPatternID left outer join opd.PHS_OPDPattern bb on pin.PatternID = bb.ID where pin.StartDateTime between '2020-10-11 01:00:00.000'and '2020-10-11 23:00:00.000' and aa.DateFrom='2020-10-11 00:00:00.000' and bb.PhysicianID=168 order by pin.StartDateTime desc ------------------------------------------------- SELECT physicianid,* ,2 as Datasource FROM [opd].PHS_OPDPattern WITH(NOLOCK) WHERE = N'Heba Mahmoud Dunya' and (CAST(CreatedDate AS DATE) >= dateadd(DD, -1, cast(getdate() as date)) OR CAST(UpdatedDate AS DATE) >= dateadd(DD, -1, cast(getdate() as date))) ------------------------------------------------ SELECT * ,2 as Datasource FROM [opd].PHS_PatternException WITH(NOLOCK) WHERE --( CAST(CreatedDate AS DATE) >= dateadd(DD, -1, cast(getdate() as date)) OR CAST(UpdatedDate AS DATE) >= dateadd(DD, -1, cast(getdate() as date))) --and DateFrom='2020-10-11 00:00:00.000' --and OPDPatternID=18134287 ----------------------------------- SELECT * ,2 as Datasource FROM [opd].BK_PatternInstance i left join [opd].PHS_OPDPattern o on o.id = i.PatternID WHERE CAST(i.StartDateTime AS DATE) >=dateadd(DD, -1, cast(getdate() as date)) and cast ( i.StartDateTime as date ) = cast ('2020-10-11 12:00:00.000' as date ) and o.physicianid= 168 select * from [opd].PHS_OPDPattern where PhysicianArName like N'%%' --where id in (118134286) and IsDeleted = 0
true
9f6e8faeb810189333c2d997024a1edec0b9697f
SQL
gilmagno/consulta
/db/consulta.sql
UTF-8
50,975
3.484375
3
[]
no_license
create table states ( id serial primary key, name varchar, abbreviation varchar ); create table cities ( id serial primary key, state_id int references states, name varchar ); ---------------------------------------------------------------------- create table clients ( id serial primary key, name varchar, created timestamp with time zone, updated timestamp with time zone ); create table clients_users ( client_id int, user_id int, primary key (client_id, user_id) ); ---------------------------------------------------------------------- create table users ( id serial primary key, username varchar unique, password varchar, name varchar, rg varchar, cpf varchar, address_state_id int references states, address_city_id int references cities, address_street_etc varchar, -- Rua, número, complemento address_district varchar, -- ¡Barrio! address_zip_code varchar, -- CEP phone varchar, phone2 varchar, -- Comentários nos telefones. Exemplo: "TIM", "Oi" -- phone_comment varchar, -- phone2_comment varchar, -- Qual(is) telefone(s) deve(m) receber SMS? -- phone_sms_check boolean, -- phone2_sms_check boolean, email varchar, email2 varchar, created timestamp with time zone, updated timestamp with time zone ); create table roles ( id serial primary key, name varchar ); create table actions ( id serial primary key, name varchar ); create table user_roles ( user_id int references users, role_id int references roles, primary key (user_id, role_id) ); create table role_actions ( role_id int references roles, action_id int references actions, primary key (role_id, action_id) ); ---------------------------------------------------------------------- create table appointments ( id serial primary key, register_id int references users, doctor_id int references users, patient_id int references users, date_time timestamp with time zone, text text, status varchar, -- todo ou done created timestamp with time zone, updated timestamp with time zone ); create table consultations ( id serial primary key, register_id int references users, patient_id int references users, date date, text text, created timestamp with time zone, updated timestamp with time zone ); create table consultation_files ( id serial primary key, consultation_id int references consultations, filename varchar ); -------------------------------------------------------------------------------- create table medicines ( id serial primary key, name varchar -- exemplo: "Azitromicina 500mg comp" ); create table prescriptions_medicines ( id serial primary key, doctor_id int references users, patient_id int references users, date date, use_method varchar, -- exemplo: uso tópico, uso oral etc. medicine_id int references medicines, quantity varchar, -- exemplo: 4 unity varchar, -- exemplo: comprimidos, gotas, caixas etc. text text, created timestamp with time zone, updated timestamp with time zone ); create table prescriptions_glasses ( id serial primary key, doctor_id int references users, patient_id int references users, date date, spherical_right int, spherical_left int, cilindrical_right int, cilindrical_left int, axis_right int, axis_left int, npd_right int, npd_left int, add int, text text, created timestamp with time zone, updated timestamp with time zone ); ---------------------------------------------------------------------- ---------------------------------------------------------------------- insert into states (name, abbreviation) values ('CE', 'Ceará'); insert into cities (state_id, name) values (1, 'Fortaleza'); insert into clients (name) values ('Fortal Clinic'); insert into roles (name) values ('Super Admin'); insert into roles (name) values ('Admin'); insert into roles (name) values ('Médico'); insert into roles (name) values ('Atendente'); insert into roles (name) values ('Paciente'); insert into actions (name) values ('users_view_list'); insert into actions (name) values ('users_view_details'); insert into actions (name) values ('users_create'); insert into actions (name) values ('users_edit'); insert into actions (name) values ('users_delete'); insert into actions (name) values ('consultations_view_list'); -- 6 insert into actions (name) values ('consultations_view_details'); -- 7 insert into actions (name) values ('consultations_create'); -- 8 insert into actions (name) values ('consultations_edit'); -- 9 insert into actions (name) values ('consultations_delete'); -- 10 insert into actions (name) values ('appointments_view_list'); insert into actions (name) values ('appointments_view_details'); insert into actions (name) values ('appointments_create'); insert into actions (name) values ('appointments_edit'); insert into actions (name) values ('appointments_delete'); -- Super Admin insert into role_actions (role_id, action_id) values (1, 1); insert into role_actions (role_id, action_id) values (1, 2); insert into role_actions (role_id, action_id) values (1, 3); insert into role_actions (role_id, action_id) values (1, 4); insert into role_actions (role_id, action_id) values (1, 5); insert into role_actions (role_id, action_id) values (1, 6); insert into role_actions (role_id, action_id) values (1, 7); insert into role_actions (role_id, action_id) values (1, 8); insert into role_actions (role_id, action_id) values (1, 9); insert into role_actions (role_id, action_id) values (1, 10); insert into role_actions (role_id, action_id) values (1, 11); insert into role_actions (role_id, action_id) values (1, 12); insert into role_actions (role_id, action_id) values (1, 13); insert into role_actions (role_id, action_id) values (1, 14); insert into role_actions (role_id, action_id) values (1, 15); -- Admin insert into role_actions (role_id, action_id) values (2, 1); insert into role_actions (role_id, action_id) values (2, 2); insert into role_actions (role_id, action_id) values (2, 3); insert into role_actions (role_id, action_id) values (2, 4); insert into role_actions (role_id, action_id) values (2, 5); insert into role_actions (role_id, action_id) values (2, 6); -- admin pode ver conteúdo das consultas? privacidade? -- insert into role_actions (role_id, action_id) values (2, 7); insert into role_actions (role_id, action_id) values (2, 8); insert into role_actions (role_id, action_id) values (2, 9); insert into role_actions (role_id, action_id) values (2, 10); insert into role_actions (role_id, action_id) values (2, 11); insert into role_actions (role_id, action_id) values (2, 12); insert into role_actions (role_id, action_id) values (2, 13); insert into role_actions (role_id, action_id) values (2, 14); insert into role_actions (role_id, action_id) values (2, 15); -- Médico insert into role_actions (role_id, action_id) values (3, 1); -- users insert into role_actions (role_id, action_id) values (3, 2); insert into role_actions (role_id, action_id) values (3, 3); insert into role_actions (role_id, action_id) values (3, 4); insert into role_actions (role_id, action_id) values (3, 5); insert into role_actions (role_id, action_id) values (3, 6); -- consultations insert into role_actions (role_id, action_id) values (3, 7); insert into role_actions (role_id, action_id) values (3, 8); insert into role_actions (role_id, action_id) values (3, 9); insert into role_actions (role_id, action_id) values (3, 10); insert into role_actions (role_id, action_id) values (3, 11); -- appointments insert into role_actions (role_id, action_id) values (3, 12); insert into role_actions (role_id, action_id) values (3, 13); insert into role_actions (role_id, action_id) values (3, 14); insert into role_actions (role_id, action_id) values (3, 15); -- Atendente insert into role_actions (role_id, action_id) values (4, 1); -- users insert into role_actions (role_id, action_id) values (4, 2); insert into role_actions (role_id, action_id) values (4, 3); insert into role_actions (role_id, action_id) values (4, 4); insert into role_actions (role_id, action_id) values (4, 6); -- consultations -- atendente pode ver conteúdo das consultas? privacidade? -- insert into role_actions (role_id, action_id) values (4, 7); insert into role_actions (role_id, action_id) values (4, 11); -- appointments insert into role_actions (role_id, action_id) values (4, 12); insert into role_actions (role_id, action_id) values (4, 13); insert into role_actions (role_id, action_id) values (4, 14); insert into role_actions (role_id, action_id) values (4, 15); -- Paciente insert into role_actions (role_id, action_id) values (5, 2); -- users_view_details insert into role_actions (role_id, action_id) values (5, 6); -- consultations_view_list insert into role_actions (role_id, action_id) values (5, 7); -- consultations_view_details insert into role_actions (role_id, action_id) values (5, 10); -- appointments_view_list insert into role_actions (role_id, action_id) values (5, 11); -- appointments_view_details ---------------------------------------------------------------------- insert into users (name, username, password, rg, cpf, phone, email) values ('Super Admin', 'superadmin', 'senha', '', '', '(85) 6234-6913', 'superadmin@gmail.com'); insert into user_roles (user_id, role_id) values (1, 1); insert into users (name, username, password, rg, cpf, phone, email) values ('Fortalclinic Admin', 'admin', 'senha', '', '', '(85) 4234-6913', 'admin@gmail.com'); insert into clients_users (user_id, client_id) values (2, 1); insert into user_roles (user_id, role_id) values (2, 2); insert into users (name, username, password, rg, cpf, phone, email) values ('Carlos Moura', 'carlosmoura', 'senha', '200873465123123', '245.376.873-43', '(85) 9234-6913', 'carlosmoura@gmail.com'); insert into clients_users (user_id, client_id) values (3, 1); insert into user_roles (user_id, role_id) values (3, 3); insert into users (name, username, password, rg, cpf, phone, email) values ('Paulo Sampaio', 'paulosampaio', 'senha', '20043210123123', '232.322.563-43', '(85) 8715-5490', 'paulosampaio@gmail.com'); insert into clients_users (user_id, client_id) values (4, 1); insert into user_roles (user_id, role_id) values (4, 4); insert into users (name, username, password, rg, cpf, phone, email) values ('Gil Magno Silva', 'gilmagno', 'senha', '2001010123123', '002.342.123-43', '(85) 9934-2849', 'gilmagno@gmail.com'); insert into clients_users (user_id, client_id) values (5, 1); insert into user_roles (user_id, role_id) values (5, 5); insert into users (name, username, password, rg, cpf, phone, email) values ('Pedro Moreira', 'pedro', '', '203464123123', '002.645.323-43', '(85) 5123-5243', 'pedrovillagran@gmail.com'); insert into clients_users (user_id, client_id) values (6, 1); insert into user_roles (user_id, role_id) values (6, 5); insert into users (name, username, password, rg, cpf, phone, email) values ('Flora Morais', 'flora', '', '263670910123123', '202.442.323-43', '(85) 9934-2849', 'florinda@gmail.com'); insert into clients_users (user_id, client_id) values (7, 1); insert into user_roles (user_id, role_id) values (7, 5); insert into users (name, username, password, rg, cpf, phone, email) values ('Ramon Cardoso', 'ramon', '', '2837465123123', '402.442.523-43', '(85) 9454-4549', 'ramon@gmail.com'); insert into clients_users (user_id, client_id) values (8, 1); insert into user_roles (user_id, role_id) values (8, 5); insert into users (name, username, password, rg, cpf, phone, email) values ('Hector Silveira', 'hector', '', '347610123123', '502.342.423-43', '(85) 5634-2349', 'hector@gmail.com'); insert into clients_users (user_id, client_id) values (9, 1); insert into user_roles (user_id, role_id) values (9, 5); insert into users (name, username, password, rg, cpf, phone, email) values ('Roberto Silva', 'roberto', '', '200234234123123', '202.442.423-43', '(85) 9214-2849', 'roberto@gmail.com'); insert into clients_users (user_id, client_id) values (10, 1); insert into user_roles (user_id, role_id) values (10, 5); insert into users (name, username, password, rg, cpf, phone, email) values ('Roger Carvalho', 'roger', '', '201231234123123', '242.542.423-43', '(85) 2344-2849', 'roger@gmail.com'); insert into clients_users (user_id, client_id) values (11, 1); insert into user_roles (user_id, role_id) values (11, 5); insert into users (name, username, password, rg, cpf, phone, email) values ('Amanda Teixeira', 'amanda', '', '2340234234123123', '202.412.323-43', '(85) 9344-4249', 'amanda@gmail.com'); insert into clients_users (user_id, client_id) values (12, 1); insert into user_roles (user_id, role_id) values (12, 5); ---------------------------------------------------------------------- insert into medicines (name) values ('Azitromicina 500mg comp'); ---------------------------------------------------------------------- insert into prescriptions_medicines (doctor_id, patient_id, date, use_method, medicine_id, quantity, unity, text) values (3, 5, '2014-08-01', 'Uso oral', '1', '1', 'caixa', 'Um comprimido a cada 12 horas'); insert into prescriptions_medicines (doctor_id, patient_id, date, use_method, medicine_id, quantity, unity, text) values (3, 5, '2014-03-07', 'Uso oral', '1', '1', 'caixa', 'Um comprimido a cada 24 horas'); ---------------------------------------------------------------------- insert into consultations (register_id, patient_id, date, text) values (3, 5, '2003-02-01', 'Paciente solicitou exames para checagem completa de seu estado. Solicitei hemograma. Auscutei e encontrei estado normal. Chequei pulmões, normal. Chequei pressão e temperatura, normal. Falou que tem tido febre, mas agora está melhor. Não está sob nenhuma medicação no momento.'); insert into consultations (register_id, patient_id, date, text) values (3, 5, '2003-02-15', 'Paciente retornou com o exame solicitado e outros. Indicam normalidade. Paciente afirma estar bem melhor. Aconselhei repouso e que retornasse em duas semanas.'); insert into consultations (register_id, patient_id, date, text) values (3, 5, '2003-02-27', 'Paciente afirma não estar sentido mais nenhum incômodo físico.'); insert into consultations (register_id, patient_id, date, text) values (3, 5, '2003-03-27', 'Checagem geral. Solicitei vários exames.'); insert into consultations (register_id, patient_id, date, text) values (3, 5, '2003-04-27', 'Retorno.'); ---------------------------------------------------------------------- insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-06-30 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-01 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-01 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-01 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-01 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-01 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-01 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-01 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-01 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-02 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-02 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-02 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-02 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-02 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-02 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-02 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-02 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-03 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-03 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-03 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-03 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-03 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-03 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-03 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-03 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-04 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-04 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-04 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-04 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-04 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-04 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-04 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-04 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-07 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-07 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-07 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-07 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-07 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-07 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-07 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-07 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-08 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-08 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-08 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-08 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-08 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-08 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-08 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-08 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-09 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-09 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-09 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-09 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-09 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-09 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-09 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-09 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-10 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-10 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-10 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-10 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-10 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-10 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-10 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-10 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-11 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-11 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-11 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-11 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-11 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-11 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-11 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-11 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-14 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-14 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-14 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-14 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-14 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-14 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-14 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-14 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-15 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-15 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-15 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-15 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-15 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-15 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-15 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-15 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-16 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-16 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-16 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-16 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-16 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-16 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-16 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-16 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-17 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-17 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-17 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-17 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-17 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-17 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-17 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-17 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-18 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-18 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-18 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-18 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-18 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-18 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-18 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-18 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-21 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-21 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-21 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-21 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-21 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-21 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-21 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-21 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-22 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-22 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-22 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-22 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-22 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-22 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-22 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-22 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-23 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-23 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-23 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-23 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-23 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-23 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-23 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-23 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-24 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-24 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-24 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-24 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-24 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-24 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-24 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-24 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-28 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-28 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-28 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-28 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-28 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-28 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-28 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-28 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-29 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-29 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-29 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-29 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-29 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-29 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-29 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-29 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-25 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-25 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-25 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-25 14:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-25 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-25 16:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-25 17:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-25 18:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 5, '2014-07-30 09:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 6, '2014-07-30 10:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 7, '2014-07-30 11:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 8, '2014-07-30 14:30', null, 'Inconcluso', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 9, '2014-07-30 15:30', null, 'Concluído', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 10, '2014-07-30 16:30', null, 'Confirmado', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 11, '2014-07-30 17:30', null, 'Marcado', null, null); insert into appointments (register_id, doctor_id, patient_id, date_time, text, status, created, updated) values (4, 3, 12, '2014-07-30 18:30', null, 'Marcado', null, null);
true
80c35b3ef8a36d9492821c91dc9bc11d60b72ce5
SQL
thelia-modules/ColissimoLabel
/Config/update/1.0.0.sql
UTF-8
1,053
2.921875
3
[ "MIT" ]
permissive
# This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; -- --------------------------------------------------------------------- -- colissimo_label -- --------------------------------------------------------------------- ALTER TABLE `colissimo_label` ADD COLUMN `order_ref` VARCHAR(255) NOT NULL AFTER `order_id`; ALTER TABLE `colissimo_label` ADD COLUMN `error` TINYINT NOT NULL AFTER `order_id`; ALTER TABLE `colissimo_label` ADD COLUMN `error_message` VARCHAR(255) AFTER `order_ref`; ALTER TABLE `colissimo_label` CHANGE COLUMN `number` `tracking_number` VARCHAR(255) NOT NULL; ALTER TABLE `colissimo_label` ADD COLUMN `label_type` VARCHAR(4) NOT NULL AFTER `error_message`; ALTER TABLE `colissimo_label` ADD COLUMN `with_customs_invoice` TINYINT NOT NULL AFTER `signed`; ALTER TABLE `colissimo_label` MODIFY `tracking_number` VARCHAR(255) AFTER `error_message`; # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1;
true
7a257bb6ac87c36363fbe372d4fbd0cf75f8c30d
SQL
qimy1314524/note
/杂记/sql图片/day1.sql
UTF-8
820
3.671875
4
[]
no_license
#========day_2.1========= ALTER TABLE stu ADD tea_id VARCHAR(30) ALTER TABLE stu ADD FOREIGN KEY (tea_id) REFERENCES teacher(tea_id) ALTER TABLE stu DROP FOREIGN KEY stu_ibfk_1 ALTER TABLE stu DROP INDEX tea_id ALTER TABLE stu DROP FOREIGN KEY tea_stu_id ALTER TABLE stu DROP INDEX tea_stu_id ALTER TABLE stu ADD CONSTRAINT tea_stu_id FOREIGN KEY (tea_id) REFERENCES teacher(tea_id) ON UPDATE CASCADE ON DELETE CASCADE UPDATE teacher SET tea_id=14 WHERE tea_id=11 #==========day2.2=============== 创建索引 CREATE INDEX sname_index ON stu(cname) ALTER TABLE stu DROP INDEX stu_index DROP INDEX sname_index ON stu SELECT * FROM product WHERE p_name LIKE '雪%'以雪开头的 SELECT * FROM product WHERE p_name LIKE '%雪%'带雪的 SELECT * FROM product WHERE p_name LIKE '雪__'以雪开头后面两个字符
true
464efc9cc54afc6c8ae45440193c5461db8b24fb
SQL
Mygrey/mrgray.notebook
/traffic/code/traffic_mysql_create.sql
UTF-8
7,874
2.578125
3
[]
no_license
grant all on traffic.* to 'root'@'%' identified by 'bigDataTeam' with grant option; create table zc_driver_train( sfzh varchar(50), jl int(11), zt int(11), ryzt int(11), max_wfxw int(11), level1_count int(11), level2_count int(11), level3_count int(11), wfxw_count int(11), max_wfjfs int(11), avg_wfjfs float, wfjfs_count int(11), max_fkje int(11), avg_fkje double, fkje_count int(11), max_znj double, avg_znj double, znj_count double, qzcs int(11), cqts int(11), sfty int(11), qbzr int(11), zyzr int(11), tdzr int(11), cyzr int(11), myzr int(11), wfrd int(11), swrs int(11), szrs int(11), zsrs int(11), qsrs int(11), zjccss double, level tinyint, label tinyint )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; create table zc_driver_matrix( sfzh varchar(50), jl_1 tinyint, jl_2 tinyint, jl_3 tinyint, jl_4 tinyint, jl_5 tinyint, zt_1 tinyint, zt_2 tinyint, zt_3 tinyint, zt_4 tinyint, ryzt_1 tinyint, ryzt_2 tinyint, wfxw_1 tinyint, wfxw_2 tinyint, wfxw_3 tinyint, wfxw_4 tinyint, level1_1 tinyint, level1_2 tinyint, level1_3 tinyint, level1_4 tinyint, level1_5 tinyint, level1_6 tinyint, level2_1 tinyint, level2_2 tinyint, level2_3 tinyint, level2_4 tinyint, level3_1 tinyint, level3_2 tinyint, level3_3 tinyint, wfxwc_1 tinyint, wfxwc_2 tinyint, wfxwc_3 tinyint, wfxwc_4 tinyint, wfxwc_5 tinyint, wfxwc_6 tinyint, wfjfs_m1 tinyint, wfjfs_m2 tinyint, wfjfs_m3 tinyint, wfjfs_a1 tinyint, wfjfs_a2 tinyint, wfjfs_a3 tinyint, wfjfs_c1 tinyint, wfjfs_c2 tinyint, wfjfs_c3 tinyint, wfjfs_c4 tinyint, fkje_m1 tinyint, fkje_m2 tinyint, fkje_m3 tinyint, fkje_m4 tinyint, fkje_m5 tinyint, fkje_m6 tinyint, fkje_a1 tinyint, fkje_a2 tinyint, fkje_a3 tinyint, fkje_a4 tinyint, fkje_a5 tinyint, fkje_a6 tinyint, fkje_c1 tinyint, fkje_c2 tinyint, fkje_c3 tinyint, fkje_c4 tinyint, fkje_c5 tinyint, znj_m1 tinyint, znj_m2 tinyint, znj_m3 tinyint, znj_m4 tinyint, znj_m5 tinyint, znj_a1 tinyint, znj_a2 tinyint, znj_a3 tinyint, znj_a4 tinyint, znj_c1 tinyint, znj_c2 tinyint, znj_c3 tinyint, znj_c4 tinyint, znj_c5 tinyint, qzcs_1 tinyint, qzcs_2 tinyint, qzcs_3 tinyint, cqts_1 tinyint, cqts_2 tinyint, cqts_3 tinyint, cqts_4 tinyint, cqts_5 tinyint, sfty_1 tinyint, sfty_2 tinyint, qbzr_1 tinyint, qbzr_2 tinyint, qbzr_3 tinyint, zyzr_1 tinyint, zyzr_2 tinyint, zyzr_3 tinyint, tdzr_1 tinyint, tdzr_2 tinyint, tdzr_3 tinyint, cyzr_1 tinyint, cyzr_2 tinyint, cyzr_3 tinyint, myzr_1 tinyint, myzr_2 tinyint, wfrd_1 tinyint, wfrd_2 tinyint, wfrd_3 tinyint, swrs_1 tinyint, swrs_2 tinyint, szrs_1 tinyint, szrs_2 tinyint, zsrs_1 tinyint, zsrs_2 tinyint, zsrs_3 tinyint, qsrs_1 tinyint, qsrs_2 tinyint, qsrs_3 tinyint, qsrs_4 tinyint, ccss_1 tinyint, ccss_2 tinyint, ccss_3 tinyint, ccss_4 tinyint, ccss_5 tinyint )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; create table zc_feature_woe( jl_1 decimal(10,5), jl_2 decimal(10,5), jl_3 decimal(10,5), jl_4 decimal(10,5), jl_5 decimal(10,5), zt_1 decimal(10,5), zt_2 decimal(10,5), zt_3 decimal(10,5), zt_4 decimal(10,5), ryzt_1 decimal(10,5), ryzt_2 decimal(10,5), wfxw_1 decimal(10,5), wfxw_2 decimal(10,5), wfxw_3 decimal(10,5), wfxw_4 decimal(10,5), level1_1 decimal(10,5), level1_2 decimal(10,5), level1_3 decimal(10,5), level1_4 decimal(10,5), level1_5 decimal(10,5), level1_6 decimal(10,5), level2_1 decimal(10,5), level2_2 decimal(10,5), level2_3 decimal(10,5), level2_4 decimal(10,5), level3_1 decimal(10,5), level3_2 decimal(10,5), level3_3 decimal(10,5), wfxwc_1 decimal(10,5), wfxwc_2 decimal(10,5), wfxwc_3 decimal(10,5), wfxwc_4 decimal(10,5), wfxwc_5 decimal(10,5), wfxwc_6 decimal(10,5), wfjfs_m1 decimal(10,5), wfjfs_m2 decimal(10,5), wfjfs_m3 decimal(10,5), wfjfs_a1 decimal(10,5), wfjfs_a2 decimal(10,5), wfjfs_a3 decimal(10,5), wfjfs_c1 decimal(10,5), wfjfs_c2 decimal(10,5), wfjfs_c3 decimal(10,5), wfjfs_c4 decimal(10,5), fkje_m1 decimal(10,5), fkje_m2 decimal(10,5), fkje_m3 decimal(10,5), fkje_m4 decimal(10,5), fkje_m5 decimal(10,5), fkje_m6 decimal(10,5), fkje_a1 decimal(10,5), fkje_a2 decimal(10,5), fkje_a3 decimal(10,5), fkje_a4 decimal(10,5), fkje_a5 decimal(10,5), fkje_a6 decimal(10,5), fkje_c1 decimal(10,5), fkje_c2 decimal(10,5), fkje_c3 decimal(10,5), fkje_c4 decimal(10,5), fkje_c5 decimal(10,5), znj_m1 decimal(10,5), znj_m2 decimal(10,5), znj_m3 decimal(10,5), znj_m4 decimal(10,5), znj_m5 decimal(10,5), znj_a1 decimal(10,5), znj_a2 decimal(10,5), znj_a3 decimal(10,5), znj_a4 decimal(10,5), znj_c1 decimal(10,5), znj_c2 decimal(10,5), znj_c3 decimal(10,5), znj_c4 decimal(10,5), znj_c5 decimal(10,5), qzcs_1 decimal(10,5), qzcs_2 decimal(10,5), qzcs_3 decimal(10,5), cqts_1 decimal(10,5), cqts_2 decimal(10,5), cqts_3 decimal(10,5), cqts_4 decimal(10,5), cqts_5 decimal(10,5), sfty_1 decimal(10,5), sfty_2 decimal(10,5), qbzr_1 decimal(10,5), qbzr_2 decimal(10,5), qbzr_3 decimal(10,5), zyzr_1 decimal(10,5), zyzr_2 decimal(10,5), zyzr_3 decimal(10,5), tdzr_1 decimal(10,5), tdzr_2 decimal(10,5), tdzr_3 decimal(10,5), cyzr_1 decimal(10,5), cyzr_2 decimal(10,5), cyzr_3 decimal(10,5), myzr_1 decimal(10,5), myzr_2 decimal(10,5), wfrd_1 decimal(10,5), wfrd_2 decimal(10,5), wfrd_3 decimal(10,5), swrs_1 decimal(10,5), swrs_2 decimal(10,5), szrs_1 decimal(10,5), szrs_2 decimal(10,5), zsrs_1 decimal(10,5), zsrs_2 decimal(10,5), zsrs_3 decimal(10,5), qsrs_1 decimal(10,5), qsrs_2 decimal(10,5), qsrs_3 decimal(10,5), qsrs_4 decimal(10,5), ccss_1 decimal(10,5), ccss_2 decimal(10,5), ccss_3 decimal(10,5), ccss_4 decimal(10,5), ccss_5 decimal(10,5) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; create table zc_logic_result( jl float, zt float, ryzt float, max_wfxw float, level1_count float, level2_count float, level3_count float, wfxw_count float, max_wfjfs float, avg_wfjfs float, wfjfs_count float, max_fkje float, avg_fkje float, fkje_count float, max_znj float, avg_znj float, znj_count float, qzcs float, cqts float, sfty float, qbzr float, zyzr float, tdzr float, cyzr float, myzr float, wfrd float, swrs float, szrs float, zsrs float, qsrs float, zjccss float )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; create table zc_weight_result( sfzh varchar(50), jl float, zt float, ryzt float, max_wfxw float, level1_count float, level2_count float, level3_count float, wfxw_count float, max_wfjfs float, avg_wfjfs float, wfjfs_count float, max_fkje float, avg_fkje float, fkje_count float, max_znj float, avg_znj float, znj_count float, qzcs float, cqts float, sfty float, qbzr float, zyzr float, tdzr float, cyzr float, myzr float, wfrd float, swrs float, szrs float, zsrs float, qsrs float, ccss float )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; create table zc_score_result( sfzh varchar(50), score double )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; create table zc_level_result( sfzh varchar(50), score double, level tinyint )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; create table zc_level_result( sfzh varchar(50), score double, level tinyint )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE `t_elec_credit_info` ( `id` mediumint(36) NOT NULL AUTO_INCREMENT, `sfzhm` varchar(30) DEFAULT NULL COMMENT '身份证号', `jf` varchar(10) DEFAULT NULL COMMENT '分数', `jb` varchar(10) DEFAULT NULL COMMENT '级别', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='我的信用信息记录表'; create table zc_black_table( sfzh varchar(50), black_mark tinyint )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
true
d7e1df8fcd144205bda8c21248227d24b80362d0
SQL
Elang89/Proyecto-I-Bases-I
/SQL scripts/21.CreatePetEnergy.sql
UTF-8
251
2.859375
3
[]
no_license
/* Made by Miuyin Yong Script for creating Pet's Energy Level table */ CREATE TABLE PetEnergy ( pet_energy_level varchar2(30) CONSTRAINT pet_energy_level_nn NOT NULL, /*Pet's energetic level from 0 to 5*/ pet_energy_code NUMBER(10) /*PRIMARY KEY*/ );
true
c1dd5800a01e08fa9853acd7f765f5ac4f6d27dc
SQL
Oleiva/Testing
/sql/dreamshop_items.sql
UTF-8
2,416
2.84375
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64) -- -- Host: localhost Database: dreamshop -- ------------------------------------------------------ -- Server version 5.7.9-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 `items` -- DROP TABLE IF EXISTS `items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `items` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `AMOUNT` bigint(20) NOT NULL, `NAME` varchar(255) NOT NULL, `PRICE` bigint(20) NOT NULL, `SKU` varchar(255) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `UK_8p0wyeendvudggqrwc8x4kuc1` (`SKU`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `items` -- LOCK TABLES `items` WRITE; /*!40000 ALTER TABLE `items` DISABLE KEYS */; INSERT INTO `items` VALUES (1,28,'iron',50000,'10001-1290-S'),(2,29,'sock',61000,'10002-1233-D'),(3,30,'pot',61000,'10031-1233-S'),(4,30,'pan',61000,'10003-1234-D'),(5,30,'scissors',8000,'10303-1235-S'),(6,30,'phone',600,'10301-1236-M'),(7,30,'pen',63000,'10031-1237-S'),(8,30,'notebook',61030,'13005-1238-S'),(9,30,'laptop',61032,'10006-1239-S'),(10,30,'board',61050,'10404-1210-M'),(11,30,'marker',999999999,'10051-1220-M'); /*!40000 ALTER TABLE `items` 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 2016-02-21 23:57:02
true
aae423b396bfa5930af793f47ca38f67eec71dc6
SQL
Eshi44/Employee-Tracker
/company_employees_db.sql
UTF-8
2,222
4.34375
4
[]
no_license
DROP DATABASE IF EXISTS company_employees_db; CREATE database company_employees_db; USE company_employees_db; -- * **department**: CREATE TABLE department ( -- * **id** - INT PRIMARY KEY id INT NOT NULL AUTO_INCREMENT, -- * **name** - VARCHAR(30) to hold department name department_name VARCHAR(30) NOT NULL, PRIMARY KEY(id) ); -- * **role**: CREATE TABLE role ( -- * **id** - INT PRIMARY KEY id INT NOT NULL AUTO_INCREMENT, -- * **title** - VARCHAR(30) to hold role title role_title VARCHAR(30), -- * **salary** - DECIMAL to hold role salary salary DECIMAL(10,4) NOT NULL, -- * **department_id** - INT to hold reference to department role belongs to department_id INT NOT NULL, FOREIGN KEY (department_id ) REFERENCES department(id), PRIMARY KEY(id) ); -- CREATE TABLE Orders ( -- OrderID int NOT NULL, -- OrderNumber int NOT NULL, -- PersonID int, -- PRIMARY KEY (OrderID), -- FOREIGN KEY (PersonID) REFERENCES Persons(PersonID) -- ); -- * **employee**: CREATE TABLE employee ( -- * **id** - INT PRIMARY KEY id INT NOT NULL AUTO_INCREMENT, -- * **first_name** - VARCHAR(30) to hold employee first name first_name VARCHAR(30) NOT NULL, -- * **last_name** - VARCHAR(30) to hold employee last name last_name VARCHAR(30) NOT NULL, -- * **role_id** - INT to hold reference to role employee has role_id INT NOT NULL, FOREIGN KEY(role_id) REFERENCES role(id), -- * **manager_id** - INT to hold reference to another employee that manager of the current employee. -- This field may be null if the employee has no manager manager_id INT NULL, PRIMARY KEY(id) ); -- dummy data from seeds.sql ------------------------------------------------------------------------------ INSERT INTO department (department_name) VALUES ("IT"), ("Admin"), ("HR"), ("Marketing"), ("Sales"); INSERT INTO role (role_title, salary, department_id) VALUES ("Data Analyst", 50, 1), ("OSL", 35, 2), ("HR Specialist", 30, 3), ("Staff", 30, 4),("Associate", 35, 5); INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES ("John", "Doe", 1, 2), ("Jane", "Doe", 2, 2), ("Richard", "Roe", 3, 2); SELECT * FROM department; SELECT * FROM role; SELECT * FROM employee;
true
2d05d1d938c673ca7608f1f3dea7454f2dd4b64e
SQL
mandmod/trining
/member.sql
UTF-8
2,236
3.296875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.5.2.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 09, 2012 at 10:37 PM -- Server version: 5.1.50-community -- PHP Version: 5.3.14 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: `dbtrain` -- -- -------------------------------------------------------- -- -- Table structure for table `member` -- DROP TABLE IF EXISTS `member`; CREATE TABLE IF NOT EXISTS `member` ( `mem_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'รหัสสมาชิค', `mem_name` varchar(50) NOT NULL COMMENT 'ชื่อสมาชิค', `mem_sname` varchar(50) NOT NULL COMMENT 'นามสกุลสมาชิก', `mem_sex` varchar(1) NOT NULL COMMENT 'เพศสมาชิค', `mem_age` varchar(2) NOT NULL COMMENT 'อายุสมาชิค', `mem_add` varchar(50) NOT NULL COMMENT 'ที่อยู่สมาชิค', `mem_salary` varchar(7) NOT NULL COMMENT 'เงินเดือนสมาชิค', PRIMARY KEY (`mem_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Dumping data for table `member` -- INSERT DELAYED IGNORE INTO `member` (`mem_id`, `mem_name`, `mem_sname`, `mem_sex`, `mem_age`, `mem_add`, `mem_salary`) VALUES (1, 'นก', 'ใจดี', 'F', '25', 'กรุงเทพ', '15000'), (2, 'ปลา', 'กล้าหาญ', 'F', '18', 'กรุงเทพ', '18000'), (3, 'ไก่', 'มีสุข', 'F', '26', 'เชียงใหม่', '25000'), (4, 'หมู', 'รักเรียน', 'M', '31', 'ระยอง', '2200'), (5, 'กุ้ง', 'สุธิราช', 'M', '28', 'กรุงเทพ', '40000'), (6, 'ปิติ', 'รักเรียน', 'M', '26', 'เชียงราย', '24000'); /*!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
89555bf53138d2fd215e536336eda5eda590f24f
SQL
pamidipadmapriya/bootstrap
/sql/derex.sql
UTF-8
3,284
2.921875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jun 02, 2014 at 06:39 PM -- Server version: 5.5.8 -- PHP Version: 5.3.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `derex` -- -- -------------------------------------------------------- -- -- Table structure for table `jobs` -- CREATE TABLE IF NOT EXISTS `jobs` ( `sno` int(11) NOT NULL AUTO_INCREMENT, `job_type` varchar(255) NOT NULL, `job_title` varchar(255) NOT NULL, `location` varchar(100) NOT NULL, `skills` text NOT NULL, `duration` varchar(255) NOT NULL, `mandotary_skills` text NOT NULL, `desire_skills` text NOT NULL, `created_date` text NOT NULL, PRIMARY KEY (`sno`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data for table `jobs` -- INSERT INTO `jobs` (`sno`, `job_type`, `job_title`, `location`, `skills`, `duration`, `mandotary_skills`, `desire_skills`, `created_date`) VALUES (1, 'sr Php Programmer', 'php', 'Hyd', 'jquery', '9 months', '', 'ajax,json', '02/06/2014'), (2, 'sr Php Programmer', 'php', 'Hyd', 'jquery', '9 months', '', 'ajax,json', '02/06/2014'), (3, 'ghgfh', 'php', 'fghfgh', 'fghgf', 'hfgh', 'hfghfg', 'gfhfghfghgfh', '02/06/2014 06:06:21'), (4, 'ghgfh', 'php', 'fghfgh', 'fghgf', 'hfgh', 'hfghfg', 'gfhfghfghgfh', '02/06/2014 06:06:22'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `sno` int(11) NOT NULL AUTO_INCREMENT, `firstname` varchar(100) NOT NULL, `lastname` varchar(100) NOT NULL, `phonenumber` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `resume` text NOT NULL, `created_date` datetime NOT NULL, PRIMARY KEY (`sno`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`sno`, `firstname`, `lastname`, `phonenumber`, `email`, `resume`, `created_date`) VALUES (4, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'checkout.xlsx', '0000-00-00 00:00:00'), (5, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'daily work list_may30.xlsx', '0000-00-00 00:00:00'), (6, 'POPCORNAPPS', 'PVT.LTD', '919581622225', 'padma.pamidi@popcornapps.com', 'daily work list.xlsx', '0000-00-00 00:00:00'), (7, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'Oncue_Test Cases_may30th2014.xlsx', '0000-00-00 00:00:00'), (8, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'Oncue_Test Cases.xlsx', '0000-00-00 00:00:00'), (9, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'purchase.xlsx', '0000-00-00 00:00:00'), (10, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'purchase.xlsx', '0000-00-00 00:00:00'), (11, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'checkout.xlsx', '0000-00-00 00:00:00'), (12, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'purchase.xlsx', '0000-00-00 00:00:00'), (13, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'purchase.xlsx', '0000-00-00 00:00:00'), (14, 'Priya', 'Pamidi', '919581622225', 'padma.pamidi@popcornapps.com', 'Oncue_Test Cases_may30th2014.xlsx', '0000-00-00 00:00:00');
true
2504912311afec0a2da45d6f8cf5b49a9c567597
SQL
nsh92/Bigdata-and-Machine-Learning-Education-at-ITWILL
/1_Database_SQL/chap09_GroupFunction/groupFunction_exam.sql
UTF-8
1,605
4.4375
4
[]
no_license
/* * 집합 함수(COUNT,MAX,MIN,SUM,AVG) * 작업 대상 테이블 : EMP, STUDENT, PROFESSOR * '별'로 끝난다 = 그룹바이를 써라 */ select * from emp; select * from student; select * from professor; --Q1. EMP 테이블에서 소속 부서별 최대 급여와 최소 급여 구하기 select max(sal) "최대 급여", min(sal) "최소 급여" from emp group by deptno; --Q2. EMP 테이블에서 JOB의 수 출력하기 select job, count(job) "직책의 수" from emp group by job; -- 내가푼거 select count(distinct job) from emp;--교수님이 푼거 --Q3. EMP 테이블에서 전체 사원의 급여에 대한 분산과 표준편차 구하기 select round(variance(sal),3) 분산, round(stddev(sal),3) 표준편차 from emp; --Q4. Professor 테이블에서 학과별 급여(pay) 평균이 400 이상 레코드 출력하기 select deptno 학과번호, avg(pay) 급여평균 from professor group by deptno having avg(pay) >= 400; --Q5. Professor 테이블에서 학과별,직위별 급여(pay) 평균 구하기 select deptno 학과, position 직위, avg(pay) 급여평균 from professor group by deptno, position; --학과별 : 1차 그루핑, 직위별 : 2차 그루핑 --Q6. Student 테이블에서 학년(grade)별로 -- weight, height의 평균값, 최대값, 최소값을 구한 -- 결과에서 키의 평균이 170 이하인 경우 구하기 select grade 학년, avg(weight) 평균몸무게, max(weight) 최대몸무게, min(weight) 최소몸무게, avg(height) 평균키, max(height) 최대키, min(height) 최소키 from student group by grade having avg(height)<=170;
true
51fa8406ebde243355325e363ed0c3fd968238ec
SQL
dennishemken/ination
/EZ Data/phone_info.sql
UTF-8
387
2.984375
3
[]
no_license
SELECT "public"."PHONE"."CONTACTID", "public"."PHONE"."AREACODE"||'-'||"public"."PHONE"."DIALNUMBER" as Phone_number, "public"."PHONE"."EXTENSION", "public"."PHONE"."PHONETYPE", "public"."PHONE"."REMARK", "public"."PHONE"."PURENUMBER" FROM "public"."PHONE" where "CONTACTID" in ( SELECT "public"."CONTACT"."CONTACTID" FROM "public"."CONTACT" WHERE "public"."CONTACT"."PRIVATE" < '1' );
true
3589a2b5908688d17ac32587e975ff4b927fe0fd
SQL
djsavaliya/hostel-management
/databases/managers.sql
UTF-8
616
3.5
4
[]
no_license
DROP TABLE IF EXISTS `managers` CREATE TABLE `managers` ( `manager_id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(255) NOT NULL, `last_name` varchar(255) NOT NULL, `date_of_birth` date NOT NULL, `mobile` varchar(30) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `is_admin` tinyint(1) NOT NULL, `hostel_id` int(11) DEFAULT NULL, PRIMARY KEY (`manager_id`), UNIQUE KEY `email` (`email`), KEY `hostel_id` (`hostel_id`), CONSTRAINT `managers_ibfk_1` FOREIGN KEY (`hostel_id`) REFERENCES `hostels` (`hostel_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
true
5beeeec9082a571cbf9756912afa8158c16fd853
SQL
misaelobregon/Unit-4-HW-PySchools
/SQL HW7/SQL Table _Schemata_Misa.sql
UTF-8
1,530
3.84375
4
[]
no_license
-- Create tables. DROP TABLES as failsafe DROP TABLE IF EXISTS departments; DROP TABLE IF EXISTS dept_emp; DROP TABLE IF EXISTS dept_manager; DROP TABLE IF EXISTS employees; DROP TABLE IF EXISTS salaries; DROP TABLE IF EXISTS titles; CREATE TABLE departments ( dept_no character varying(20) NOT NULL, dept_name character varying(45) NOT NULL, PRIMARY KEY (dept_no) ); CREATE TABLE employees ( emp_no integer NOT NULL, birth_date date NOT NULL, first_name character varying(45) NOT NULL, last_name character varying(45) NOT NULL, gender character varying(10) NOT NULL, hire_date date NOT NULL, PRIMARY KEY (emp_no) ); CREATE TABLE dept_emp ( emp_no integer NOT NULL, dept_no character varying(20) NOT NULL, from_date date NOT NULL, to_date date NOT NULL, FOREIGN KEY (dept_no) REFERENCES departments(dept_no), FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ); CREATE TABLE dept_manager ( dept_no character varying(20) NOT NULL, emp_no integer NOT NULL, from_date date NOT NULL, to_date date NOT NULL, FOREIGN KEY (dept_no) REFERENCES departments(dept_no), FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ); CREATE TABLE salaries ( emp_no integer NOT NULL, salary integer NOT NULL, from_date date NOT NULL, to_date date NOT NULL, FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ); CREATE TABLE titles ( emp_no integer NOT NULL, title character varying(30) NOT NULL, from_date date NOT NULL, to_date date NOT NULL, FOREIGN KEY (emp_no) REFERENCES employees(emp_no) );
true
76324d276b8072387e1b0aceedae2c8f93eb9811
SQL
jpvelsamy/mingo
/sql-scripts/fligh-plan-schedule-dml.sql
UTF-8
2,601
3.078125
3
[ "Apache-2.0" ]
permissive
TRUNCATE `mingo_txn`.`flight_plan`; TRUNCATE `mingo_txn`.`flight_plan_detail`; TRUNCATE `mingo_txn`.`ticket_pool`; INSERT INTO `mingo_txn`.`flight_plan` (`flight_plan_id`, `flight_start_date`, `flight_end_date`, `is_multi_city_stop`, `first_origin`, `last_destination`, `seat_count`, `public_seat_count`, `captive_seat_count`) VALUES ('1', '2016-09-20 08:00:00', '2016-09-20 16:30:00', '1', 'new york', 'san francisco', '12', '8', '4'); INSERT INTO `mingo_txn`.`flight_plan_detail` (`flight_plan_detail_id`, `origin`, `destination`, `seat_count`, `fare`, `flight_plan_id`, `flight_arrival_time`, `flight_departure_time`) VALUES ('1', 'New york', 'Denver', '2', '100', '1', '2016-09-20 08:00:00', '2016-09-20 12:00:00'); INSERT INTO `mingo_txn`.`flight_plan_detail` (`flight_plan_detail_id`, `origin`, `destination`, `seat_count`, `fare`, `flight_plan_id`, `flight_arrival_time`, `flight_departure_time`) VALUES ('2', 'Denver', 'New York', '2', '50', '1', '2016-09-20 12:15:00', '2016-09-20 16:30:00'); INSERT INTO `mingo_txn`.`flight_plan_detail` (`flight_plan_detail_id`, `origin`, `destination`, `seat_count`, `fare`, `flight_plan_id`, `flight_arrival_time`, `flight_departure_time`) VALUES ('3', 'New York', 'San Francisco', '8', '140', '1', '2016-09-20 08:00:00', '2016-09-20 16:30:00'); INSERT INTO `mingo_txn`.`ticket_pool` (`seat_number`,`row_number`,`is_window`,`class`,`seat_side`,`reservation_status`,`created_date`,`updated_date`,`flight_plan_id`,`flight_plan_detail_id`) VALUES (1,1,1,'business','left','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (2,1,1,'business','right','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (3,2,1,'business','left','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (4,2,1,'business','right','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (5,3,1,'economy','left','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (6,3,0,'economy','left','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (7,3,0,'economy','right','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (8,3,1,'economy','right','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (9,4,1,'economy','left','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (10,4,0,'economy','left','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (11,4,0,'economy','right','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null), (12,4,1,'economy','right','open','2016-09-20 00:00:00', '2016-09-20 08:00:00', 1, null);
true
4b33e29fdec9c32ad566c7628820af8d8296cfe3
SQL
Vutov/Web-Development-Basics-Project
/Cart.sql
UTF-8
6,257
3.359375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.2.11 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Sep 28, 2015 at 07:49 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: `cart` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `name`) VALUES (1, 'SoftUni'), (2, 'Books'), (3, 'Hardware'), (4, 'Software'), (5, 'Stuff'); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE IF NOT EXISTS `products` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `price` decimal(10,0) NOT NULL, `quantity` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `name`, `description`, `price`, `quantity`) VALUES (1, 'T-Shirt', 'Cool SoftUni shirt.', '10', 9), (2, 'Nakovs Book', 'New Introduction to programming with C#. Very cheap!', '1000', 249), (3, 'Cool picture', 'Very cool picture! Must have.', '1200', 1), (4, 'Old PC', 'My old PC, it is very powerfull - over 9000!', '2321', 1), (5, 'New PC', 'My new PC, it is ever powerfull than the old one.', '3000', 1), (6, 'Visual studio', 'Well its pirated version.', '0', 9996), (7, 'PHP Storm', 'Very cool tool to write some cool shit in PHP', '15', 9976), (8, 'NonExisting', 'Something not showing!', '100', 0), (16, ' <script> alert("I am an alert box!"); </script>', ' <script> alert("I am an alert box!"); </script>', '0', 1), (19, 'some', 'some', '100', 1); -- -------------------------------------------------------- -- -- Table structure for table `products_categories` -- CREATE TABLE IF NOT EXISTS `products_categories` ( `productId` int(11) NOT NULL, `categoryId` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `products_categories` -- INSERT INTO `products_categories` (`productId`, `categoryId`) VALUES (1, 1), (2, 2), (3, 5), (4, 3), (5, 3), (6, 4), (7, 4), (8, 1), (16, 5), (19, 5); -- -------------------------------------------------------- -- -- Table structure for table `promotions` -- CREATE TABLE IF NOT EXISTS `promotions` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `productId` int(11) NOT NULL, `percentage` double NOT NULL, `endDate` date NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `promotions` -- INSERT INTO `promotions` (`id`, `name`, `productId`, `percentage`, `endDate`) VALUES (9, 'some', 19, 12.5, '2015-10-20'), (10, 'nakovs book', 2, 60, '2015-10-15'), (11, 'T-Shirt', 1, 100, '2014-10-03'); -- -------------------------------------------------------- -- -- Table structure for table `reviews` -- CREATE TABLE IF NOT EXISTS `reviews` ( `id` int(11) NOT NULL, `message` text COLLATE utf8_unicode_ci NOT NULL, `userId` int(11) NOT NULL, `productId` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `reviews` -- INSERT INTO `reviews` (`id`, `message`, `userId`, `productId`) VALUES (4, 'Edited', 4, 2), (5, 'Some shit', 4, 1), (6, 'dfdsfdsfsdf', 1, 1), (7, 'Some whti', 1, 3), (8, 'cool shit bro', 1, 2); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `Cash` decimal(10,0) NOT NULL, `isAdmin` tinyint(4) NOT NULL DEFAULT '0', `isEditor` tinyint(11) NOT NULL DEFAULT '0', `isModerator` tinyint(4) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `Cash`, `isAdmin`, `isEditor`, `isModerator`) VALUES (1, 'Kamigawa', 'e9cbd2ea8015a084ce9cf83a3c65b51f8fa10a39', '10000', 1, 0, 0), (4, 'user', 'e9cbd2ea8015a084ce9cf83a3c65b51f8fa10a39', '10000', 0, 1, 0), (31, 'mod', 'e9cbd2ea8015a084ce9cf83a3c65b51f8fa10a39', '10000', 0, 0, 1), (32, 'ess', '58ed1829bd7416d908f86b464ca2974734876376', '9990', 1, 0, 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- Indexes for table `promotions` -- ALTER TABLE `promotions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `reviews` -- ALTER TABLE `reviews` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `promotions` -- ALTER TABLE `promotions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `reviews` -- ALTER TABLE `reviews` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=33; /*!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
43d3d6f7e8d229b0103dd75aeb06eda636bac895
SQL
carlosjuraszek/adventure_works
/academy_adventure_works/models/staging/stg_product.sql
UTF-8
2,128
3.21875
3
[]
no_license
with src_data as ( select cast(productid as INT64) as id_produto , name as produto , productnumber as produto_numero , case when makeflag is true then 'Sim' else 'Nao' end as produto_comprado , case when finishedgoodsflag is true then 'Sim' else 'Nao' end as pode_vender , coalesce(cast(color as string), 'Not Informed') as cor_produto , safetystocklevel as estoque_seguranca , reorderpoint as ponto_compra , standardcost as custo_padrao , listprice as preco_venda , coalesce(cast(size as string), 'Not Informed') as tamanho_produto , coalesce(cast(sizeunitmeasurecode as string), 'Not Informed') as tamanho_unidade , coalesce(cast(weightunitmeasurecode as string), 'Not Informed') as peso_unidade , coalesce(cast(weight as string), 'Not Informed') as peso_produto , daystomanufacture as dias_fabricar , case when productline = 'R' then 'Road' when productline = 'M' then 'Mountain' when productline = 'T' then 'Touring' when productline = 'S' then 'Standard' else 'Not Informed' end as linha_produto , case when class = 'H' then 'High' when class = 'M' then 'Medium' when class = 'L' then 'Low' else 'Not Informed' end as classe_produto , case when style = 'W' then 'Womens' when style = 'M' then 'Mens' when style = 'U' then 'Universal' else 'Not Informed' end as estilo_produto , productmodelid as id_modelo , productsubcategoryid as id_subcategoria from {{ source('adventure_works', 'product') }} ) , create_sk as ( select * , {{ dbt_utils.surrogate_key(['id_produto']) }} as sk_produto , {{ dbt_utils.surrogate_key(['id_modelo']) }} as sk_modelo , {{ dbt_utils.surrogate_key(['id_subcategoria']) }} as sk_subcategoria from src_data ) select * from create_sk
true
bcecf28e048a052f9c17b17944c282924790c1c5
SQL
carluazevedo/websis
/sql/03_reg_ponto.sql
UTF-8
559
2.609375
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
####################################### # CRIAR TABELA PARA REGISTRO DE PONTO # ####################################### CREATE TABLE IF NOT EXISTS `reg_ponto_carlu` ( `id` int(6) UNSIGNED NOT NULL AUTO_INCREMENT, `data` date NOT NULL DEFAULT '0000-00-00', `folga` tinyint(1) DEFAULT NULL, `entrada_1` time DEFAULT '00:00:00', `saida_1` time DEFAULT '00:00:00', `entrada_2` time DEFAULT '00:00:00', `saida_2` time DEFAULT '00:00:00', `observacoes` text, PRIMARY KEY (`data`), UNIQUE KEY `id` (`id`) ) DEFAULT CHARSET=utf8;
true
edeca95fc10a44163f412798eb415904c3a1e1d4
SQL
eshxd41/AgileTool
/StoredProcedure.sql
UTF-8
4,689
3.109375
3
[]
no_license
DELIMITER $$ DROP PROCEDURE IF EXISTS project_reset $$ CREATE PROCEDURE project_reset() BEGIN -- Disable foreign key constraint checks SET FOREIGN_KEY_CHECKS = 0; -- Empty tables and set their auto-incrément to 1 TRUNCATE TABLE acceptance_test; TRUNCATE TABLE acceptance_test_status; TRUNCATE TABLE feature; TRUNCATE TABLE feature_tag; TRUNCATE TABLE iteration; TRUNCATE TABLE member; TRUNCATE TABLE project; TRUNCATE TABLE project_member; TRUNCATE TABLE tag; TRUNCATE TABLE project_role; TRUNCATE TABLE task; TRUNCATE TABLE task_status; TRUNCATE TABLE user_role; -- Enable again foreign key constraint checks SET FOREIGN_KEY_CHECKS = 1; BEGIN START TRANSACTION; INSERT INTO member (id, email, password,first_name,last_name,created_at,confirmed_at,token,token_expiring_at) VALUES (1, 'tintin@herge.be','tin','tin','tin','2017-1-1','2017-1-2','1' '2017-1-2', '2019-1-1'), (2, 'pintin@herge.be','pin','pin','tin','2017-1-1','2017-1-2','2' '2017-1-2', '2019-1-1'), (3, 'sintin@herge.be','sin','sin','tin','2017-1-1','2017-1-3','3' '2017-1-2', '2019-1-1'), (4, 'xintin@herge.be','xin','xin','xin','2017-1-1','2017-1-4','4' '2017-1-2', '2019-1-1'), (5, 'yintin@herge.be','xin','yin','yin','2017-1-1','2017-1-4','5' '2017-1-2', '2019-1-1'); INSERT INTO task_status (id, name) VALUES ( 1,'task1'), ( 2,'task2'), (3,'task3'), ( 4,'task4'), ( 5,'task5'), ( 6,'task1'), ( 7,'task2'), (8,'task3'), ( 9,'task4'), ( 10,'task5'), ( 11,'task1'), ( 12,'task2'); INSERT INTO project_role (id, name) VALUES ( 1,'developer'), ( 2,'manager'), (3,'developer'), ( 4,'tester'), ( 5,'couch'); INSERT INTO tag (id, name) VALUES (1, 'added tag'), (2, 'yes' ), (3,'company'), (4, 'compleated'); INSERT INTO user_role (id, name, description) VALUES ( 1,'developper','task'), ( 2,'manager','task'), (3,'tester','task'), ( 4,'developer','task'), ( 5,'tester','task'); INSERT INTO project (id, name, description,administrator_id,created_at) VALUES ( 1,'DJI','Netherlands',2 , '2004-12-23'); INSERT INTO project_member (member_id, project_id, role_id,added_at,token) VALUES ( 1,1,2 , '2005-12-23','4'), ( 2,1,2 , '2005-12-23','3'), (3,1,2 , '2005-12-23','2'), ( 4,1,2 , '2005-12-23','1'); INSERT INTO iteration (id, deadline, project_id) VALUES ( 1, '2005-12-23',1), ( 2, '2010-04-21',1); INSERT INTO feature (id, title, functionality,benefit,priority,iteration_id, project_id,user_role_id) VALUES (1, 'feature1', 'feature without iteration but tasks', 'good',2,1,1,1), (2, 'feature2', 'feature did not complete in the 1st iteration', 'bad',4,2,1,3), (3, 'feature3', 'feature in the 1st iteration and finished', 'good',1,1,1,4), (4, 'feature4', 'feature in the 2nd iteration with tasks', 'bad',3,2,1,3), (5, 'feature5', 'feature in the 2nd iteration without task', 'bad',3,2,1,1); INSERT INTO task (id, title, description, estimated_duration, actual_duration, feature_id, status_id, owner_id) VALUES (1,'web','do web', 20, 25, 1, 1, 1), (2,'php','do php', 10, 15, 2, 2, 2), (3,'connection','do dbms', 23, 25, 3, 3, 3), (4,'web','do web', 10, 25, 4, 4, 4), (5,'web','do web', 20, 25, 5, 1, 1), (6,'php','do php', 10, 15, 1, 2, 2), (7,'connection','do dbms', 23, 25, 2, 3, 3), (8,'web','do web', 10, 25, 4, 4, 4), (9,'web','do web', 20, 25, 1, 1, 1), (10,'php','do php', 10, 15, 5, 2, 2), (11,'connection','do dbms', 23, 25, 3, 3, 3), (12,'web','do web', 10, 25, 5, 4, 4); INSERT INTO acceptance_test (id, description, test_result,feature_id,bug_id) VALUES (1, 'Dupont', 'good',1,1), (2, 'Tintin', 'bad',2,2), (3, 'Haddock','bad',3,3), (4, 'Castafiore', 'good',4,4), (5, 'Dupont', 'good',5,5), (6, 'Tintin', 'bad',2,6), (7, 'Haddock','bad',3,7), (8, 'Castafiore', 'good',4,7), (9, 'Dupont', 'good',1,8), (10, 'Tintin', 'bad',2,9), (11, 'Haddock','bad',3,10), (12, 'Castafiore', 'good',5,10); INSERT INTO feature_tag (feature_id, tag_id) VALUES (1, 1), (2, 2), (3, 3), (4, 4); INSERT INTO acceptance_test_status (iteration_id, acceptance_test_id,is_satisfied) VALUES (1,1, false), (1,2, false), (1,3, false), (1,4, false), (1,5, false), (1,6, false), (1,7, false), (1,8, false), (1,9, false), (1,10, false), (1,11, false), (1,12, falseproject); COMMIT; END; END $$ CALL project_reset();
true
eb3f6fbcec3cd24093318ed8c6825f6715c2041e
SQL
Yan-Brav/ua.skillsup.gelius
/config/db/testData.sql
UTF-8
3,885
2.71875
3
[]
no_license
INSERT INTO client (client_id, company_name, phone_number) VALUES (1, 'АВК', '+38050-355-62-78'), (2, 'Ласунка', '+38066-355-62-78'), (3, 'Петрушенко', '+38067-355-62-78'); INSERT INTO product_type (product_type_id, product_type) VALUES (1, 'Ящик (4 клапана)'), (2, 'Ящик сложный'), (3, 'Ящик (крышка)'), (4, 'Ящик (дно)'), (5, 'Лоток'), (6, 'Трейс'), (7, 'Лист'), (8, 'Перегородка'), (9, 'Прокладка'), (10, 'Уголок'), (11, 'Двухслойка рулон'), (12, 'Комплектация'), (13, 'Вкладыш'), (14, 'Комплект'), (15, 'Шоубокс'), (16, 'Гофрозаготовка'), (17, 'Лист необрезной'); INSERT INTO format (format_id, format) VALUES (1, '1050'), (2, '1250'), (3, '1400'), (4, '1510'); INSERT INTO profile (profile_id, profile) VALUES (1, 'В'), (2, 'Е'), (3, 'С'), (4, 'ВЕ'), (5, 'ВС'), (6, 'СЕ'); INSERT INTO cardboard_brand (cardboard_brand_id, cardboard_brand) VALUES (1, 'КГ-4'), (2, 'КГ-2'), (3, 'КГ-1'), (4, 'Т-21'), (5, 'Т-22'), (6, 'Т-23'), (7, 'Т-24'), (8, 'Т-25'), (9, 'Т-26'), (10, 'Т-27'), (11, 'П-31'), (12, 'П-32'), (13, 'П-33'), (14, 'П-34'), (15, 'П-35'), (16, 'П-36'), (17, 'Д-21'), (18, 'Д-22'); INSERT INTO cellulose_layer (cellulose_layer_id, cellulose_layer) VALUES (1, 'нет'), (2, 'внутренний'), (3, 'наружный'), (4, 'оба'); INSERT INTO face_layer (face_layer_id, face_layer) VALUES (1, 'Белый'), (2, 'Бурый'), (3, 'Крашеный'), (4, 'НМ'), (5, 'МО'); INSERT INTO inner_layer (inner_layer_id, inner_layer) VALUES (1, 'Белый'), (2, 'Бурый'), (3, 'Крашеный'), (4, 'НМ'), (5, 'МО'); INSERT INTO connection_valve (connection_valve_id, connection_valve) VALUES (1, 'склееный'), (2, 'сшитый'), (3, 'склееный+сшитый'); INSERT INTO producibility (producibility_id, service_center, group_priority, element_priority) VALUES (1, 'АГ', 0, NULL), (2, 'Тайванец', 10, 10), (3, 'Болгарец', 10, 20), (4, 'Сшивка ручная', 20, 10), (5, 'Сшивка автомат', 20, 20), (6, 'Склейка ручная', 30, 10), (7, 'Склейка 3 точки', 30, 20), (8, 'БОБСТ', 40, NULL), (9, 'Ротация', 50, NULL), (10, 'Тигель большой', 60, 10), (11, 'Тигель малый', 60, 20), (12, 'Ролевый', 60, 30), (13, 'К. Р.', 70, NULL), (14, 'БОИКС', 80, NULL), (15, 'Перегородки', 90, NULL), (16, 'Упаковка', 100, NULL) ; INSERT INTO packing (packing_id, packing) VALUES (1, 'Без упаковки'), (2, 'Паллета, лента, стрейч'), (3, 'Паллета, лента, без стрейча'), (4, 'Паллета, стрейч, без ленты'), (5, '2 пака на паллете'); INSERT INTO pallet (pallet_id, pallet) VALUES (1, '1200х800'), (2, '1200х1000'); INSERT INTO pallet_placement (pallet_placement_id, pallet_placement) VALUES (1, '1 пачка в ряду'), (2, '2 пачки в ряду'), (3, '3 пачки в ряду'), (4, '4 пачки в ряду'), (5, '5 пачек в ряду'), (6, '6 пачек в ряду'), (7, '8 пачек в ряду'); INSERT INTO bigovki_deltas (bigovki_deltas_id, profile_id, delta_1, delta_2, delta_3) VALUES (1, 2, 1.5, 2, 1.5), (2, 1, 3, 4, 3), (3, 3, 3, 4, 3), (4, 4, 5, 6, 5), (5, 6, 5, 6, 5), (6, 5, 5, 8, 5) ; INSERT INTO perforation_deltas (perforation_deltas_id, profile_id, delta_1, delta_2, delta_3, delta_4) VALUES (1, 1, 2, 4, 4, 2), (2, 3, 2, 4, 4, 2), (3, 2, 2, 4, 4, 2), (4, 5, 4, 8, 8, 4), (5, 4, 3, 6, 6, 3), (6, 6, 3, 6, 6, 3) ; COMMIT;
true
f14f8668ea399b7d3b528ef114e932842beb4c9c
SQL
RUM/barrica
/sql/collaborations.sql
UTF-8
1,385
3.96875
4
[]
no_license
create type collaboration_types as enum ('author', 'co-author', 'translator', 'editor', 'guest', 'producer', 'host'); create table if not exists collaborations ( relation collaboration_types , collab_id uuid references collabs (id) on update cascade , article_id uuid references articles (id) on update cascade , constraint collaboration_pkey primary key (collab_id, article_id) ); grant all on collaborations to rumadmin; grant select on table collaborations to guest; alter table collaborations drop constraint collaborations_article_id_fkey, add constraint collaborations_article_id_fkey foreign key (article_id) references articles(id) on delete cascade; alter table collaborations drop constraint collaborations_collab_id_fkey, add constraint collaborations_collab_id_fkey foreign key (collab_id) references collabs(id) on delete cascade; create view release_collabs as select release_id, releases.name as release_name, article_id, plain_title(articles) as title, articles.online as article_online, collab_id, name(collabs) as collab_name, collabs.online as collab_online, collaborations.relation from collabs join collaborations on collab_id = collabs.id join articles on articles.id = article_id join releases on release_id = releases.id; grant select on table release_collabs to guest; grant select on table release_collabs to rumadmin;
true
2dbb3770ae37d2381ed59e62e65f748bcec45b5d
SQL
moumoukings/LearnForJavaEE
/day29/Database/sort.sql
UTF-8
578
3.03125
3
[ "MIT" ]
permissive
CREATE TABLE sort( sid INT PRIMARY KEY AUTO_INCREMENT, sname VARCHAR(100), sprice DOUBLE, sdesc VARCHAR(5000) ); -- 初始化数据 INSERT INTO `sort`(sname,sprice,sdesc) VALUES ('家电',2000,'优惠的促销'), ('家具',8900,'家具价格上调,原材料涨价'), ('儿童玩具',300,'赚家长钱'), ('生鲜',500.99,'生鲜商品'), ('服装',24000,'换季销售'), ('洗涤',50,'洗发水促销'); DROP TABLE sort; SELECT * FROM sort; DELETE FROM sort WHERE sid=7; INSERT INTO sort(sname,sprice,sdesc) VALUES('汽车用品',50000,'疯狂涨价');
true
917d00e234cff16f07a3b0436ec920d39d788de4
SQL
nicvidal/SocialRecipe-SGBD
/sql/consultations.sql
UTF-8
6,645
4.21875
4
[]
no_license
----------------------------------------------------------------------------- --Consultations ----------------------------------------------------------------------------- -- Informations sur recettes : SELECT id_recipe, recipe_name, date_added, preparation_time, cooking_time, waiting_time, servings FROM recipe; -- Informations sur ingrédients : SELECT id_ingredient, ingredient_name FROM ingredient; -- Informations sur menus : SELECT id_menu, menu_name, id_user FROM menu; --Recette d'une catégorie @category pour un nombre de personne @nb_people donné SELECT * FROM recipe INNER JOIN is_category ON recipe.id_recipe=is_category.id_recipe INNER JOIN category ON is_category.id_category=category.id_category; WHERE category_name = " @category " AND nb_people = " @nb_people"; --Menu avec seulement des recettes ajoutées après une date @date donnée --Selection de tous les couple menu-recette, group by pour compter combien de recette par menu --Selection de tous les couples menu-recette avec recette ajouté après date voulue, group by pour compter combien de recette associée il y a --Selection de tous les menus pour lesquels le nombre de recette total = au nombre de recette post-date SELECT id_menu, NbRecipeValid.menu_name FROM ( SELECT menu.id_menu as id1, COUNT(is_part_of.id_recipe) as nb_total_recipe FROM menu INNER JOIN is_part_of ON menu.id_menu = is_part_of.id_menu GROUP BY menu.id_menu) AS NbRecipePerMenu INNER JOIN ( SELECT menu.id_menu, menu.menu_name, COUNT(recipe.id_recipe) as nb_recipe_valid FROM menu INNER JOIN is_part_of ON menu.id_menu = is_part_of.id_menu INNER JOIN recipe ON is_part_of.id_recipe = recipe.id_recipe WHERE recipe.date_added >= @date GROUP BY menu.id_menu )AS NbRecipeValid ON NbRecipePerMenu.id1 = NbRecipeValid.id_menu WHERE nb_total_recipe=nb_recipe_valid; --Historique des préparations d'une recette @recipe donnée SELECT id_description, description_text, description.date_added, id_user FROM description JOIN recipe ON description.id_recipe = recipe.id_recipe WHERE recipe.id_recipe = @recipe ORDER BY description.date_added ASC; --Ensemble des menus contenant des recettes avec des ingrédient peu caloriques --Sélection des recettes d'un menu @menu: --VALIDEE SELECT recipe.id_recipe FROM menu JOIN is_part_of ON menu.id_menu = is_part_of.id_menu JOIN recipe ON is_part_of.id_recipe = recipe.id_recipe WHERE menu.id_menu = @menu; --==> Sélection pour une recette @recipe des ingrédients et de leurs calories : --VALIDEE SELECT ingredient.id_ingredient, nutritional_characteristic.id_nc, ingredient_characteristic.quantity from recipe JOIN constitute ON recipe.id_recipe = constitute.id_recipe JOIN ingredient ON constitute.id_ingredient = ingredient.id_ingredient JOIN ingredient_characteristic ON ingredient.id_ingredient = ingredient_characteristic.id_ingredient JOIN nutritional_characteristic ON ingredient_characteristic.id_nc = nutritional_characteristic.id_nc WHERE recipe.id_recipe = 7 and nutritional_characteristic.id_nc=1; --1 parce que c'est les calories --==> Plus qu'à vérifier la valeur de chaque ingrédient de chaque recette du menu et estimer s'il est peu calorique ou non. SELECT id_ingredient FROM (SELECT ingredient.id_ingredient, nutritional_characteristic.id_nc, ingredient_characteristic.quantity from recipe JOIN constitute ON recipe.id_recipe = constitute.id_recipe JOIN ingredient ON constitute.id_ingredient = ingredient.id_ingredient JOIN ingredient_characteristic ON ingredient.id_ingredient = ingredient_characteristic.id_ingredient JOIN nutritional_characteristic ON ingredient_characteristic.id_nc = nutritional_characteristic.id_nc WHERE nutritional_characteristic.nc_name = 'Calory' and recipe.id_recipe IN (SELECT recipe.id_recipe FROM menu JOIN is_part_of ON menu.id_menu = is_part_of.id_menu JOIN recipe ON is_part_of.id_recipe = recipe.id_recipe WHERE menu.id_menu = 10)) as CaloryPerIngredient WHERE quantity < 100; --liste des recettes sucré-salé pour une catégorie (à la fois miel et sel) SELECT id_recipe FROM (SELECT id_recipe FROM constitute JOIN ingredient ON constitute.id_ingredient = ingredient.id_ingredient WHERE ingredient_name = 'Honey') AS sweetIngredient NATURAL JOIN (SELECT id_recipe FROM constitute JOIN ingredient ON constitute.id_ingredient = ingredient.id_ingredient WHERE ingredient_name = 'Salt') AS saltyIngredient WHERE sweetIngredient.id_recipe = saltyIngredient.id_recipe; --liste des top recettes : notés au moins 5 fois à 3 SELECT recipe.id_recipe, COUNT(recipe.id_recipe) as nb_vote FROM recipe JOIN note ON recipe.id_recipe = note.id_recipe WHERE note.note >= 3 GROUP BY recipe.id_recipe HAVING COUNT(id_user) >=5; --recettes présentes dans au moins trois menus, ayant au moins 10 notes et au moins 3 commentaires (SELECT recipe.id_recipe FROM recipe JOIN is_part_of ON recipe.id_recipe = is_part_of.id_recipe GROUP BY recipe.id_recipe HAVING COUNT(id_menu) >=3 --au moins trois menus INTERSECT SELECT recipe.id_recipe FROM recipe JOIN note ON recipe.id_recipe = note.id_recipe GROUP BY recipe.id_recipe HAVING COUNT(id_user) >=10) --au moins 10 notes INTERSECT SELECT recipe.id_recipe FROM recipe JOIN comment ON recipe.id_recipe = comment.id_recipe GROUP BY recipe.id_recipe HAVING COUNT(id_user) >=3; --au moins 3 commentaires --Consultation détaillée du menu @menu SELECT id_menu, menu_name, id_user FROM menu WHERE id_menu = @menu; SELECT recipe.id_recipe, recipe_name FROM recipe JOIN is_part_of ON recipe.id_recipe = is_part_of.id_recipe WHERE id_menu = @menu; --Consultation détaillée de la recette @recipe SELECT id_recipe, recipe_name, date_added, preparation_time, cooking_time, waiting_time, servings FROM recipe WHERE id_recipe = @recipe; SELECT id_category, category_name FROM category JOIN is_category ON category.id_category = is_category.id_category WHERE is_category.id_recipe = @recipe; SELECT unit_name, ingredient_name, quantity FROM ingredient JOIN constitute ON ingredient.id_ingredient = constitute.id_ingredient JOIN unit ON consitute.id_unit = unit.id_unit WHERE constitute.id_recipe = @recipe; --Consultation détaillée de l'ingrédient @ingredient SELECT id_ingredient, ingredient_name FROM ingredient WHERE id_ingredient = @ingredient; SELECT nc_name, quantity FROM Ingredient_Characteristic JOIN Nutritional_Characteristic ON Ingredient_Characteristic.id_nc = Nutritional_Characteristic.id_nc WHERE Ingredient_Characteristic.id_ingredient = @ingredient;
true
b98060f93c3e136fcee5190cdcdb3bb63c64f138
SQL
vijaydairyf/TimelyFish
/SolomonApp/dbo/Stored Procedures/dbo.ADG_ProcessMgr_ARCustID.sql
UTF-8
205
2.71875
3
[]
no_license
 create proc ADG_ProcessMgr_ARCustID as select ar.CpnyID, ar.CustID from ARDoc ar join CustomerEDI ca on ca.CustID = ar.CustID where ca.CreditRule = 'B' group by ar.CpnyID, ar.CustID
true
f3b9c34ffb3175a75fd3fb4f4b782ce99b19ca42
SQL
romain-teste/CNAM_USAL37_2020-3
/USAL37/tp_freelancer/tp_freelancer_selects.sql
UTF-8
379
3.359375
3
[]
no_license
USE tp_feelancer; SELECT customer_name, cat_name FROM customers JOIN customers_cats ON customers.cat_id = customers_cats.cat_id; SELECT customer_id, customer_name, customer_email FROM customers; SELECT job_title, J.customer_id, customer_name, cat_name from jobs AS J JOIN customers AS C ON J.customer_id = C.customer_id join customers_cats AS CAT ON C.cat_id = CAT.cat_id;
true
32ea1d7e465b8e9243ee343a5a695a6ada423024
SQL
EmuZONE/FrozenEMU
/Database/game_event_npcflag.sql
UTF-8
1,249
2.78125
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : TrinityWotLK Source Server Version : 50634 Source Host : localhost:3307 Source Database : wow_world Target Server Type : MYSQL Target Server Version : 50634 File Encoding : 65001 Date: 2016-12-21 19:19:53 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for game_event_npcflag -- ---------------------------- DROP TABLE IF EXISTS `game_event_npcflag`; CREATE TABLE `game_event_npcflag` ( `eventEntry` tinyint(3) unsigned NOT NULL COMMENT 'Entry of the game event', `guid` mediumint(8) unsigned NOT NULL DEFAULT '0', `npcflag` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guid`,`eventEntry`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci; -- ---------------------------- -- Records of game_event_npcflag -- ---------------------------- INSERT INTO `game_event_npcflag` VALUES ('17', '1803', '179'); INSERT INTO `game_event_npcflag` VALUES ('17', '38112', '129'); INSERT INTO `game_event_npcflag` VALUES ('17', '26771', '179'); INSERT INTO `game_event_npcflag` VALUES ('17', '46320', '177'); INSERT INTO `game_event_npcflag` VALUES ('17', '208240', '1048705');
true
e7510c1cfbe1bed1b66adcd57041e91dc80e02c6
SQL
MyDAIDAI/paper
/毕业设计图表/sql/bbs_user.sql
UTF-8
2,088
3.078125
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : 1 Source Server Version : 50553 Source Host : localhost:3306 Source Database : xiuno4 Target Server Type : MYSQL Target Server Version : 50553 File Encoding : 65001 Date: 2017-04-23 11:15:35 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for bbs_user -- ---------------------------- DROP TABLE IF EXISTS `bbs_user`; CREATE TABLE `bbs_user` ( `uid` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户编号', `gid` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '用户组编号', `email` char(40) NOT NULL DEFAULT '' COMMENT '邮箱', `username` char(32) NOT NULL DEFAULT '' COMMENT '用户名', `realname` char(16) NOT NULL DEFAULT '' COMMENT '用户名', `idnumber` char(19) NOT NULL DEFAULT '' COMMENT '用户名', `password` char(32) NOT NULL DEFAULT '' COMMENT '密码', `password_sms` char(16) NOT NULL DEFAULT '' COMMENT '密码', `salt` char(16) NOT NULL DEFAULT '' COMMENT '密码混杂', `mobile` char(11) NOT NULL DEFAULT '' COMMENT '手机号', `qq` char(15) NOT NULL DEFAULT '' COMMENT 'QQ', `threads` int(11) NOT NULL DEFAULT '0' COMMENT '发帖数', `posts` int(11) NOT NULL DEFAULT '0' COMMENT '回帖数', `credits` int(11) NOT NULL DEFAULT '0' COMMENT '积分', `golds` int(11) NOT NULL DEFAULT '0' COMMENT '金币', `rmbs` int(11) NOT NULL DEFAULT '0' COMMENT '人民币', `create_ip` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时IP', `create_date` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `login_ip` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '登录时IP', `login_date` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '登录时间', `logins` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数', `avatar` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户最后更新图像时间', PRIMARY KEY (`uid`), UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`), KEY `gid` (`gid`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
true
0a46a1d8d75f18e47c676d15bdaceec04d9234b8
SQL
Tiffanymctsou/realtime-weather
/realtime_weather.sql
UTF-8
5,055
2.96875
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.31, for macos10.14 (x86_64) -- -- Host: localhost Database: realtime_weather -- ------------------------------------------------------ -- Server version 5.7.31 /*!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 `auth` -- DROP TABLE IF EXISTS `auth`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `auth` ( `id` bigint(11) NOT NULL AUTO_INCREMENT, `auth_key` varchar(45) NOT NULL, `status` tinyint(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `auth` -- LOCK TABLES `auth` WRITE; /*!40000 ALTER TABLE `auth` DISABLE KEYS */; INSERT INTO `auth` VALUES (1,'LRWI-1615369249594-JFO98',1); /*!40000 ALTER TABLE `auth` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `location` -- DROP TABLE IF EXISTS `location`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `location` ( `id` bigint(11) NOT NULL AUTO_INCREMENT, `station_id` varchar(10) NOT NULL, `location_name` varchar(20) NOT NULL, `city` varchar(15) NOT NULL, `dist` varchar(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `location` -- LOCK TABLES `location` WRITE; /*!40000 ALTER TABLE `location` DISABLE KEYS */; INSERT INTO `location` VALUES (1,'466880','板橋','新北市','板橋區'),(2,'466920','臺北','臺北市','中正區'),(3,'467050','新屋','桃園市','新屋區'),(4,'466900','淡水','新北市','淡水區'),(5,'466910','鞍部','臺北市','北投區'),(6,'466930','竹子湖','臺北市','北投區'); /*!40000 ALTER TABLE `location` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `weather` -- DROP TABLE IF EXISTS `weather`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `weather` ( `id` bigint(11) NOT NULL AUTO_INCREMENT, `station_id` varchar(10) NOT NULL, `ELEV` decimal(6,2) NOT NULL, `WDIR` int(11) NOT NULL, `WDSD` decimal(4,2) NOT NULL, `TEMP` decimal(3,1) NOT NULL, `HUMD` decimal(3,2) NOT NULL, `PRES` decimal(7,2) NOT NULL, `24R` decimal(7,2) NOT NULL, `H_FX` decimal(4,2) NOT NULL, `H_XD` int(11) NOT NULL, `H_FXT` varchar(5) NOT NULL, `H_F10` decimal(4,2) NOT NULL, `H_10D` int(11) NOT NULL, `H_F10T` varchar(5) NOT NULL, `H_UVI` decimal(4,2) NOT NULL, `D_TX` decimal(3,1) NOT NULL, `D_TXT` varchar(5) NOT NULL, `D_TN` decimal(3,1) NOT NULL, `D_TNT` varchar(5) NOT NULL, `D_TS` decimal(4,2) NOT NULL, `VIS` varchar(10) NOT NULL, `Weather` varchar(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `weather` -- LOCK TABLES `weather` WRITE; /*!40000 ALTER TABLE `weather` DISABLE KEYS */; INSERT INTO `weather` VALUES (1,'466880',11.00,70,2.70,19.4,0.79,1018.50,0.00,11.40,70,'1617',5.90,70,'1618',-99.00,24.3,'1033',17.9,'0532',2.50,'16-20','多雲'),(2,'466920',6.26,100,4.00,18.9,0.86,1016.40,0.00,11.50,140,'1609',4.80,110,'1657',0.18,23.5,'1158',18.5,'0647',1.90,'16-20','陰'),(3,'467050',20.60,50,8.10,18.6,0.81,1016.30,0.00,17.00,40,'1639',11.50,50,'1642',0.18,21.8,'1357',15.5,'0100',4.50,'無觀測','多雲'),(4,'466900',19.00,20,1.30,19.3,0.77,1017.40,0.00,9.20,10,'1628',3.60,30,'1608',0.16,23.5,'1229',15.9,'0043',1.90,'21-30','陰'),(5,'466910',832.60,80,2.60,12.3,1.00,-99.00,0.00,9.70,100,'1614',3.40,70,'1635',0.07,19.7,'1130',12.2,'1730',3.70,'<1','有霧'),(6,'466930',607.10,30,5.70,14.0,0.97,949.70,0.00,14.10,40,'1636',6.20,30,'1621',0.11,19.5,'0924',14.0,'1742',2.90,'>30','陰'); /*!40000 ALTER TABLE `weather` 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 2021-03-12 18:17:49
true
10483d83e8fbfb5a75049507162e247927581e28
SQL
noranuk0/tiny-fw
/sql/init.sql
UTF-8
277
2.78125
3
[]
no_license
create schema area; CREATE TABLE area.m_regions ( id serial, region_id integer unique not null, name text not null ); CREATE TABLE area.m_prefectures ( id serial, region_id integer not null, prefecture_id integer unique not null, name text not null );
true
74f6a5c2ba0e40531725eda42bb59f3668ade9aa
SQL
chenxy11/wx
/wx-master/src/main/resources/db/migration/V56__ADD_SOURCE_IMAGE_FONT.SQL
UTF-8
2,413
3.703125
4
[]
no_license
-- Create table create table SOURCE_IMAGE_FONT ( id VARCHAR2(64) not null, title VARCHAR2(2000), thumb_media_id VARCHAR2(64), author VARCHAR2(200), digest VARCHAR2(1000), show_cover_pic VARCHAR2(4), content BLOB, content_source_url VARCHAR2(200), del_flag VARCHAR2(4), local_url VARCHAR2(100), wx_url VARCHAR2(200), media_id VARCHAR2(200) ) tablespace USERS pctfree 10 initrans 1 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); -- Add comments to the table comment on table SOURCE_IMAGE_FONT is '图文消息表'; -- Add comments to the columns comment on column SOURCE_IMAGE_FONT.id is '主键'; comment on column SOURCE_IMAGE_FONT.title is '标题'; comment on column SOURCE_IMAGE_FONT.thumb_media_id is '图文消息的封面图片素材id(必须是永久mediaID)'; comment on column SOURCE_IMAGE_FONT.author is '作者'; comment on column SOURCE_IMAGE_FONT.digest is '单图文的摘要'; comment on column SOURCE_IMAGE_FONT.show_cover_pic is '是否显示封面,0为false,即不显示,1为true,即显示'; comment on column SOURCE_IMAGE_FONT.content is '图文消息的具体内容,支持HTML标签,必须少于2万字符,小于1M,且此处会去除JS'; comment on column SOURCE_IMAGE_FONT.content_source_url is '图文消息的原文地址,即点击“阅读原文”后的URL'; comment on column SOURCE_IMAGE_FONT.del_flag is '删除标识'; comment on column SOURCE_IMAGE_FONT.local_url is '本服务器的保存地址'; comment on column SOURCE_IMAGE_FONT.wx_url is '微信服务器的保存地址'; comment on column SOURCE_IMAGE_FONT.media_id is '微信服务器返回的media_id'; -- Create/Recreate primary, unique and foreign key constraints alter table SOURCE_IMAGE_FONT add constraint IMAGE_FONT_PRIMARY_KEY_ID primary key (ID) using index tablespace USERS pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); alter table SOURCE_IMAGE_FONT add constraint IMAGE_FONT_MEDIA_ID_UNIQUE_KEY unique (MEDIA_ID) using index tablespace USERS pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited );
true
d5c119abc7567ebc77f22f0cfb235ffca829e2fd
SQL
CityofToronto/bdit_volumes
/volume_project/flow_data_processing/data_cleanup/flag_anomalies.sql
UTF-8
3,231
4.15625
4
[]
no_license
-- Flag timestamps that share multiple counts -- 1445051 rows affected, 10:10 minutes execution time. UPDATE prj_volume.cnt_det_clean SET flag = 2 WHERE count_info_id IN (SELECT count_info_id FROM traffic.countinfo WHERE (arterycode, count_date) IN (SELECT DISTINCT arterycode, count_date FROM traffic.countinfo JOIN prj_volume.cnt_det_clean USING (count_info_id) GROUP BY arterycode, count_date, timecount::time, speed_class HAVING COUNT(count)>1)); -- Flag records that have <8h data -- 5262 rows affected UPDATE prj_volume.cnt_det_clean SET flag = 1 WHERE count_info_id IN (SELECT count_info_id FROM prj_volume.cnt_det_clean JOIN traffic.countinfo USING (count_info_id) GROUP BY count_info_id, speed_class HAVING COUNT(*) < 32); -- Flag hourly records (one entry for an hour, 0 volumes in other 15 min bins) -- 13248 rows affected UPDATE prj_volume.cnt_det_clean SET flag = 3 WHERE count_info_id IN (SELECT count_info_id FROM prj_volume.cnt_det_clean A JOIN traffic.countinfo B USING (count_info_id) WHERE category_id NOT IN (3,4) GROUP BY arterycode, count_date, count_info_id HAVING (SUM(CASE WHEN count <> 0 THEN 0 ELSE 1 END)/SUM(CASE WHEN count <> 0 THEN 1 ELSE 0 END))::int = 3 AND (SELECT COUNT(distinct EXTRACT(hour from timecount)) FROM prj_volume.cnt_det_clean JOIN traffic.countinfo USING (count_info_id) WHERE arterycode = B.arterycode AND count_date = B.count_date AND count <> 0) = SUM(CASE WHEN count = 0 THEN 0 ELSE 1 END)); -- Flag daily volumes (exceeds specified cap for the road class) -- 39440 rows affected UPDATE prj_volume.cnt_det_clean SET flag = 4 WHERE count_info_id IN (SELECT count_info_id FROM (SELECT count_info_id, feature_code, feature_code_desc, SUM(count), linear_name_full, centreline_id, (CASE feature_code_desc WHEN 'Expressway' THEN 120000 WHEN 'Expressway Ramp' THEN 61050 WHEN 'Major Arterial' THEN 70000 WHEN 'Major Arterial Ramp' THEN 25000 WHEN 'Minor Arterial' THEN 22750 WHEN 'Collector' THEN 20000 WHEN 'Local' THEN 9000 WHEN 'Laneway' THEN 600 END) AS cap FROM prj_volume.cnt_det_clean JOIN traffic.countinfo USING (count_info_id) JOIN prj_volume.artery_tcl USING (arterycode) JOIN prj_volume.centreline USING (centreline_id) WHERE flag IS NULL GROUP BY count_info_id, feature_code, feature_code_desc, linear_name_full, centreline_id HAVING MOD(COUNT(count),96) = 0) A WHERE sum > cap) ; -- Flag abnormal daily volumes (+/- 2 stdevs from median) -- 3869643 rows affected, 16:53 minutes execution time. UPDATE prj_volume.cnt_det_clean SET flag = 5 WHERE count_info_id IN (SELECT count_info_id FROM (SELECT arterycode, count_info_id, SUM(count) FROM prj_volume.cnt_det_clean JOIN traffic.countinfo USING (count_info_id) WHERE flag IS NULL GROUP BY count_info_id, arterycode HAVING MOD(COUNT(count),96) = 0) A JOIN (SELECT arterycode, median(sum), stddev(sum) FROM (SELECT count_info_id, arterycode, SUM(count) FROM prj_volume.cnt_det_clean JOIN traffic.countinfo USING (count_info_id) GROUP BY count_info_id, arterycode) C GROUP BY arterycode HAVING count(sum) > 10) D USING (arterycode) WHERE sum < (median - 2*stddev) OR sum > (median + 2*stddev));
true
37aa6c567033a13de1c45f1cc43f1404883d504a
SQL
ToniJRod/CreativeCakes
/creativecakes.sql
UTF-8
2,071
3.03125
3
[]
no_license
CREATE DATABASE `pies` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE `pies`; CREATE TABLE IF NOT EXISTS `products` ( `sku` int(11) DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `img` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `products` (`sku`, `name`, 'description', `img`, `price`) VALUES(101, 'Cherry Pie', 'A delicious blend of Montmorency cherries in our flaky crust.','img/cherry.jpg', 12.00); INSERT INTO `products` (`sku`, `name`, 'description', `img`, `price`) VALUES(102, 'Banana Cream Pie', 'Loaded with hand-sliced bananas and topped with real whipped cream.','img/bananacream.jpg', 12.00); INSERT INTO `products` (`sku`, `name`, 'description', `img`, `price`) VALUES(103, 'Chocolate Cream Pie', 'Creamy chocolate topped with real whipped cream and dark chocolate curls.','img/chocolate.jpg', 12.00); ______________________________________________ USE `tonrod3_cakes`; CREATE TABLE IF NOT EXISTS `products` ( `sku` int(11) DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `img` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `products` (`sku`, `name`, `description`, `img`, `price`) VALUES(101, 'Cherry Pie', 'A delicious blend of Montmorency cherries in our flaky crust.','img/cherry.jpg', 12.00); INSERT INTO `products` (`sku`, `name`, `description`, `img`, `price`) VALUES(102, 'Banana Cream Pie', 'Loaded with hand-sliced bananas and topped with real whipped cream.','img/bananacream.jpg', 13.00); INSERT INTO `products` (`sku`, `name`, `description`, `img`, `price`) VALUES(103, 'Chocolate Cream Pie', 'Creamy chocolate topped with real whipped cream and dark chocolate curls.','img/chocolate.jpg', 15.00);
true
b14b74078026b281142f23ec0166aa6a7d5dc46b
SQL
fprp/sql-hospital
/SQL-PL/Checklist/checklist27.sql
UTF-8
335
3.21875
3
[]
no_license
--Checklist 27 Pacientes que tem o mesmo nome do seu medico com o respectivo nome e pacientes q tem nome diferente do seu medico,como nenhum paciente tem nome igual ao medico, não vai mostrar nenhum medico select paciente.cpfpaciente, medico.nomemedico from paciente left outer join medico on paciente.nomepaciente = medico.nomemedico
true
87c0c2d542b38847da8f0b67f660db3a5311cbb8
SQL
joynara86/FindSorts
/findsports.sql
UTF-8
1,278
2.96875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 19-Nov-2017 às 02:51 -- Versão do servidor: 5.6.17 -- PHP Version: 5.5.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `findsports` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `login` varchar(120) NOT NULL, `senha` varchar(255) NOT NULL, `nome` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `login` (`login`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Extraindo dados da tabela `users` -- INSERT INTO `users` (`id`, `login`, `senha`, `nome`) VALUES (1, 'jon', '1234', 'João Pedro A'), (2, 'uli', '123', 'ulisses alves'); /*!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
65ab9be4f0105f3659f2d722a5bb426baafe8a9d
SQL
tchellosan/PL-SQL
/plsql_13_function_date3.sql
UTF-8
680
3.34375
3
[]
no_license
clear scr; set serveroutput on; declare wsessiontimezone varchar2(10) default sessiontimezone; wcurrent_date date default current_date; wsysdate date default sysdate; begin dbms_output.put_line('Fuso horário : ' || wsessiontimezone); dbms_output.put_line('Data local : ' || wcurrent_date); dbms_output.put_line('Data servidor : ' || wsysdate); dbms_output.put_line('last_day : ' || last_day(wsysdate)); dbms_output.put_line('Round : ' || round(to_date('05/08/2020'), 'year')); dbms_output.put_line('trunc : ' || trunc(to_date('05/08/2020'), 'year')); exception when others then dbms_output.put_line(sqlerrm(sqlcode)); end; /
true
10f411e85f19bf6a47189013710321e599b5f23a
SQL
pok1800/Navision-SQL-Queries
/Sql/ProductQuery.sql
UTF-8
940
3.78125
4
[ "MIT" ]
permissive
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT I.No_ AS ITEM_ID, I.No_ AS PRODUCT_CODE, I.Description AS DESCRIPTION, IC.Description AS CATEGORY, I.[Base Unit of Measure] AS UNIT_OF_MEASURE, CONVERT(CHAR(19), I.[Created Datetime], 121) AS DATE_CREATED, CONVERT( CHAR(19), DATETIMEFROMPARTS( DATEPART(YEAR, I.[Last Date Modified]), DATEPART(MONTH, I.[Last Date Modified]), DATEPART(DAY, I.[Last Date Modified]), DATEPART(HOUR, I.[Last Time Modified]), DATEPART(MINUTE, I.[Last Time Modified]), DATEPART(SECOND, I.[Last Time Modified]), DATEPART(MILLISECOND, I.[Last Time Modified])), 121) AS DATE_LAST_MODIFIED FROM dbo.[Navision Company$Item] AS I LEFT OUTER JOIN dbo.[Navision Company$Item Category] AS IC ON I.[Item Category Code] = IC.Code;
true
18d6e2d82c56e3fa5ca11b5a511d728e6ff1714c
SQL
liangsu/notes
/mysql/参数.sql
UTF-8
16,583
3.109375
3
[]
no_license
-- 系统表空间的大小,autoextend表示容量不够则自动增长 show variables like '%innodb_data_file_path%'; -- 系统表空间每次增长多少M show variables like '%innodb_autoextend_increment%'; -- innodb能识别的目录 show variables like '%innodb_directories%'; show variables like '%innodb_data_home_dir%'; show variables like '%datadir%'; -- undo表空间目录 show variables like '%innodb_undo_directory%'; -- 每个undo表空间或者临时表空间的回滚段的大小,默认值128,最大值128 show variables like '%innodb_rollback_segments%'; -- 是否自动截断undo表空间 show variables like '%innodb_undo_log_truncate%'; -- undo表空间的最大大小,超过这个大小,如果自动截断undo表空间打开了,会触发自动截断表空间。默认值1073741824 bytes (1024 MiB) show variables like '%innodb_max_undo_log_size%'; -- undo表空间的文件数量,这样每个回滚段可以平均的分配到几个文件中。 show variables like '%innodb_undo_tablespaces%'; -- purge线程查询undo表空间去截断的频率:每次多少次? SELECT @@innodb_purge_rseg_truncate_frequency; -- 临时表空间的路径,默认:#innodb_temp show variables like '%innodb_temp_tablespaces_dir%'; -- 8.0以前的版本:内部临时表使用的存储引擎 show variables like '%internal_tmp_disk_storage_engine%'; -- bool buffer在磁盘上的映射 show variables like '%innodb_doublewrite%'; -- 设置redo log的日志大小 show variables like '%innodb_log_file_size%'; -- 设置redo log日志的数量 show variables like '%innodb_log_files_in_group%'; -- redo log日志归档目录,格式:label:path1;path2,label是归档目录名称,需要唯一 show variables like '%innodb_redo_log_archive_dirs%'; show variables like '%innodb_lock_wait_timeout%'; -- 是否启用死锁检测 show variables like '%innodb_deadlock_detect%'; -- 查看innodb的版本 show variables like '%innodb_version%'; -- 查看innodb读写线程的数量 show variables like '%innodb_%io_thread%'; -- 查看innodb的清理undo log的线程数量。 show variables like '%innodb_purge_threads%'; -- 查看innodb的缓冲池实例的个数,在缓冲池大小在1G以上这个参数才生效 show variables like '%innodb_buffer_pool_instances%'; -- 缓冲池的大小 show variables like '%innodb_buffer_pool_size%'; -- 查看innodb LRU列表中old列表的占比,默认37%(差不多3/8) show variables like '%innodb_old_blocks_pct%'; -- LRU中多少次将old列表中的数据移入new列表 show variables like '%innodb_old_blocks_time%'; -- 控制LRU中可用页的数量 show variables like '%innodb_lru_scan_depth%'; -- 当buffer pool中脏页数量占比达到多少时强制执行checkpoint show variables like '%innodb_max_dirty_pages_pct%'; -- 合并插入缓冲的数量= innodb_io_capacity * 5%,刷新脏页的数量=innodb_io_capacity show variables like '%innodb_io_capacity%'; -- 每次full purge时回收undo log页的数量 show variables like '%innodb_purge_batch_size%'; -- 是否启用自适应刷新脏页,通过判断redo log的速度来决定刷新脏页的数量 show variables like '%innodb_adaptive_flushing%'; -- change buffer最大使用内存占缓冲池的百分比,该参数的最大有效值50 show variables like '%innodb_change_buffer_max_size%'; -- 开启buffer的选项,可选参数:inserts、deletes、purges、changes、all、none show variables like '%innodb_change_buffering%'; -- 刷新邻接页 show variables like '%innodb_flush_neighbors%'; -- 关闭参数 show variables like '%innodb_fast_shutdown%'; -- 启动恢复策略,可选范围:0-6, show variables like '%innodb_force_recovery%'; -- 设置参数的语法: select @@session.read_buffer_size; set @@global.long_query_time = 1; set @@global.long_query_time = 1; -- 查看错误日志的位置 show variables like '%log_error%'; -- 慢查询日志的时间阈值,默认10秒 show variables like '%long_query_time%'; -- 超过最小检查行数的sql,记录慢查询日志 show variables like '%min_examined_row_limit%'; -- 是否开启慢查询日志 show variables like '%slow_query_log%'; -- 慢查询日志位置 show variables like '%slow_query_log_file%'; -- 是否记录管理sql语句的慢查询日志,包括:ALTER TABLE, ANALYZE TABLE, CHECK TABLE, CREATE INDEX, DROP INDEX, OPTIMIZE TABLE, and REPAIR TABLE show variables like '%log_slow_admin_statements%'; -- 如果是从库,复制数据的时候,是否将慢sql记录slow log。只有基于sql语句的复制或者混合复制才会记录慢查询日志。 show variables like '%log_slow_slave_statements%'; -- 执行的sql如果没有使用索引,会将sql记录到慢查询日志 show variables like '%log_queries_not_using_indexes%'; -- 每分钟记录到slow log且未使用索引的sql的语句次数,默认值0,表示没有限制。 show variables like '%log_throttle_queries_not_using_indexes%'; -- 慢查询日志输出到文件还是表 show variables like '%log_output%'; -- 慢查询日志中是否输出额外的统计信息 show variables like '%log_slow_extra%'; -- 是否启用查询日志 show variables like '%general_log%'; set global general_log = 1; select * from mysql.slow_log; show master status; -- 42843959 42844282 show binlog events in 'mysql-bin.000032'; -- binlog单个日志文件的最大值,默认值1073741824(1G),单位:byte show variables like '%max_binlog_size%'; -- 未提交的二进制日志会记录到缓冲中,缓冲大小有这个参数确定,这个缓冲是每个会话一个缓冲。 show variables like '%binlog_cache_size%'; -- 每写缓冲多少次就同步到磁盘 show variables like '%sync_binlog%'; -- 如果当前数据库是复制中的slave,则它不会将从master获取的binlog写入到自己的binlog中去,若需要,则需要开启该参数,在master->slave->slave中需要。 show variables like '%log_slave_update%'; -- binlog记录的格式,可选值:STATEMENT、ROW、MIXED show variables like '%binlog_format%'; -- socket链接文件 show variables like '%socket%'; -- 进程文件 show variables like '%pid_file%'; -- 是否开启独立表空间 show variables like '%innodb_file_per_table%'; -- mysql将数据页读入内存后,会将页中的pageHeader与file Trailer中做校验,判断该页是否完整。 show variables like '%innodb_checksum_algorithm%'; -- show variables like '%par%'; -- 查看分区信息 select * from information_schema.`PARTITIONS` where table_schema = database(); -- 查看表的行格式、等信息 show table status like 'employees'; -- 手动配置redo log归档:当写很频繁的时候,redo log的修改速度远远大于备份的速度,需要将redo log归档。subdir可选参数,归档的子目录名称 SELECT innodb_redo_log_archive_start('label', '。'); -- 查看innodb中,buffer pool的命中率、每秒pages_made_young的次数 select pool_id, hit_rate, pages_made_young, pages_not_made_young from information_schema.INNODB_BUFFER_POOL_STATS; -- 查看每个lru列表中每页的信息 select * from information_schema.INNODB_BUFFER_PAGE_LRU where space = 19; -- 查看每个unzip_lru列表中每页的信息 select * from information_schema.INNODB_BUFFER_PAGE_LRU where compressed_size <> 0; -- 脏页 select table_name, space, page_number, page_type from information_schema.INNODB_BUFFER_PAGE_LRU where oldest_modification > 0; -- 1. 查询文件与表空间的关系 select * from INFORMATION_SCHEMA.FILES WHERE FILE_TYPE LIKE 'UNDO LOG' -- 监控表空间的状态 SELECT NAME, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES WHERE NAME LIKE '%%'; CREATE UNDO TABLESPACE undo2 ADD DATAFILE 'file_name.ibu'; SELECT * FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE LIKE 'UNDO LOG'; CREATE TABLESPACE `ts1` ADD DATAFILE 'E:\\Tools\\mysql-8.0.21-winx64\\data2\\ts1.ibd' Engine=InnoDB; CREATE TABLESPACE `ts2` Engine=InnoDB; show engine innodb status; ALTER TABLE test TABLESPACE ts1 ALTER TABLE test TABLESPACE=innodb_file_per_table; -- python C:/Users/Administrator/Desktop/mysql/david-mysql-tools/trunkvpy_innodb_page_type/py_innodb_page_info.py E:\\Tools\\mysql-8.0.21-winx64\\data\\tpcc_big\\customer.ibd -- 查看latch信息 show engine innodb mutex; show full PROCESSLIST; -- select * from information_schema.innodb_trx; select * from information_schema.innodb_locks; select * from information_schema.INNODB_lock_waits; -- mysql 8.0之后查看锁、等待的信息 select * from `performance_schema`.data_locks; select * from `performance_schema`.data_lock_waits; SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM performance_schema.data_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_engine_transaction_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_engine_transaction_id; -- 定位一个阻塞的会话,是被哪些sql阻塞了 -- 查询 select waiting_pid from sys.innodb_lock_waits; -- 查询阻塞的thread_id select * from `performance_schema`.threads where processlist_id = 10; -- 查询这个线程当前执行的sql SELECT THREAD_ID, SQL_TEXT FROM performance_schema.events_statements_current WHERE THREAD_ID = 52; -- 查询这个线程曾经执行的sql SELECT THREAD_ID, SQL_TEXT FROM performance_schema.events_statements_history WHERE THREAD_ID = 52 ORDER BY EVENT_ID; -- 超时等待时间 show variables like '%innodb_lock_wait_timeout%'; -- 是否在超时的时候对事务进行回滚 show variables like '%innodb_rollback_on_timeout%'; set @@GLOBAL.innodb_lock_wait_timeout = 5 show engine innodb status; select @@tx_isolation show variables like '%transaction_isolation%'; drop table t; create table t ( a int primary key ); select * from t; insert into t select 1; insert into t select 2; insert into t select 4; drop table z; create table z ( a int primary key, b int, c varchar(10), d varchar(20) ); show index from z; select * from z; insert into z select 1, 1, '1', '1'; insert into z select 2, 2, '2', '2'; insert into z select 3, 3, '3', '3'; delete from z; create table z( a int primary key, b int, c int, key (b) ); insert into z select 1, 1, 1; insert into z select 2, 2, 2; insert into z select 3, 3, 3; ------------------------------------------------------------------------------------------------ drop table tast_load; create table tast_load( a int , b char(80) )engine = innodb; drop PROCEDURE if exists p_load; DELIMITER // create PROCEDURE p_load(count int UNSIGNED) begin DECLARE s int unsigned DEFAULT 1; DECLARE c char(80) DEFAULT repeat('a', 80); while s <= count do insert into tast_load select null, c; commit; set s = s + 1; end while; end; // DELIMITER; call p_load(1000); /* 插入1000条数据 innodb_flush_log_at_trx_commit值 机械硬盘 固态硬盘 -- 0: 37.784s 34.903s -- 1: 64.993s 58.491s -- 2: 33.384s 27.192s */ select * from tast_load; truncate table tast_load; select count(*) from tast_load; show variables like '%innodb_flush_log_at_trx_commit%'; start TRANSACTION; select * from employees_test; start TRANSACTION; update employees_test set last_name = 'bb'; ROLLBACK; commit; select * from tast_load; select * from information_schema.innodb_trx_rollback_segment; -- 每次purge操作时,清理undo page的数量 show variables like '%innodb_purge_batch_size%'; -- 用来控制history list的长度,0表示不做限制。当history list的长度大于innodb_max_purge_lag时,会延缓dml操作。 -- History list表示事务提交的顺序组织undo log,先提交的事务在尾端。 -- 延缓算法: delay = (length(history_list) - innodb_max_purge_lag) * 10 - 5。 -- 如果一条dml操作更新了5条数据,则延缓时间 = delay * 5 show variables like '%innodb_max_purge_lag%'; -- 最大延迟时间,上面步骤计算出来的delay如果超过该值,则取该值 show variables like '%innodb_max_purge_lag_delay%'; -- flush阶段等待的时间 show variables like '%binlog_max_flush_queue_time%'; show variables like '%binlog%'; -- tps计算: (com_commit + com_rollback) / time -- 事务提交次数 show global status like 'com_commit'; -- 事务回滚次数 show global status like 'com_rollback'; -- show global status like 'handler_commit'; -- show global status like 'handler_rollback'; -- 数据库的隔离级别 show variables like '%transaction_isolation%'; xa start 'b'; insert into t select 3; xa end 'b'; xa prepare 'b'; xa RECOVER; xa commit 'b'; xa ROLLBACK 'b'; select * from t; show index from salaries -- 重新计算表的cardinalitiy analyze table t; select @@version; -- 创建和删除索引的默认算法,off: inplace算法、on:copy算法(使用临时表) show variables like '%old_alter_table%'; -- 索引在创建过程中,执行的dml操作会放入一个缓存,缓存的大小由该值决定。如果创建索引过程中加share锁,则不会发生写操作 show variables like '%innodb_online_alter_log_max_size%'; -- mysql8之前的参数,统计cardinality值时,每次采样页的数量 show variables like '%innodb_stats_sample_pages%'; -- 如何对待索引中出现null值记录。nulls_equal:将null值记录视为相等的记录、nulls_unequal:将null值记录视为不通的记录、nulls_ignored:忽略null值记录。 show variables like '%innodb_stats_method%'; -- 是否将analyze table命令计算的cardiality存放到磁盘上。 show variables like '%innodb_stats_persistent%'; -- 在执行show table status、show index及访问infomation_schema架构下的表的tables和statistic时,是否重新计算索引的cardinality的值 show variables like '%innodb_stats_on_metadata%'; -- innodb_stats_persistent为on时,执行analyze table采样页的数量 show variables like '%innodb_stats_persistent_sample_pages%'; -- 采样页的数量,用于取代innodb_stats_sample_pages show variables like '%innodb_stats_transient_sample_pages%'; set @@global.innodb_stats_persistent = off; ------------------------------------------------------------------------------------------------ -- show variables like '%optimizer_switch%'; -- mrr为on,表示启用multi-Range read。mrr_cost_based表示是否通过cost based的方式启用mrr优化。 -- 如果mrr=on,mrr_cost_based=off,则表示一直启用mrr优化 set @@optimizer_switch = 'mrr=on,mrr_cost_based=off'; -- 启用mrr时的缓冲区大小,当大于该值时,则执行器对已经缓存的数据根据rowId排序,并通过rowId来取得行数据。 show variables like '%read_rnd_buffer_size%'; set @@optimizer_switch = 'mrr=on,mrr_cost_based=off'; -- 下面语句在启用mrr,和没有启用mrr的性能对比 -- off 21.298 -- on 0.793 explain select * from salaries where salary > 10000 and salary < 40000; -- explain extra 值说明: -- Using MRR 启用multi-Range read优化 -- Using index condition: 使用了index condition pushdown优化,将索引的过滤条件从服务层下推到存储引擎层 -- Using where: -- Using index: 使用覆盖索引 -- Using filesort: 需要使用额外的一次排序 -- Using temporary 表示MySQL需要使用临时表来存储结果集,常见于排序和分组查询,常见 group by ; order by -- -- index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=off,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on ------------------------------------------------------------------------------------------------ show variables like '%optimizer_trace%'; -- 开启 set @@session.optimizer_trace="enabled=on,one_line=on"; SET PROFILING = 1 -- 执行sql -- 查看日志信息 select * from information_schema.OPTIMIZER_TRACE; -- 关闭 set optimizer_trace="enabled=off"; explain select * from salaries where salary > 10000 and salary < 40000; set optimizer_trace="enabled=on"; set optimizer_trace_limit = 10; set @@session.optimizer_trace="enabled=on,one_line=on"; select * from information_schema.OPTIMIZER_TRACE;
true
d4677d908562dc853b099b1b31285936948be904
SQL
DoNotErase/GoalSquad
/database-mysql/data.sql
UTF-8
11,954
3.296875
3
[]
no_license
CREATE TABLE IF NOT EXISTS `egg` ( `egg_id` int(11) NOT NULL AUTO_INCREMENT, `egg_name` varchar(255) NOT NULL, PRIMARY KEY (`egg_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `goal` ( `goal_id` int(11) NOT NULL AUTO_INCREMENT, `goal_name` varchar(255) NOT NULL, `goal_activity` varchar(50) NOT NULL, `goal_amount` int(11) NOT NULL, `goal_difficulty` varchar(50) NOT NULL, `goal_class` varchar(50) NOT NULL, `goal_points` varchar(50) NOT NULL, `goal_timedivisor` int(11) NOT NULL, PRIMARY KEY (`goal_id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `monster` ( `monster_id` int(11) NOT NULL AUTO_INCREMENT, `monster_name` varchar(255) NOT NULL, `monster_pic` varchar(255) DEFAULT NULL, `monster_icon` varchar(255) DEFAULT NULL, `monster_description` varchar(255) DEFAULT NULL, `monster_sound` varchar(255) DEFAULT NULL, PRIMARY KEY (`monster_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `fitbit_id` varchar(255) DEFAULT NULL, `user_username` varchar(255) NOT NULL, `user_password` varchar(255) DEFAULT NULL, `user_accesstoken` varchar(255) DEFAULT NULL, `user_refreshtoken` varchar(255) DEFAULT NULL, `user_level` int(11) NOT NULL DEFAULT '1', `user_current_xp` int(11) NOT NULL DEFAULT '0', `user_total_points` int(11) NOT NULL DEFAULT '0', `custom_goal_timer_1` varchar(255) DEFAULT NULL, `custom_goal_timer_2` varchar(255) DEFAULT NULL, `notified_of_push_notifications` bool default 0, `wants_push_notifications` bool default 0, `unsubscribed_from_notifications` bool default 0, `role` varchar (30) default null, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `user_egg` ( `user_egg_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `egg_id` int(11) NOT NULL, `egg_xp` int(11) NOT NULL DEFAULT '0', `egg_hatched` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`user_egg_id`), KEY `user_id` (`user_id`), KEY `egg_id` (`egg_id`), CONSTRAINT `user_egg_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`), CONSTRAINT `user_egg_ibfk_2` FOREIGN KEY (`egg_id`) REFERENCES `egg` (`egg_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `user_goal` ( `user_goal_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `goal_id` int(11) NOT NULL, `user_goal_start_value` int(11) DEFAULT NULL, `user_goal_current` int(11) DEFAULT NULL, `user_goal_target` int(11) DEFAULT NULL, `user_goal_start_date` datetime DEFAULT CURRENT_TIMESTAMP, `user_goal_end_date` datetime DEFAULT NULL, `user_goal_finalized` tinyint(1) DEFAULT '0', `user_goal_success` tinyint(1) DEFAULT '0', `user_goal_concluded` tinyint(1) DEFAULT '0', `user_goal_points` int(11) DEFAULT NULL, PRIMARY KEY (`user_goal_id`), KEY `user_id` (`user_id`), KEY `goal_id` (`goal_id`), CONSTRAINT `user_goal_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`), CONSTRAINT `user_goal_ibfk_2` FOREIGN KEY (`goal_id`) REFERENCES `goal` (`goal_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `user_monster` ( `user_monster_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `monster_id` int(11) NOT NULL, `user_monster_level` int(11) NOT NULL DEFAULT '1', `user_monster_new_name` varchar(255) DEFAULT NULL, `user_monster_attack` int(11) DEFAULT NULL, `user_monster_defense` int(11) DEFAULT NULL, `user_monster_current_xp` int(11) DEFAULT NULL, PRIMARY KEY (`user_monster_id`), KEY `user_id` (`user_id`), KEY `monster_id` (`monster_id`), CONSTRAINT `user_monster_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`), CONSTRAINT `user_monster_ibfk_2` FOREIGN KEY (`monster_id`) REFERENCES `monster` (`monster_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; INSERT INTO `egg` (`egg_id`,`egg_name`) VALUES (1,'scuttlebutt_egg'); INSERT INTO `egg` (`egg_id`,`egg_name`) VALUES (2,'pruny_egg'); INSERT INTO `egg` (`egg_id`,`egg_name`) VALUES (3,'bard_egg'); INSERT INTO `egg` (`egg_id`,`egg_name`) VALUES (4,'squaggle_egg'); INSERT INTO `egg` (`egg_id`,`egg_name`) VALUES (5,'kow_egg'); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (1,'Run 1 mile','distance',1,'easy','short','5',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (2,'Run 2 miles','distance',2,'med','short','10',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (3,'Run 5 miles','distance',5,'hard','short','20',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (4,'Run 10 miles','distance',10,'easy','long','50',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (5,'Run 25 miles','distance',25,'med','long','75',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (6,'Run 50 miles','distance',50,'hard','long','100',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (7,'Walk 2,000 steps','steps',2000,'easy','short','5',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (8,'Walk 4,000 steps','steps',4000,'med','short','10',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (9,'Walk 10,000 steps','steps',10000,'hard','short','20',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (10,'Walk 20,000 steps','steps',20000,'easy','long','50',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (11,'Walk 50,000 steps','steps',50000,'med','long','75',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (12,'Walk 100,000 steps','steps',100000,'hard','long','100',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (13,'Climb 3 stairs','floors',3,'easy','short','5',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (14,'Climb 5 stairs','floors',5,'med','short','10',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (15,'Climb 20 stairs','floors',20,'hard','short','20',2); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (16,'Climb 40 stairs','floors',40,'easy','long','50',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (17,'Climb 100 stairs','floors',100,'med','long','75',24); INSERT INTO `goal` (`goal_id`,`goal_name`,`goal_activity`,`goal_amount`,`goal_difficulty`,`goal_class`,`goal_points`,`goal_timedivisor`) VALUES (18,'Climb 200 stairs','floors',200,'hard','long','100',24); INSERT INTO `monster` (`monster_id`,`monster_name`,`monster_pic`,`monster_icon`,`monster_description`,`monster_sound`) VALUES (1,'Scuttlebutt','./assets/squaddies/scuttlebutt.png','./assets/squaddies/scuttlebutt-icon.png','This is a sample description of Scuttlebutt.',NULL); INSERT INTO `monster` (`monster_id`,`monster_name`,`monster_pic`,`monster_icon`,`monster_description`,`monster_sound`) VALUES (2,'Pruny','./assets/squaddies/pruny.png','./assets/squaddies/pruny-icon.png','This is a sample description of Pruny.',NULL); INSERT INTO `monster` (`monster_id`,`monster_name`,`monster_pic`,`monster_icon`,`monster_description`,`monster_sound`) VALUES (3,'Bard','./assets/squaddies/bard.png','./assets/squaddies/bard-icon.png','This is a sample description of Bard.',NULL); INSERT INTO `monster` (`monster_id`,`monster_name`,`monster_pic`,`monster_icon`,`monster_description`,`monster_sound`) VALUES (4,'Squaggle','./assets/squaddies/squaggle.png','./assets/squaddies/squaggle-icon.png','This is a sample description of Squaggle.',NULL); INSERT INTO `monster` (`monster_id`,`monster_name`,`monster_pic`,`monster_icon`,`monster_description`,`monster_sound`) VALUES (5,'Kow','./assets/squaddies/kow.png','./assets/squaddies/kow-icon.png','This is a sample description of Kow.',NULL); INSERT INTO `user` (`user_id`,`fitbit_id`,`user_username`,`user_password`,`user_accesstoken`,`user_refreshtoken`,`user_level`,`user_current_xp`,`user_total_points`,`custom_goal_timer_1`,`custom_goal_timer_2`) VALUES (1,'3XP8GJ','mickey',NULL,NULL,NULL,1,0,0,NULL,NULL); INSERT INTO `user_egg` (`user_egg_id`,`user_id`,`egg_id`,`egg_xp`,`egg_hatched`) VALUES (1,1,2,0,0); INSERT INTO `user_goal` (`user_goal_id`,`user_id`,`goal_id`,`user_goal_start_value`,`user_goal_current`,`user_goal_target`,`user_goal_start_date`,`user_goal_end_date`,`user_goal_finalized`,`user_goal_success`,`user_goal_concluded`,`user_goal_points`) VALUES (1,1,2,NULL,NULL,20,'2018-03-26 10:27:26.000','2018-03-20 00:00:00.000',0,0,0,20); INSERT INTO `user_goal` (`user_goal_id`,`user_id`,`goal_id`,`user_goal_start_value`,`user_goal_current`,`user_goal_target`,`user_goal_start_date`,`user_goal_end_date`,`user_goal_finalized`,`user_goal_success`,`user_goal_concluded`,`user_goal_points`) VALUES (2,1,14,NULL,NULL,6000,'2018-03-26 10:27:26.000','2018-03-21 00:00:00.000',0,0,0,25); INSERT INTO `user_goal` (`user_goal_id`,`user_id`,`goal_id`,`user_goal_start_value`,`user_goal_current`,`user_goal_target`,`user_goal_start_date`,`user_goal_end_date`,`user_goal_finalized`,`user_goal_success`,`user_goal_concluded`,`user_goal_points`) VALUES (3,1,9,NULL,NULL,30000,'2018-03-26 10:27:26.000','2018-03-22 00:00:00.000',0,0,0,30); INSERT INTO `user_goal` (`user_goal_id`,`user_id`,`goal_id`,`user_goal_start_value`,`user_goal_current`,`user_goal_target`,`user_goal_start_date`,`user_goal_end_date`,`user_goal_finalized`,`user_goal_success`,`user_goal_concluded`,`user_goal_points`) VALUES (4,1,3,NULL,NULL,2000,'2018-03-26 10:27:26.000','2018-03-23 00:00:00.000',0,0,0,5); INSERT INTO `user_goal` (`user_goal_id`,`user_id`,`goal_id`,`user_goal_start_value`,`user_goal_current`,`user_goal_target`,`user_goal_start_date`,`user_goal_end_date`,`user_goal_finalized`,`user_goal_success`,`user_goal_concluded`,`user_goal_points`) VALUES (5,1,5,NULL,NULL,5000,'2018-03-26 10:27:26.000','2018-03-24 00:00:00.000',0,0,0,40); INSERT INTO `user_goal` (`user_goal_id`,`user_id`,`goal_id`,`user_goal_start_value`,`user_goal_current`,`user_goal_target`,`user_goal_start_date`,`user_goal_end_date`,`user_goal_finalized`,`user_goal_success`,`user_goal_concluded`,`user_goal_points`) VALUES (6,1,12,NULL,NULL,376800,'2018-03-26 10:27:26.000','2018-03-25 00:00:00.000',0,0,0,60); INSERT INTO `user_monster` (`user_monster_id`,`user_id`,`monster_id`,`user_monster_level`,`user_monster_new_name`,`user_monster_attack`,`user_monster_defense`,`user_monster_current_xp`) VALUES (1,1,2,1,NULL,NULL,NULL,NULL);
true
e8d811b3d1cefa3e3427d66caa6d2089e89a92b8
SQL
bandzarzewski/SQL_repo
/Dzien4_Baza_northwind.sql
UTF-8
699
3.46875
3
[]
no_license
SELECT orders.OrderID, customers.ContactName, orders.OrderDate FROM customers INNER JOIN orders ON orders.CustomerID = customers.CustomerID; SELECT customers.ContactName, orders.OrderID FROM orders LEFT JOIN customers ON customers.CustomerID = orders.CustomerID ORDER BY customers.ContactName; SELECT customers.ContactName, orders.OrderID FROM orders RIGHT JOIN customers ON customers.CustomerID = orders.CustomerID ORDER BY customers.ContactName; /* customers.ContactName, orders.OrderID FROM orders FULL JOIN customers ON customers.CustomerID = orders.CustomerID ORDER BY customers.ContactName;*/
true
0925a4778a09b76f57c0e289bef2f8be9eeef848
SQL
keco/PhotoSeshBooking
/conf/schema.sql
UTF-8
2,860
3.578125
4
[]
no_license
CREATE TABLE IF NOT EXISTS customer ( id BIGSERIAL PRIMARY KEY NOT NULL, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(30) NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(30) NOT NULL, pay_method VARCHAR(30) NOT NULL, balance NUMERIC NOT NULL ); ALTER SEQUENCE customer_id_seq RESTART WITH 41000; CREATE TABLE IF NOT EXISTS status ( id BIGSERIAL PRIMARY KEY NOT NULL, state VARCHAR(40) NOT NULL, description VARCHAR(255) ); CREATE TABLE IF NOT EXISTS booking ( id BIGSERIAL PRIMARY KEY NOT NULL, customer_id BIGINT NOT NULL, event_date TIMESTAMP, location VARCHAR(60), event_type VARCHAR(30), duration NUMERIC, price NUMERIC, total_amount_paid NUMERIC, payment NUMERIC, key_attendees VARCHAR(255), requirements VARCHAR(255), equipment VARCHAR(255), camera_settings VARCHAR(255), optimal_lighting_spots VARCHAR(255), status_id BIGINT NOT NULL, num_pics INT, num_selected INT, num_processed INT, review_notes VARCHAR(255), FOREIGN KEY ( customer_id ) REFERENCES customer ( id ), FOREIGN KEY ( status_id ) REFERENCES status ( id ) ); INSERT INTO status (state, description) VALUES ('CREATED', 'Customer contacted with a request for a photoshoot, initial details given'); INSERT INTO status (state, description) VALUES ('BOOKED', 'Both parties agreed on a photoshoot: event type, date, location, and amount are set - can be altered later'); INSERT INTO status (state, description) VALUES ('DOWNPAYMENT', 'Initial payment is collected'); INSERT INTO status (state, description) VALUES ('PREPARATION', 'Gathering requirements and key attendees, inspecting the location and making decisions regarding optimal lighting, equipment and camera settings'); INSERT INTO status (state, description) VALUES ('PHOTOSHOOT', 'Day of the event - from arriving at the location till uploading/backup all the images'); INSERT INTO status (state, description) VALUES ('PAYMENT', 'Payment is collected, prior to sending the final images'); INSERT INTO status (state, description) VALUES ('SELECTIONS', 'Making selects of images to be processed/edited'); INSERT INTO status (state, description) VALUES ('EDITING', 'Lightroom CC/Photoshop edits - depend on requirement and level of processing required'); INSERT INTO status (state, description) VALUES ('REVIEW', 'Processed images sent to customer for review. Can lead back to EDITING state'); INSERT INTO status (state, description) VALUES ('COMPLETE', 'Customer approved all edits, and balance is paid in full'); INSERT INTO status (state, description) VALUES ('CANCELED', 'Either party had to cancel - date is cleared, amount and customers balance might be affected'); INSERT INTO status (state, description) VALUES ('POSTPONED', 'Either party had to postpone - date, amount, balance might be affected, as well as camera/light settings');
true
fa8f9a7eb4336e062ce0f6372d7c11e0ffd4dba9
SQL
ardidagol/Package-Oracle
/2020/MKT/XXMKT_SEQUENCES.sql
UTF-8
3,236
3.421875
3
[]
no_license
--ALTER TABLE XXMKT.XXMKT_SEQUENCES -- DROP PRIMARY KEY CASCADE; -- --DROP TABLE XXMKT.XXMKT_SEQUENCES CASCADE CONSTRAINTS; CREATE TABLE XXMKT.XXMKT_SEQUENCES ( SEQ_TYPE_ID NUMBER NOT NULL, APPLICATION_SHORT_NAME VARCHAR2(50 BYTE) NOT NULL, SEQ_TYPE VARCHAR2(30 BYTE) NOT NULL, CURRENT_MONTH VARCHAR2(2 BYTE), CURRENT_YEAR NUMBER, LAST_VALUE NUMBER, ENABLED_FLAG VARCHAR2(1 BYTE) DEFAULT 'Y' NOT NULL, DESCRIPTION VARCHAR2(150 BYTE), ORG_ID NUMBER NOT NULL, CURRENT_FULL_DATE DATE, CREATED_BY NUMBER DEFAULT -1 NOT NULL, CREATION_DATE DATE DEFAULT SYSDATE NOT NULL, LAST_UPDATED_BY NUMBER DEFAULT -1 NOT NULL, LAST_UPDATE_DATE DATE DEFAULT SYSDATE NOT NULL, LAST_UPDATE_LOGIN NUMBER DEFAULT -1 NOT NULL, CURRENT_DAY VARCHAR2(2 BYTE) ) TABLESPACE APPS_TS_TX_DATA RESULT_CACHE (MODE DEFAULT) PCTUSED 0 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MAXSIZE UNLIMITED MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT ) LOGGING NOCOMPRESS NOCACHE NOPARALLEL MONITORING; CREATE UNIQUE INDEX XXMKT.XXMKT_SEQUENCES_PK ON XXMKT.XXMKT_SEQUENCES (SEQ_TYPE_ID) LOGGING TABLESPACE XXMKTX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MAXSIZE UNLIMITED MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT ) NOPARALLEL; CREATE UNIQUE INDEX XXMKT.XXMKT_SEQUENCES_U1 ON XXMKT.XXMKT_SEQUENCES (ORG_ID, ENABLED_FLAG, APPLICATION_SHORT_NAME, SEQ_TYPE, CURRENT_DAY, CURRENT_MONTH, CURRENT_YEAR, CURRENT_FULL_DATE) LOGGING TABLESPACE APPS_TS_TX_DATA PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K MAXSIZE UNLIMITED MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT ) NOPARALLEL; ALTER TABLE XXMKT.XXMKT_SEQUENCES ADD ( CONSTRAINT XXMKT_SEQUENCES_PK PRIMARY KEY (SEQ_TYPE_ID) USING INDEX XXMKT.XXMKT_SEQUENCES_PK ENABLE VALIDATE); GRANT ALTER, DELETE, INDEX, INSERT, REFERENCES, SELECT, UPDATE, ON COMMIT REFRESH, QUERY REWRITE, READ, DEBUG, FLASHBACK ON XXMKT.XXMKT_SEQUENCES TO APPS WITH GRANT OPTION;
true
3cc9a9beafffb2b0298fedc01718eee7ac61792b
SQL
Douglasmantovani/Exercicios-SQL
/1.2.exercicios-locadora/DDL.sql
UTF-8
972
3.296875
3
[]
no_license
Create database Locadora_Manha; use Locadora_Manha; create table Empresa ( idEmpresa int primary key identity, TituloEmpresa varchar(200)not null ); create table Marca( idMarca int primary key identity, TituloMarca VARCHAR(200)not null, ); CREATE TABLE Cliente ( idCliente int primary key identity, TituloCliente varchar(200)not null, CPF char(11)not null unique ); create table Modelo( idModelo int primary key identity, TituloModelo varchar(100) not null, idMarca int foreign key references Marca(idMarca) ); create table Veiculos( idVeiculo int primary key identity, Placa varchar(15) not null, idModelo int foreign key references Modelo(idModelo)not null, idEmpresa int foreign key references Empresa(idEmpresa)not null ); create table Aluguel ( idAluguel int primary key identity, DataIni Date not null, DataFim Date not null, idCliente int foreign key references Cliente(idCliente)not null, idVeiculo int foreign key references Veiculos(idVeiculo)not null );
true
4de0fa0c3a913bd9b94a3854e3dcf69e91b7e813
SQL
lanaflonPerso/IMIE
/BDD/TP2.sql
UTF-8
1,423
3.6875
4
[]
no_license
-- TP 2 DROP DATABASE IF EXISTS tp2; CREATE DATABASE IF NOT EXISTS tp2; USE tp2; CREATE TABLE IF NOT EXISTS client ( id BIGINT AUTO_INCREMENT, nom VARCHAR(120) NOT NULL, PRIMARY KEY(id) ) ENGINE=InnoDB; CREATE TABLE IF NOT EXISTS facture ( id BIGINT AUTO_INCREMENT, date_facture DATETIME NOT NULL, client_id BIGINT NOT NULL, magasin_id BIGINT NOT NULL, PRIMARY KEY(id) ) ENGINE=InnoDB; CREATE TABLE IF NOT EXISTS animal ( id BIGINT AUTO_INCREMENT, prix DECIMAL(10,2) NULL, motif_prix VARCHAR(255) NULL, reference VARCHAR(10) NULL, magasin_id BIGINT NOT NULL, espece_id BIGINT NOT NULL, facture_id BIGINT NULL, PRIMARY KEY(id) ) ENGINE=InnoDB; CREATE TABLE IF NOT EXISTS magasin ( id BIGINT AUTO_INCREMENT, nom VARCHAR(120) NOT NULL, PRIMARY KEY(id) ) ENGINE=InnoDB; CREATE TABLE IF NOT EXISTS espece ( id BIGINT AUTO_INCREMENT, nom VARCHAR(120) NOT NULL, PRIMARY KEY(id) ) ENGINE=InnoDB; ALTER TABLE facture ADD CONSTRAINT FK_facture_magasin FOREIGN KEY (magasin_id) REFERENCES magasin(id); ALTER TABLE facture ADD CONSTRAINT FK_facture_client FOREIGN KEY (client_id) REFERENCES client(id); ALTER TABLE animal ADD CONSTRAINT FK_animal_magasin FOREIGN KEY (magasin_id) REFERENCES magasin(id); ALTER TABLE animal ADD CONSTRAINT FK_animal_espece FOREIGN KEY (espece_id) REFERENCES espece(id); ALTER TABLE animal ADD CONSTRAINT FK_animal_facture FOREIGN KEY (facture_id) REFERENCES facture(id);
true
f32376bb5c6f5496abb84f21e8163cfed7e2ddd1
SQL
aruizcanton/ETLGenerator
/gen_creates_modelo_logico.sql
UTF-8
116,910
3
3
[ "Apache-2.0" ]
permissive
DECLARE /* (20150907) Angel Ruiz . NF: Se crea una tabla de metadato MTDT_MODELO_SUMMARY y otra MTDT_MODELO_DETAIL */ /* CURSOR QUE NOS DARA TODAS LAS TABLAS QUE HAY QUE CREAR */ CURSOR c_mtdt_modelo_logico_TABLA IS SELECT TRIM(TABLE_NAME) "TABLE_NAME", TRIM(TABLESPACE) "TABLESPACE", TRIM(CI) "CI", TRIM(PARTICIONADO) "PARTICIONADO" FROM MTDT_MODELO_SUMMARY WHERE TRIM(CI) <> 'P'; --AND TRIM(TABLE_NAME) LIKE '%_DEMO'; /* Las que poseen un valor "P" en esta columna son las tablas de PERMITED_VALUES, por lo que no hya que generar su modelo */ CURSOR c_mtdt_modelo_logico_COLUMNA (table_name_in IN VARCHAR2) IS SELECT TRIM(TABLE_NAME) "TABLE_NAME", TRIM(COLUMN_NAME) "COLUMN_NAME", DATA_TYPE, PK, TRIM(NULABLE) "NULABLE", TRIM(VDEFAULT) "VDEFAULT", TRIM(INDICE) "INDICE" FROM MTDT_MODELO_DETAIL WHERE trim(TABLE_NAME) = table_name_in ORDER BY POSITION; /* (20150907) Angel Ruiz . FIN NF: Se crea una tabla de metadato MTDT_MODELO_SUMMARY y otra MTDT_MODELO_DETAIL */ r_mtdt_modelo_logico_TABLA c_mtdt_modelo_logico_TABLA%rowtype; r_mtdt_modelo_logico_COLUMNA c_mtdt_modelo_logico_COLUMNA%rowtype; TYPE list_columns_primary IS TABLE OF VARCHAR(30); TYPE list_columns_indice IS TABLE OF VARCHAR(30); TYPE list_columns_par IS TABLE OF VARCHAR(30); lista_pk list_columns_primary := list_columns_primary (); lista_ind list_columns_indice := list_columns_indice (); lista_par list_columns_par := list_columns_par (); num_filas INTEGER; /* ALMACENAREMOS EL NUMERO DE FILAS DE LA TABLA MTDT_PERMITED_VALUES */ longitud_campo INTEGER; clave_foranea INTEGER; /* 0 Si la tabla no tiene clave foranea. 1 si la tiene */ primera_col INTEGER; cadena_values VARCHAR2(3000); concept_name VARCHAR2 (30); nombre_tabla_reducido VARCHAR2(30); v_nombre_particion VARCHAR2(30); pos_abre_paren PLS_integer; pos_cierra_paren PLS_integer; longitud_des varchar2(5); longitud_des_numerico PLS_integer; v_tipo_particionado VARCHAR2(10); subset VARCHAR(1); no_encontrado VARCHAR(1); OWNER_SA VARCHAR2(60); OWNER_T VARCHAR2(60); OWNER_DM VARCHAR2(60); OWNER_MTDT VARCHAR2(60); TABLESPACE_DIM VARCHAR2(60); BEGIN /* (20141219) ANGEL RUIZ*/ /* ANTES DE NADA LEEMOS LAS VAR. DE ENTORNO PARA TIEMPO DE GENERACION*/ SELECT VALOR INTO OWNER_SA FROM MTDT_VAR_ENTORNO WHERE NOMBRE_VAR = 'OWNER_SA'; SELECT VALOR INTO OWNER_T FROM MTDT_VAR_ENTORNO WHERE NOMBRE_VAR = 'OWNER_T'; SELECT VALOR INTO OWNER_DM FROM MTDT_VAR_ENTORNO WHERE NOMBRE_VAR = 'OWNER_DM'; SELECT VALOR INTO OWNER_MTDT FROM MTDT_VAR_ENTORNO WHERE NOMBRE_VAR = 'OWNER_MTDT'; SELECT VALOR INTO TABLESPACE_DIM FROM MTDT_VAR_ENTORNO WHERE NOMBRE_VAR = 'TABLESPACE_DIM'; /* (20141219) FIN*/ SELECT COUNT(*) INTO num_filas FROM MTDT_MODELO_SUMMARY; /* COMPROBAMOS QUE TENEMOS FILAS EN NUESTRA TABLA MTDT_MODELO_LOGICO */ IF num_filas > 0 THEN /* hay filas en la tabla y por lo tanto el proceso tiene cosas que hacer */ DBMS_OUTPUT.put_line('set echo on;'); DBMS_OUTPUT.put_line('whenever sqlerror exit 1;'); OPEN c_mtdt_modelo_logico_TABLA; LOOP /* COMENZAMOS EL BUCLE QUE GENERARA LOS CREATES PARA CADA UNA DE LAS TABLAS */ FETCH c_mtdt_modelo_logico_TABLA INTO r_mtdt_modelo_logico_TABLA; EXIT WHEN c_mtdt_modelo_logico_TABLA%NOTFOUND; nombre_tabla_reducido := substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 5); /* Le quito al nombre de la tabla los caracteres DMD_ o DMF_ */ --DBMS_OUTPUT.put_line('DROP TABLE ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME || ' CASCADE CONSTRAINTS;'); DBMS_OUTPUT.put_line('CREATE TABLE ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME); DBMS_OUTPUT.put_line('('); concept_name := substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 5); OPEN c_mtdt_modelo_logico_COLUMNA (r_mtdt_modelo_logico_TABLA.TABLE_NAME); primera_col := 1; v_tipo_particionado := 'S'; /* (20150821) Angel Ruiz. Por defecto la tabla no estara particionada */ LOOP FETCH c_mtdt_modelo_logico_COLUMNA INTO r_mtdt_modelo_logico_COLUMNA; EXIT WHEN c_mtdt_modelo_logico_COLUMNA%NOTFOUND; /* COMENZAMOS EL BUCLE QUE GENERARA LAS COLUMNAS */ IF primera_col = 1 THEN /* Si es primera columna */ IF (r_mtdt_modelo_logico_COLUMNA.VDEFAULT IS NOT NULL) THEN CASE WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'VARCHAR') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || '''' || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ''''); end if; ELSE /* se trata de Fecha */ if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; END CASE; ELSE if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE); end if; END IF; primera_col := 0; ELSE /* si no es primera columna */ IF (r_mtdt_modelo_logico_COLUMNA.VDEFAULT IS NOT NULL) THEN CASE WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'VARCHAR') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || '''' || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ''''); end if; ELSE /* se trata de Fecha */ if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; END CASE; ELSE if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE); end if; END IF; END IF; IF upper(trim(r_mtdt_modelo_logico_COLUMNA.PK)) = 'S' then lista_pk.EXTEND; lista_pk(lista_pk.LAST) := r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME; END IF; /* (20160324) Angel Ruiz. NF: Indices en las tablas de modelo*/ IF upper(trim(r_mtdt_modelo_logico_COLUMNA.INDICE)) = 'S' then lista_ind.EXTEND; lista_ind(lista_ind.LAST) := r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME; END IF; /* (20160324) Angel Ruiz. Fin NF: Indices en las tablas de modelo*/ /* (20150821) ANGEL RUIZ. FUNCIONALIDAD PARA PARTICIONADO */ if (regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.TABLE_NAME, 1, 4), '??F_',1,'i') >0 AND (upper(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME) = 'CVE_DIA' OR upper(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME) = 'CVE_DAY' OR upper(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME) = 'DAY')) then /* SE TRATA DE UNA TABLA DE HECHOS CON COLUMNA CVE_DIA ==> PARTICIONADO DIARIO */ v_tipo_particionado := 'D'; /* Particionado Diario */ /* (20160324) Angel Ruiz. NF: Indices en las tablas del modelo*/ lista_par.extend; lista_par(lista_par.last) := r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME; /* (20160324) Angel Ruiz. Fin NF: Indices en las tablas del modelo*/ end if; /* Gestionamos el posible particionado de la tabla */ if (regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.TABLE_NAME, 1, 4) ,'??F_',1,'i') >0 AND upper(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME) = 'CVE_MES') then /* SE TRATA DE UNA TABLA DE HECHOS CON COLUMNA CVE_DIA ==> PARTICIONADO MENSUAL */ if (r_mtdt_modelo_logico_TABLA.PARTICIONADO = 'M24') then /* (20150918) Angel Ruiz. NF: Se trata del particionado para BSC. Mensual pero 24 Particiones fijas.*/ /* La filosofia cambia */ v_tipo_particionado := 'M24'; /* Particionado Mensual */ else v_tipo_particionado := 'M'; /* Particionado Mensual, aunque para una tabla de Agregados*/ end if; /* (20160324) Angel Ruiz. NF: Indices en las tablas del modelo*/ lista_par.extend; lista_par(lista_par.last) := r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME; /* (20160324) Angel Ruiz. Fin NF: Indices en las tablas del modelo*/ end if; if (regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.TABLE_NAME, 1, 4), '??A_',1,'i') >0 AND upper(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME) = 'CVE_MES') then /* SE TRATA DE UNA TABLA DE AGREGADOS CON PARTICIONAMIENTO POR MES */ v_tipo_particionado := 'M'; /* Particionado Mensual, aunque para una tabla de Agregados*/ /* (20160324) Angel Ruiz. NF: Indices en las tablas del modelo*/ lista_par.extend; lista_par(lista_par.last) := r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME; /* (20160324) Angel Ruiz. Fin NF: Indices en las tablas del modelo*/ end if; /* (20150821) ANGEL RUIZ. FIN FUNCIONALIDAD PARA PARTICIONADO */ END LOOP; CLOSE c_mtdt_modelo_logico_COLUMNA; IF lista_pk.COUNT > 0 THEN DBMS_OUTPUT.put_line(',' || 'CONSTRAINT "' || nombre_tabla_reducido || '_P"' || ' PRIMARY KEY ('); FOR indx IN lista_pk.FIRST .. lista_pk.LAST LOOP IF indx = lista_pk.LAST THEN DBMS_OUTPUT.put_line(lista_pk (indx) || ') '); ELSE DBMS_OUTPUT.put_line(lista_pk (indx) || ','); END IF; END LOOP; END IF; DBMS_OUTPUT.put_line(')'); /* Parentesis final del create*/ --DBMS_OUTPUT.put_line('TABLESPACE ' || r_mtdt_modelo_logico_COLUMNA.TABLESPACE); if (regexp_count(substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 1, 4) ,'??F_',1,'i') >0) then /* Se trata de una tabla de HECHOS */ -- /* Hay que particonarla */ if (r_mtdt_modelo_logico_TABLA.TABLESPACE is not null) then DBMS_OUTPUT.put_line('TABLESPACE ' || r_mtdt_modelo_logico_TABLA.TABLESPACE); end if; if (v_tipo_particionado = 'D') then /* Se trata de un particionado diario */ /* (20191223) Angel Ruiz. BUG*/ --DBMS_OUTPUT.put_line('PARTITION BY RANGE (CVE_DIA)'); DBMS_OUTPUT.put_line('PARTITION BY RANGE (' || lista_par(lista_par.last) || ')'); /* (20191223) Angel Ruiz. Fin BUG*/ DBMS_OUTPUT.put_line('('); /* (20150224) Angel Ruiz. Al generar le modelo para DIST me da un error por nombre demasiado largo */ if (length(nombre_tabla_reducido) <= 18) then v_nombre_particion := 'PA_' || nombre_tabla_reducido; else v_nombre_particion := nombre_tabla_reducido; end if; DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-208,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-207,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-207,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-206,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-206,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-205,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-205,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-204,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-204,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-203,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-203,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-202,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-202,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-201,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-201,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-200,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-200,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-199,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-199,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-198,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-198,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-197,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-197,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-196,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-196,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-195,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-195,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-194,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-194,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-193,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-193,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-192,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-192,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-191,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-191,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-190,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-190,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-189,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-189,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-188,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-188,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-187,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-187,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-186,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-186,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-185,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-185,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-184,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-184,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-183,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-183,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-182,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-182,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-181,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-181,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-180,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-180,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-179,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-179,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-178,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-178,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-177,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-177,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-176,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-176,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-175,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-175,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-174,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-174,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-173,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-173,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-172,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-172,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-171,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-171,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-170,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-170,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-169,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-169,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-168,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-168,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-167,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-167,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-166,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-166,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-165,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-165,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-164,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-164,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-163,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-163,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-162,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-162,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-161,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-161,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-160,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-160,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-159,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-159,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-158,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-158,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-157,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-157,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-156,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-156,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-155,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-155,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-154,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-154,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-153,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-153,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-152,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-152,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-151,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-151,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-150,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-150,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-149,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-149,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-148,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-148,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-147,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-147,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-146,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-146,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-145,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-145,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-144,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-144,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-143,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-143,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-142,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-142,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-141,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-141,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-140,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-140,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-139,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-139,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-138,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-138,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-137,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-137,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-136,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-136,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-135,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-135,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-134,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-134,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-133,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-133,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-132,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-132,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-131,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-131,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-130,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-130,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-129,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-129,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-128,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-128,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-127,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-127,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-126,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-126,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-125,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-125,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-124,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-124,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-123,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-123,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-122,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-122,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-121,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-121,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-120,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-120,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-119,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-119,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-118,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-118,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-117,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-117,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-116,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-116,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-115,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-115,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-114,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-114,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-113,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-113,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-112,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-112,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-111,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-111,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-110,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-110,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-109,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-109,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-108,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-108,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-107,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-107,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-106,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-106,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-105,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-105,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-104,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-104,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-103,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-103,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-102,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-102,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-101,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-101,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-100,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-100,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-99,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-99,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-98,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-98,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-97,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-97,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-96,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-96,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-95,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-95,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-94,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-94,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-93,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-93,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-92,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-92,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-91,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-91,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-90,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-90,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-89,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-89,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-88,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-88,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-87,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-87,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-86,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-86,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-85,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-85,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-84,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-84,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-83,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-83,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-82,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-82,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-81,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-81,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-80,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-80,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-79,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-79,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-78,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-78,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-77,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-77,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-76,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-76,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-75,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-75,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-74,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-74,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-73,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-73,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-72,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-72,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-71,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-71,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-70,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-70,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-69,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-69,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-68,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-68,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-67,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-67,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-66,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-66,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-65,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-65,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-64,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-64,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-63,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-63,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-62,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-62,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-61,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-61,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-60,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-60,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-59,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-59,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-58,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-58,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-57,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-57,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-56,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-56,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-55,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-55,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-54,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-54,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-53,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-53,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-52,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-52,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-51,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-51,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-50,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-50,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-49,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-49,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-48,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-48,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-47,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-47,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-46,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-46,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-45,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-45,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-44,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-44,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-43,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-43,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-42,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-42,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-41,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-41,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-40,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-40,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-39,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-39,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-38,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-38,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-37,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-37,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-36,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-36,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-35,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-35,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-34,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-34,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-33,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-33,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-32,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-32,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-31,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-31,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-30,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-30,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-29,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-29,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-28,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-28,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-27,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-27,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-26,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-26,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-25,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-25,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-24,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-24,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-23,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-23,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-22,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-22,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-21,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-21,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-20,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-20,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-19,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-19,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-18,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-18,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-17,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-17,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-16,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-16,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-15,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-15,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-14,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-14,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-13,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-13,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-12,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-12,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-11,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-11,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-10,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-10,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-9,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-9,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-8,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-8,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-7,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-7,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-6,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-6,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-5,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-5,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-4,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-4,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-3,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-3,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-2,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-2,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate-1,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate-1,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+1,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+1,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+2,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+2,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+3,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+3,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+4,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+4,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+5,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+5,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+6,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+6,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+7,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+7,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+8,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+8,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+9,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+9,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+10,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+10,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+11,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+11,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+12,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+12,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+13,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+13,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+14,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+14,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+15,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+15,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+16,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+16,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+17,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+17,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+18,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+18,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+19,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+19,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+20,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+20,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+21,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+21,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+22,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+22,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+23,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+23,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+24,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+24,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+25,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+25,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+26,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+26,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+27,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+27,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+28,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+28,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+29,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+29,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+30,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+30,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+31,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+31,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+32,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+32,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+33,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+33,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+34,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+34,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+35,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+35,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+36,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+36,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+37,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+37,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+38,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+38,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+39,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+39,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+40,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+40,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+41,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+41,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+42,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+42,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+43,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+43,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+44,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+44,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+45,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+45,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+46,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+46,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+47,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+47,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+48,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+48,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+49,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+49,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+50,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+50,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+51,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+51,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+52,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+52,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+53,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+53,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+54,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+54,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+55,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+55,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+56,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+56,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+57,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+57,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+58,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+58,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+59,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+59,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+60,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+60,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+61,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+61,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+62,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+62,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+63,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+63,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+64,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+64,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+65,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+65,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+66,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+66,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+67,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+67,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+68,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+68,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+69,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+69,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+70,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+70,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+71,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+71,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+72,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+72,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+73,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+73,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+74,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+74,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+75,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+75,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+76,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+76,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+77,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+77,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+78,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+78,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+79,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+79,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+80,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+80,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+81,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+81,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+82,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+82,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+83,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+83,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+84,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+84,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+85,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+85,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+86,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+86,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+87,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+87,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+88,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+88,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+89,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+89,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+90,'YYYYMMDD') || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate+90,'YYYYMMDD') || ' VALUES LESS THAN (' || TO_CHAR(sysdate+91,'YYYYMMDD') || ')'); DBMS_OUTPUT.put_line(');'); elsif (v_tipo_particionado = 'M') then /* Se trata de un particionado Mensual */ /* (20191223) Angel Ruiz. BUG.*/ --DBMS_OUTPUT.put_line('PARTITION BY RANGE (CVE_MES)'); DBMS_OUTPUT.put_line('PARTITION BY RANGE (' || lista_par(lista_par.last) || ')'); /* (20191223) Angel Ruiz. Fin.*/ DBMS_OUTPUT.put_line('('); /* (20150224) Angel Ruiz. Al generar le modelo para DIST me da un error por nombre demasiado largo */ if (length(nombre_tabla_reducido) <= 18) then v_nombre_particion := 'PA_' || nombre_tabla_reducido; else v_nombre_particion := nombre_tabla_reducido; end if; /********/ /* (20150518) Angel Ruiz */ DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate,-3),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,-2),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate,-2),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,-1),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate,-1),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(sysdate,'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate,'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,1),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate, 1),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,2),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate, 2),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,3),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate, 3),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,4),'YYYYMM')) || ')'); DBMS_OUTPUT.put_line(');'); elsif (v_tipo_particionado = 'M24') then /* (20150918) Angel Ruiz. N.F.: Se trata de implementar el particionado para BSC donde hay 24 particiones siempre */ /* Las particiones se crean una vez y asi permanecen ya que el espacio de analisis se extiende 24 meses */ /* (20191223) Angel Ruiz. BUG*/ --DBMS_OUTPUT.put_line('PARTITION BY RANGE (CVE_MES)'); DBMS_OUTPUT.put_line('PARTITION BY RANGE (' || lista_par(lista_par.last) || ')'); /* (20191223) Angel Ruiz. Fin BUG */ DBMS_OUTPUT.put_line('('); /* (20150224) Angel Ruiz. Al generar le modelo para DIST me da un error por nombre demasiado largo */ if (length(nombre_tabla_reducido) <= 18) then v_nombre_particion := 'PA_' || nombre_tabla_reducido; else v_nombre_particion := nombre_tabla_reducido; end if; /* (20150918) Angel Ruiz. Fin N.F.: Se trata de implementar el particionado para BSC donde hay 24 particiones siempre */ /* Se cra la primera particion de analisis solamente. El resto se crea en los procesos de carga */ /* La primera particion coincide con Enero del año anterior al sysdate */ DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(TO_NUMBER(TO_CHAR(sysdate,'YYYY')) -1) || '01' || ' VALUES LESS THAN (' || TO_CHAR(TO_NUMBER(TO_CHAR(sysdate,'YYYY')) -1) || '02' || ')'); DBMS_OUTPUT.put_line(');'); /* (20150918) Angel Ruiz. Fin N.F*/ end if; elsif (regexp_count(substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 1, 4), '??A_',1,'i') >0) then /* Se trata de una tabla de HECHOS AGREGADOS */ if (v_tipo_particionado = 'M') then -- /* Hay que particonarla */ if (r_mtdt_modelo_logico_TABLA.TABLESPACE is not null) then DBMS_OUTPUT.put_line('TABLESPACE ' || r_mtdt_modelo_logico_TABLA.TABLESPACE); end if; /* (20191223) Angel Ruiz.BUG. */ --DBMS_OUTPUT.put_line('PARTITION BY RANGE (CVE_MES)'); DBMS_OUTPUT.put_line('PARTITION BY RANGE (' || lista_par(lista_par.last) || ')'); /* (20191223) Angel Ruiz. BUG. */ DBMS_OUTPUT.put_line('('); /* (20150224) Angel Ruiz. Al generar le modelo para DIST me da un error por nombre demasiado largo */ if (length(nombre_tabla_reducido) <= 18) then v_nombre_particion := 'PA_' || nombre_tabla_reducido; else v_nombre_particion := nombre_tabla_reducido; end if; /********/ /* (20150518) Angel Ruiz */ DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate,-2),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,-1),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate,-1),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(sysdate,'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(sysdate,'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,1),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate, 1),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,2),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate, 2),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,3),'YYYYMM')) || '),'); DBMS_OUTPUT.put_line('PARTITION ' || v_nombre_particion ||'_' || TO_CHAR(add_months(sysdate, 3),'YYYYMM') || ' VALUES LESS THAN (' || TO_NUMBER(TO_CHAR(add_months(sysdate,4),'YYYYMM')) || ')'); DBMS_OUTPUT.put_line(');'); end if; else --DBMS_OUTPUT.put_line('TABLESPACE ' || r_mtdt_modelo_logico_COLUMNA.TABLESPACE || ';'); --DBMS_OUTPUT.put_line('TABLESPACE ' || 'DWTBSP_D_MVNO_DIM' || ';'); --DBMS_OUTPUT.put_line ('-- #' || r_mtdt_modelo_logico_TABLA.TABLE_NAME || '#'); --if (TRIM(r_mtdt_modelo_logico_TABLA.table_name) = 'DMD_CAUSA_LLAMADA') then --DBMS_OUTPUT.put_line ('LA TABLA QUE QUIERO INVESTIGAR: #' || r_mtdt_modelo_logico_TABLA.TABLE_NAME || '#'); --DBMS_OUTPUT.put_line ('El valor de TABLESPACE ES: #' || r_mtdt_modelo_logico_TABLA.TABLESPACE || '#'); --end if; if (r_mtdt_modelo_logico_TABLA.TABLESPACE is not null) then DBMS_OUTPUT.put_line ('TABLESPACE ' || r_mtdt_modelo_logico_TABLA.TABLESPACE || ';'); else DBMS_OUTPUT.put_line (';'); end if; end if; --DBMS_OUTPUT.put_line(';'); /* (20160324. Angel Ruiz. NF: Gestion de indices */ if (lista_ind.COUNT > 0) THEN /* La tabla tiene indices */ if (v_tipo_particionado = 'D' or v_tipo_particionado = 'M') then /* vemos la posibilidad de crear un indice LOCAL a cada particion */ /* Para ello la clave de particionado debe formar parte del indice */ /* por lo que hemos de buscar si la clave de particionado está en el indice */ no_encontrado := 'N'; /* por defecto supongo que todos los campos de particionado forman parte del indice, de ahi no_encontrado = N */ FOR indy IN lista_par.FIRST .. lista_par.LAST LOOP /* Para cada uno de los campos de particionado. Normalmente es uno*/ /* busco si estan en los campos del indice */ subset := 'N'; FOR indx IN lista_ind.FIRST .. lista_ind.LAST LOOP IF (lista_par(indy) = lista_ind(indx)) THEN subset := 'Y'; END IF; END LOOP; if (subset = 'N') then /* No he encontrado el campo de particionado en los campos que forman el indice */ no_encontrado := 'Y'; end if; END LOOP; if (no_encontrado = 'Y') then /* Ocurre que hay campos de particionado que no formal parte del indice por lo que no se puede crear un indice local*/ DBMS_OUTPUT.put_line('CREATE INDEX ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME || '_I ON ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME); DBMS_OUTPUT.put_line('('); FOR indx IN lista_ind.FIRST .. lista_ind.LAST LOOP IF indx = lista_ind.LAST THEN DBMS_OUTPUT.put_line(lista_ind (indx) || ') '); ELSE DBMS_OUTPUT.put_line(lista_ind (indx) || ','); END IF; END LOOP; DBMS_OUTPUT.put_line('NOLOGGING GLOBAL;'); else /* Podemos crear un Indice PK local */ DBMS_OUTPUT.put_line('CREATE INDEX ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME || '_I ON ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME); DBMS_OUTPUT.put_line('('); FOR indx IN lista_ind.FIRST .. lista_ind.LAST LOOP IF indx = lista_ind.LAST THEN DBMS_OUTPUT.put_line(lista_ind (indx) || ') '); ELSE DBMS_OUTPUT.put_line(lista_ind (indx) || ','); END IF; END LOOP; DBMS_OUTPUT.put_line('NOLOGGING LOCAL;'); end if; end if; end if; /* (20160324. Angel Ruiz. Fin NF: Gestion de indices */ lista_pk.DELETE; /* Borramos los elementos de la lista */ lista_ind.delete; lista_par.delete; DBMS_OUTPUT.put_line(''); /***************************/ /* AHORA CREAMOS LA TABLA TEMPORAL PERO SOLO PARA AQUELLAS QUE NO SE VAN A CARGAR COMO CARGA INICIAL */ if (r_mtdt_modelo_logico_TABLA.CI = 'N') then /* Aquellas que no tienen ningún tipo de carga inicial */ --DBMS_OUTPUT.put_line('DROP TABLE ' || OWNER_DM || '.T_' || nombre_tabla_reducido || ' CASCADE CONSTRAINTS;'); DBMS_OUTPUT.put_line('CREATE TABLE ' || OWNER_DM || '.T_' || nombre_tabla_reducido); DBMS_OUTPUT.put_line('('); concept_name := substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 5); OPEN c_mtdt_modelo_logico_COLUMNA (r_mtdt_modelo_logico_TABLA.TABLE_NAME); primera_col := 1; LOOP FETCH c_mtdt_modelo_logico_COLUMNA INTO r_mtdt_modelo_logico_COLUMNA; EXIT WHEN c_mtdt_modelo_logico_COLUMNA%NOTFOUND; /* COMENZAMOS EL BUCLE QUE GENERARA LAS COLUMNAS */ IF primera_col = 1 THEN /* Si es primera columna */ IF (r_mtdt_modelo_logico_COLUMNA.VDEFAULT IS NOT NULL) THEN CASE WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'VARCHAR') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || '''' || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ''''); end if; ELSE /* se trata de Fecha */ if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; END CASE; ELSE if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' NOT NULL'); else DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE); end if; END IF; primera_col := 0; ELSE /* si no es primera columna */ IF (r_mtdt_modelo_logico_COLUMNA.VDEFAULT IS NOT NULL) THEN CASE WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; WHEN (INSTR(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'VARCHAR') > 0) THEN if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || '''' || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ''' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ''''); end if; ELSE /* se trata de Fecha */ if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' DEFAULT ' || r_mtdt_modelo_logico_COLUMNA.VDEFAULT); end if; END CASE; ELSE if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE || ' NOT NULL'); else DBMS_OUTPUT.put_line(', ' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME || ' ' || r_mtdt_modelo_logico_COLUMNA.DATA_TYPE); end if; END IF; END IF; IF upper(trim(r_mtdt_modelo_logico_COLUMNA.PK)) = 'S' then lista_pk.EXTEND; lista_pk(lista_pk.LAST) := r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME; END IF; /* (20160324) Angel Ruiz. NF: INdices en el modelo */ IF upper(trim(r_mtdt_modelo_logico_COLUMNA.INDICE)) = 'S' then lista_ind.EXTEND; lista_ind(lista_ind.LAST) := r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME; END IF; END LOOP; CLOSE c_mtdt_modelo_logico_COLUMNA; IF lista_pk.COUNT > 0 THEN DBMS_OUTPUT.put_line(',' || 'CONSTRAINT "T_' || nombre_tabla_reducido || '_P"' || ' PRIMARY KEY ('); FOR indx IN lista_pk.FIRST .. lista_pk.LAST LOOP IF indx = lista_pk.LAST THEN DBMS_OUTPUT.put_line(lista_pk (indx) || ') '); ELSE DBMS_OUTPUT.put_line(lista_pk (indx) || ','); END IF; END LOOP; END IF; DBMS_OUTPUT.put_line(')'); /* Parentesis final del create */ if (r_mtdt_modelo_logico_TABLA.TABLESPACE is not null) then DBMS_OUTPUT.put_line('TABLESPACE ' || r_mtdt_modelo_logico_TABLA.TABLESPACE || ';'); else DBMS_OUTPUT.put_line(';'); end if; /* (20160324) Angel Ruiz. NF: Indices en las tablas del modelo */ if (lista_ind.COUNT > 0) then DBMS_OUTPUT.put_line('CREATE INDEX ' || OWNER_DM || '.T_' || nombre_tabla_reducido || '_I ON ' || OWNER_DM || '.T_' || nombre_tabla_reducido); DBMS_OUTPUT.put_line('('); FOR indx IN lista_ind.FIRST .. lista_ind.LAST LOOP IF indx = lista_ind.LAST THEN DBMS_OUTPUT.put_line(lista_ind (indx) || ') '); ELSE DBMS_OUTPUT.put_line(lista_ind (indx) || ','); END IF; END LOOP; DBMS_OUTPUT.put_line('NOLOGGING;'); end if; /* (20160324) Angel Ruiz. Fin NF:Indices en las tablas del modelo */ --if (r_mtdt_modelo_logico_TABLA.TABLE_NAME='DMF_PARQUE_MVNO') then -- DBMS_OUTPUT.put_line('TABLESPACE ' || 'DWTBSP_D_MVNO_PARQUE;'); --elsif (r_mtdt_modelo_logico_TABLA.TABLE_NAME='DMF_RECARGAS_MVNO') then -- DBMS_OUTPUT.put_line('TABLESPACE ' || 'DWTBSP_D_MVNO_AJUSTES;'); --elsif (r_mtdt_modelo_logico_TABLA.TABLE_NAME='DMF_TRAFD_CU_MVNO;') then -- DBMS_OUTPUT.put_line('TABLESPACE ' || 'DWTBSP_D_MVNO_TRAFD;'); --elsif (r_mtdt_modelo_logico_TABLA.TABLE_NAME='DMF_TRAFE_CU_MVNO') then -- DBMS_OUTPUT.put_line('TABLESPACE ' || 'DWTBSP_D_MVNO_TRAFE;'); --elsif (r_mtdt_modelo_logico_TABLA.TABLE_NAME='DMF_TRAFV_CU_MVNO;') then -- DBMS_OUTPUT.put_line('TABLESPACE ' || 'DWTBSP_D_MVNO_TRAFV;'); --else -- DBMS_OUTPUT.put_line('TABLESPACE ' || 'DWTBSP_D_MVNO_DIM' || ';'); --end if; end if; --DBMS_OUTPUT.put_line('TABLESPACE ' || r_mtdt_modelo_logico_COLUMNA.TABLESPACE || ';'); lista_pk.DELETE; /* Borramos los elementos de la lista */ lista_ind.DELETE; DBMS_OUTPUT.put_line(''); /****************************************************************************************************/ /* Viene la parte donde se generan los INSERTS por defecto y la SECUENCIA */ /****************************************************************************************************/ /* (20150826) ANGEL RUIZ. Cambio la creacion de la secuencia para que se cree secuencia para todas las tablas DIMENSIONES o HECHOS */ if (r_mtdt_modelo_logico_TABLA.CI = 'N') then DBMS_OUTPUT.put_line('DROP SEQUENCE ' || OWNER_DM || '.SEQ_' || SUBSTR(r_mtdt_modelo_logico_TABLA.TABLE_NAME,5) || ';'); DBMS_OUTPUT.put_line('CREATE SEQUENCE ' || OWNER_DM || '.SEQ_' || SUBSTR(r_mtdt_modelo_logico_TABLA.TABLE_NAME,5)); DBMS_OUTPUT.put_line('MINVALUE 1 START WITH 1 INCREMENT BY 1;'); DBMS_OUTPUT.put_line(''); end if; if (r_mtdt_modelo_logico_TABLA.CI = 'N' or r_mtdt_modelo_logico_TABLA.CI = 'I') then /* Generamos los inserts para aquellas tablas que no son de carga inicial */ if (regexp_count(substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 1, 4) ,'??D_',1,'i') >0 or regexp_count(substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 1, 4), 'DMT_',1,'i') >0 or regexp_count(substr(r_mtdt_modelo_logico_TABLA.TABLE_NAME, 1, 4), 'DWD_',1,'i') >0) then /* Solo si se trata de una dimension generamos los inserts por defecto y la secuencia */ --if (r_mtdt_modelo_logico_TABLA.CI = 'N') then --DBMS_OUTPUT.put_line('CREATE SEQUENCE ' || OWNER_DM || '.SEQ_' || SUBSTR(r_mtdt_modelo_logico_TABLA.TABLE_NAME,5)); --DBMS_OUTPUT.put_line('MINVALUE 1 START WITH 1 INCREMENT BY 1;'); --end if; DBMS_OUTPUT.put_line(''); /* Primero el INSERT "NO APLICA" */ DBMS_OUTPUT.put_line('INSERT INTO ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME); DBMS_OUTPUT.put_line('('); OPEN c_mtdt_modelo_logico_COLUMNA (r_mtdt_modelo_logico_TABLA.TABLE_NAME); primera_col := 1; cadena_values := ''; LOOP FETCH c_mtdt_modelo_logico_COLUMNA INTO r_mtdt_modelo_logico_COLUMNA; EXIT WHEN c_mtdt_modelo_logico_COLUMNA%NOTFOUND; IF primera_col = 1 THEN /* Si es primera columna */ DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME); CASE WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'CVE_',1,'i') >0 THEN cadena_values := '-1'; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 3), 'ID_',1,'i') >0 THEN if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'NUMBER') > 0) then cadena_values := '-1'; else if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0 or instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0) then cadena_values := 'N'; elsif (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then cadena_values := 'NA'; else cadena_values := 'NULL'; end if; else cadena_values := '''NA#'''; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'DES_',1,'i') >0 THEN pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 8) then cadena_values := '''NO APLICA'''; elsif (longitud_des_numerico > 2) then cadena_values := '''NA#'''; else if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then case when longitud_des_numerico = 2 then cadena_values := '''NA'''; when longitud_des_numerico = 1 then cadena_values := '''N'''; end case; else cadena_values := 'NULL'; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'FCH_',1,'i') >0 THEN cadena_values := 'sysdate'; ELSE /* (20150118) Angel Ruiz. BUG: Se han de incluir valores en lugar de NULL */ --if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then if (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) then cadena_values := '-1'; elsif (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'DATE') > 0) then cadena_values := 'sysdate'; else /* VARCHAR */ pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 8) then cadena_values := '''NO APLICA'''; elsif (longitud_des_numerico > 2) then cadena_values := '''NA#'''; else cadena_values := '''N'''; end if; end if; --else --cadena_values := 'NULL'; --end if; END CASE; primera_col := 0; ELSE /* si no es primera columna */ DBMS_OUTPUT.put_line(',' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME); CASE WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'CVE_',1,'i') >0 THEN cadena_values := cadena_values || ', -1'; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 3),'ID_',1,'i') >0 THEN if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'NUMBER') > 0 ) then cadena_values := cadena_values || ', -1'; else if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0 or instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0) then cadena_values := cadena_values || ', ''N'''; elsif (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then cadena_values := cadena_values || ', ''NA'''; else cadena_values := cadena_values || ', NULL'; end if; else cadena_values := cadena_values || ', ''NA#'''; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'DES_',1,'i') >0 THEN pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 8) then cadena_values := cadena_values || ', ''NO APLICA'''; elsif (longitud_des_numerico > 2) then cadena_values := cadena_values || ', ''NA#'''; else if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then case when longitud_des_numerico = 2 then cadena_values := cadena_values || ', ''NA'''; when longitud_des_numerico = 1 then cadena_values := cadena_values || ', ''N'''; end case; else cadena_values := cadena_values || ', NULL'; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'FCH_',1,'i') >0 THEN cadena_values := cadena_values || ', sysdate'; ELSE /* (20150118) Angel Ruiz. BUG: Se han de incluir valores en lugar de NULL */ --if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then if (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) then cadena_values := cadena_values || ', -1'; elsif (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'DATE') > 0) then cadena_values := cadena_values || ', sysdate'; else /* VARCHAR */ pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 8) then cadena_values := cadena_values || ', ''NO APLICA'''; elsif (longitud_des_numerico > 2) then cadena_values := cadena_values || ', ''NA#'''; else cadena_values := cadena_values || ', ''N'''; end if; end if; --else --cadena_values := cadena_values || ', NULL'; --end if; END CASE; END IF; END LOOP; DBMS_OUTPUT.put_line(')'); DBMS_OUTPUT.put_line('VALUES'); DBMS_OUTPUT.put_line('(' || cadena_values || ');'); CLOSE c_mtdt_modelo_logico_COLUMNA; /* Siguiente insert "GENERICO" */ DBMS_OUTPUT.put_line('INSERT INTO ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME); DBMS_OUTPUT.put_line('('); OPEN c_mtdt_modelo_logico_COLUMNA (r_mtdt_modelo_logico_TABLA.TABLE_NAME); primera_col := 1; cadena_values := ''; LOOP FETCH c_mtdt_modelo_logico_COLUMNA INTO r_mtdt_modelo_logico_COLUMNA; EXIT WHEN c_mtdt_modelo_logico_COLUMNA%NOTFOUND; IF primera_col = 1 THEN /* Si es primera columna */ DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME); CASE WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4),'CVE_',1,'i') >0 THEN cadena_values := '-2'; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 3), 'ID_',1,'i') >0 THEN if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'NUMBER') > 0) then cadena_values := '-2'; else if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0 or instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0) then cadena_values := '''G'''; elsif (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then cadena_values := '''GE'''; else cadena_values := 'NULL'; end if; else cadena_values := '''GE#'''; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4),'DES_',1,'i') >0 THEN pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 7) then cadena_values := '''GENERICO'''; elsif (longitud_des_numerico > 2) then cadena_values := '''GE#'''; else if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then case when longitud_des_numerico = 2 then cadena_values := '''GE'''; when longitud_des_numerico = 1 then cadena_values := '''G'''; end case; else cadena_values := 'NULL'; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'FCH_',1,'i') >0 THEN cadena_values := 'sysdate'; ELSE /* (20150118) Angel Ruiz. BUG: Se han de incluir valores en lugar de NULL */ --if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then if (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) then cadena_values := '-2'; elsif (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'DATE') > 0) then cadena_values := 'sysdate'; else /* VARCHAR */ pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 7) then cadena_values := '''GENERICO'''; elsif (longitud_des_numerico > 2) then cadena_values := '''GE#'''; else cadena_values := '''G'''; end if; end if; --else --cadena_values := 'NULL'; --end if; END CASE; primera_col := 0; ELSE /* si no es primera columna */ DBMS_OUTPUT.put_line(',' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME); CASE WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'CVE_',1,'i') >0 THEN cadena_values := cadena_values || ', -2'; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 3), 'ID_',1,'i') >0 THEN if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'NUMBER') > 0) then cadena_values := cadena_values || ', -2'; else if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0 or instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0) then cadena_values := cadena_values || ', ''G'''; elsif (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then cadena_values := cadena_values || ', ''GE'''; else cadena_values := cadena_values || ', NULL'; end if; else cadena_values := cadena_values || ', ''GE#'''; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'DES_',1,'i') >0 THEN pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 7) then cadena_values := cadena_values || ', ''GENERICO'''; elsif (longitud_des_numerico > 2) then cadena_values := cadena_values || ', ''GE#'''; else if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then case when longitud_des_numerico = 2 then cadena_values := cadena_values || ', ''GE'''; when longitud_des_numerico = 1 then cadena_values := cadena_values || ', ''G'''; end case; else cadena_values := cadena_values || ', NULL'; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'FCH_',1,'i') >0 THEN cadena_values := cadena_values || ', sysdate'; ELSE /* (20160118) ANGEL RUIZ. BUG. Deben aparecer siempre valores en lugar de NULL */ --if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then if (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) then cadena_values := cadena_values || ', -2'; elsif (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'DATE') > 0) then cadena_values := cadena_values || ', sysdate'; else /* VARCHAR */ pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 7) then cadena_values := cadena_values || ', ''GENERICO'''; elsif (longitud_des_numerico > 2) then cadena_values := cadena_values || ', ''GE#'''; else cadena_values := cadena_values || ', ''G'''; end if; end if; --else -- cadena_values := cadena_values || ', NULL'; --end if; END CASE; END IF; END LOOP; DBMS_OUTPUT.put_line(')'); DBMS_OUTPUT.put_line('VALUES'); DBMS_OUTPUT.put_line('(' || cadena_values || ');'); CLOSE c_mtdt_modelo_logico_COLUMNA; /* Siguiente INSERT "NO INFORMADO" */ DBMS_OUTPUT.put_line('INSERT INTO ' || OWNER_DM || '.' || r_mtdt_modelo_logico_TABLA.TABLE_NAME); DBMS_OUTPUT.put_line('('); OPEN c_mtdt_modelo_logico_COLUMNA (r_mtdt_modelo_logico_TABLA.TABLE_NAME); primera_col := 1; cadena_values := ''; LOOP FETCH c_mtdt_modelo_logico_COLUMNA INTO r_mtdt_modelo_logico_COLUMNA; EXIT WHEN c_mtdt_modelo_logico_COLUMNA%NOTFOUND; IF primera_col = 1 THEN /* Si es primera columna */ DBMS_OUTPUT.put_line(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME); CASE WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'CVE_',1,'i') >0 THEN cadena_values := '-3'; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 3), 'ID_',1,'i') >0 THEN if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'NUMBER') > 0) then cadena_values := '-3'; else if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0 or instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0) then cadena_values := '''N'''; elsif (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then cadena_values := '''NI'''; else cadena_values := 'NULL'; end if; else cadena_values := '''NI#'''; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'DES_',1,'i') >0 THEN pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 11) then cadena_values := '''NO INFORMADO'''; elsif (longitud_des_numerico > 2) then cadena_values := '''NI#'''; else if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then case when longitud_des_numerico = 2 then cadena_values := '''NI'''; when longitud_des_numerico = 1 then cadena_values := '''N'''; end case; else cadena_values := 'NULL'; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'FCH_',1,'i') >0 THEN cadena_values := 'sysdate'; ELSE /* (20160118) ANGEL RUIZ. BUG. Deben aparecer siempre valores en lugar de NULL */ --if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then if (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) then cadena_values := '-3'; elsif (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'DATE') > 0) then cadena_values := 'sysdate'; else /* VARCHAR */ pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 11) then cadena_values := '''NO INFORMADO'''; elsif (longitud_des_numerico > 2) then cadena_values := '''NI#'''; else cadena_values := '''N'''; end if; end if; --else --cadena_values := 'NULL'; --end if; END CASE; primera_col := 0; ELSE /* si no es primera columna */ DBMS_OUTPUT.put_line(',' || r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME); CASE WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'CVE_',1,'i') >0 THEN cadena_values := cadena_values || ', -3'; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 3), 'ID_',1,'i') >0 THEN if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'NUMBER') > 0) then cadena_values := cadena_values || ', -3'; else if (instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0 or instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(1)') > 0) then cadena_values := cadena_values || ', ''N'''; elsif (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N' and instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'(2)') > 0) then cadena_values := cadena_values || ', ''NI'''; else cadena_values := cadena_values || ', NULL'; end if; else cadena_values := cadena_values || ', ''NI#'''; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4), 'DES_',1,'i') >0 THEN pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 11) then cadena_values := cadena_values || ', ''NO INFORMADO'''; elsif (longitud_des_numerico > 2) then cadena_values := cadena_values || ', ''NI#'''; else if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then case when longitud_des_numerico = 2 then cadena_values := cadena_values || ', ''NA'''; when longitud_des_numerico = 1 then cadena_values := cadena_values || ', ''N'''; end case; else cadena_values := cadena_values || ', NULL'; end if; end if; WHEN regexp_count(substr(r_mtdt_modelo_logico_COLUMNA.COLUMN_NAME, 1, 4),'FCH_',1,'i') >0 THEN cadena_values := cadena_values || ', sysdate'; ELSE /* (20160118) ANGEL RUIZ. BUG. Deben aparecer siempre valores en lugar de NULL */ --if (r_mtdt_modelo_logico_COLUMNA.NULABLE = 'N') then if (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'NUMBER') > 0) then cadena_values := cadena_values || ', -3'; elsif (regexp_count(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, 'DATE') > 0) then cadena_values := cadena_values || ', sysdate'; else /* VARCHAR */ pos_abre_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,'('); pos_cierra_paren := instr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE,')'); longitud_des := substr(r_mtdt_modelo_logico_COLUMNA.DATA_TYPE, pos_abre_paren+1, (pos_cierra_paren - pos_abre_paren)-1); longitud_des_numerico := to_number(longitud_des); if (longitud_des_numerico > 11) then cadena_values := cadena_values || ', ''NO INFORMADO'''; elsif (longitud_des_numerico > 2) then cadena_values := cadena_values || ', ''NI#'''; else cadena_values := cadena_values || ', ''N'''; end if; end if; --else --cadena_values := cadena_values || ', NULL'; --end if; END CASE; END IF; END LOOP; DBMS_OUTPUT.put_line(')'); DBMS_OUTPUT.put_line('VALUES'); DBMS_OUTPUT.put_line('(' || cadena_values || ');'); DBMS_OUTPUT.put_line('commit;'); DBMS_OUTPUT.put_line(''); CLOSE c_mtdt_modelo_logico_COLUMNA; end if; end if; /**********************/ /**********************/ END LOOP; CLOSE c_mtdt_modelo_logico_TABLA; END IF; DBMS_OUTPUT.put_line('set echo off;'); DBMS_OUTPUT.put_line('exit SUCCESS;'); END;
true
47d20b685d97a056273be912fe0d9c7e08304c78
SQL
jgarzonext/packages
/function/F_REDIST_PERMITE_SPL.sql
ISO-8859-1
2,359
3.078125
3
[]
no_license
-------------------------------------------------------- -- DDL for Function F_REDIST_PERMITE_SPL -------------------------------------------------------- CREATE OR REPLACE EDITIONABLE FUNCTION "AXIS"."F_REDIST_PERMITE_SPL" (psseguro IN NUMBER) RETURN NUMBER IS /****************************************************************************** NOMBRE: f_redist_permite_spl PROPSITO: Proteger la ejecucin de un suplemento de modificacin de perfil de inversin en caso de existir recibos en gestin de cobro o lineas pendientes de asignar sus participaciones. REVISIONES: Ver Fecha Autor Descripcin --------- ---------- --------------- ------------------------------------ 1.0 10/01/2008 RSC 1. Creacin de funcin 2.0 27/04/2009 RSC 2. Suplemento de cambio de forma de pago diferido. ******************************************************************************/ vconta NUMBER; -- Bug 9905 - 27/04/2009 - RSC - Suplemento de cambio de forma de pago diferido -- Join con vdetrecibos CURSOR cur_recibos IS SELECT r.nrecibo FROM recibos r, vdetrecibos v WHERE sseguro = psseguro AND r.nrecibo = v.nrecibo AND v.itotalr <> 0; vcsituac NUMBER; BEGIN SELECT CASE WHEN contador > 0 THEN 180704 -- Existeixen lineas pendents d'assignar participacions. Redistribuci no permessa. ELSE 0 END conta INTO vconta FROM (SELECT COUNT(*) contador FROM ctaseguro WHERE sseguro = psseguro AND cesta IS NOT NULL AND nunidad IS NULL); IF vconta <> 0 THEN RETURN(vconta); ELSE FOR regs IN cur_recibos LOOP vcsituac := f_cestrec_mv(regs.nrecibo, 2); -- Esto lo he cogido de tfcon006 (campo nrecibo.csituac) IF vcsituac = 3 THEN -- Gestin de cobro RETURN 180705; END IF; END LOOP; END IF; RETURN 0; END f_redist_permite_spl; / GRANT EXECUTE ON "AXIS"."F_REDIST_PERMITE_SPL" TO "R_AXIS"; GRANT EXECUTE ON "AXIS"."F_REDIST_PERMITE_SPL" TO "CONF_DWH"; GRANT EXECUTE ON "AXIS"."F_REDIST_PERMITE_SPL" TO "PROGRAMADORESCSI";
true
0e27cadc3f9324de8a1cdc68b1994b11ef0d0c82
SQL
extensible-cms/ecms-domain-model-mysql
/scripts/default_data_users_and_contacts.sql
UTF-8
1,527
3.640625
4
[ "BSD-3-Clause" ]
permissive
-- Description: Populates `users` with a default `superadmin` user and also populates -- `contacts` and `contact_relationships` with the pertinent data for that `superadmin` user. -- ** Note ** If you run this file separately from the build process, do so with caution. -- Set Database use `ecms`; -- Prelims SET @user_screenName = 'superadmin'; SET @user_firstName = 'Super'; SET @user_lastName = 'Administrator'; SET @user_email = 'change@me.com'; -- Unhashed password is `changeme` and should be changed once logged into system! SET @user_password = 'sha256:1000:0ym63Iy7420k0qpIrX6PQecBzjyoYMor:jXveAXoytwz8iL/b0qGeNprCt1kRENFx'; SET @user_id = ''; SET @contact_id = ''; -- Default User INSERT INTO `date_info` (createdDate) VALUES (UNIX_TIMESTAMP()); -- Insert contact for user INSERT INTO `contacts` (email, firstName, lastName, userParams) VALUES (@user_email, @user_firstName, @user_lastName, ''); -- Capture contact id SET @contact_id = LAST_INSERT_ID(); -- Insert user entry INSERT INTO `users` (screenName, password, `role`, date_info_id, status, contact_id) VALUES (@user_screenName, @user_password, 'cms-super-admin', LAST_INSERT_ID(), 'activated', @contact_id); -- Keep user id SET @user_id = LAST_INSERT_ID(); -- Insert relationship row (user -> contact) INSERT INTO `user_contact_relationships` (screenName, email) VALUES (@user_screenName, @user_email); -- Show inserted user -- SELECT * FROM `users` WHERE screenName = @user_screenName; -- SELECT * FROM `contacts` WHERE email = @user_email; -- SELECT * FROM `user_contact_relationships` WHERE email = @user_email;
true
7d7c301568e9b2897ac0ddeb0f3d2535ee80ceb1
SQL
muhammedessa/SQLSERVER_files
/Transact-SQL - sql server microsoft/Ordering Results Example.sql
UTF-8
604
3.5
4
[]
no_license
-- Orders the results by LastName only select distinct LastName, FirstName, EmailPromotion from Person.person order by LastName -- Orders the results by LastName, then FirstName select distinct LastName, FirstName, EmailPromotion from Person.person order by LastName,FirstName -- Orders the results by LastName in descending order (Z-A), then FirstName select distinct LastName, FirstName, EmailPromotion from Person.person order by LastName DESC,FirstName -- Orders the results by EmailPromotion select distinct LastName, FirstName, EmailPromotion from Person.person order by EmailPromotion ASC
true
3464e7e007e42fbcc7568d4e2179e206f3223cec
SQL
albertocubeddu/variousSnippets
/mysqlSnippets/commonQuery/groupConcatLastTwoResult.sql
UTF-8
428
4.4375
4
[]
no_license
#Retrieve the (n) and (n-1) value by a certain date. # (?) is The date that you want to retrieve and compare with the older one. SELECT t1.col1, ( SELECT GROUP_CONCAT(t2.value_to_retrieve ORDER BY as_of_date DESC LIMIT 2) FROM table_2 as t2 WHERE t2.col1 <=> t1.col1 AND t2.as_of_date <= ? GROUP BY t2.col1) as value_retrieved ) FROM table_1 as t1 WHERE t1.as_of_date = ? GROUP BY col1;
true
ec65ace4569cef6ee302a4ce0df70bf37dca990d
SQL
robotunicorn/caketrek
/schema.sql
UTF-8
30,718
3.40625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le: Mer 30 Janvier 2013 à 15:53 -- Version du serveur: 5.5.24-log -- Version de PHP: 5.3.13 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données: `caketrek_default` -- -- -------------------------------------------------------- -- -- Structure de la table `badges` -- CREATE TABLE IF NOT EXISTS `badges` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` char(100) NOT NULL, `label` varchar(255) DEFAULT NULL, `description` text, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Contenu de la table `badges` -- INSERT INTO `badges` (`id`, `name`, `label`, `description`, `created`, `modified`) VALUES (1, 'rookie', 'Rookie', 'Premiers pas', NULL, NULL), (2, 'first_blood', 'First Blood', 'Première Journey qui a été annulée', NULL, NULL), (3, 'natural_born_leader', 'Natural Born Leader', 'A organisé plus de 10 journeys', NULL, NULL), (4, 'walker', 'Walker', 'A participé à au moins 5 journeys', NULL, NULL); -- -------------------------------------------------------- -- -- Structure de la table `badges_objects` -- CREATE TABLE IF NOT EXISTS `badges_objects` ( `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT, `badge_id` int(11) unsigned DEFAULT NULL, `object_id` int(11) unsigned DEFAULT NULL, `object` char(30) DEFAULT NULL, `created` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ; -- -- Contenu de la table `badges_objects` -- INSERT INTO `badges_objects` (`id`, `badge_id`, `object_id`, `object`, `created`) VALUES (21, 3, 2, 'Tourist', '2013-01-28 13:58:57'), (20, 2, 2, 'Tourist', '2013-01-28 13:58:57'), (29, 4, 1, 'Tourist', '2013-01-28 15:02:14'), (28, 1, 1, 'Tourist', '2013-01-28 15:02:14'), (26, 1, 1, 'Guide', '2013-01-28 15:01:34'), (27, 7, 2, 'Zone', '2013-01-28 15:01:50'); -- -------------------------------------------------------- -- -- Structure de la table `badges_users` -- CREATE TABLE IF NOT EXISTS `badges_users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `badge_id` int(10) unsigned DEFAULT NULL, `user_id` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; INSERT INTO `badges_users` (`id`, `badge_id`, `user_id`) VALUES (1, 1, 1), (2, 3, 1), (3, 3, 2), (4, 1, 4), (5, 2, 1); -- -- Contenu de la table `badges_users` -- # Dump of table groups # ------------------------------------------------------------ DROP TABLE IF EXISTS `groups`; CREATE TABLE `groups` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL DEFAULT '', `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; LOCK TABLES `groups` WRITE; /*!40000 ALTER TABLE `groups` DISABLE KEYS */; INSERT INTO `groups` (`id`, `name`, `created`, `modified`) VALUES (1,'admins','2013-01-29 15:49:11','2013-01-29 15:49:11'), (2,'tourists','2013-01-29 15:49:15','2013-01-29 15:49:15'), (3,'guides','2013-01-29 15:49:15','2013-01-29 15:49:15'), (4,'spammers','2013-01-29 15:49:15','2013-01-29 15:49:15'); /*!40000 ALTER TABLE `groups` ENABLE KEYS */; UNLOCK TABLES; # Dump of table friends # ------------------------------------------------------------ CREATE TABLE `friends` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `follower_id` int(11) unsigned NOT NULL, `following_id` int(11) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uq_following_follower` (`follower_id`,`following_id`), KEY `follower` (`follower_id`), KEY `following` (`following_id`) ) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `guides` -- CREATE TABLE IF NOT EXISTS `guides` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `slogan` varchar(200) DEFAULT NULL, `description` text, `tourist_id` int(11) DEFAULT NULL, `validated` tinyint(3) unsigned DEFAULT '0', `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Contenu de la table `guides` -- INSERT INTO `guides` (`id`, `slogan`, `description`, `tourist_id`, `validated`, `created`, `modified`) VALUES (1, 'il aime la montagne', '', 2, 1, '2013-01-27 16:31:08', '2013-01-27 16:31:26'), (2, 'Il aime les fleurs', 'Super Guide', 1, 1, '2013-01-29 16:08:50', '2013-01-29 16:08:50'); -- -------------------------------------------------------- -- -- Structure de la table `journeys` -- CREATE TABLE IF NOT EXISTS `journeys` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `tourist_id` int(11) unsigned DEFAULT NULL, `guide_id` int(11) unsigned DEFAULT NULL, `track_id` int(11) unsigned DEFAULT NULL, `zone_id` int(11) unsigned DEFAULT NULL, `name` varchar(200) DEFAULT NULL, `about` text, `body` text, `public` tinyint(3) unsigned DEFAULT '0', `crew` tinyint(4) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -- Contenu de la table `journeys` -- INSERT INTO `journeys` (`id`, `tourist_id`, `guide_id`, `track_id`, `zone_id`, `name`, `about`, `body`, `public`, `crew`, `created`, `modified`) VALUES (1, 1, 1, 1, 1, 'Découvrir Kham', 'gboh,,mpkpm', 'Vita est illis semper in fuga', 1, 1, '2013-01-28 17:46:09', '2013-01-30 14:59:45'), (4, NULL, NULL, 1, 2, 'Track 3', 'fezfefgzeg', 'ertyuh', 1, 48, '2013-01-29 16:16:07', '2013-01-29 16:33:26'), (12, NULL, NULL, 2, 2, 'Track 8', 'QsDG', NULL, 1, NULL, '2013-01-30 13:58:14', '2013-01-30 13:58:14'), (6, NULL, NULL, 2, 2, 'Track 5', 'zesrtfyguhj', 'yhujkl', 1, 32, '2013-01-30 10:25:57', '2013-01-30 15:37:06'), (11, NULL, NULL, 1, 1, 'Track 4', 'dzerty', NULL, 1, NULL, '2013-01-30 11:02:54', '2013-01-30 11:02:54'), (3, NULL, NULL, 2, 1, 'dsjd', 'hkjhkjh', 'sdshgjhg', 0, 99, '2013-01-29 14:42:53', '2013-01-29 16:19:22'), (9, NULL, NULL, 2, 2, 'Track 6', 'zsfergdhtf', 'gyhujkl', 1, 20, '2013-01-30 10:49:59', '2013-01-30 15:37:22'), (10, NULL, NULL, 2, 2, 'Track 7', 'zedrtyu', 'hjklm', 1, 20, '2013-01-30 10:54:00', '2013-01-30 15:37:30'); -- -------------------------------------------------------- -- -- Structure de la table `medias` -- CREATE TABLE IF NOT EXISTS `medias` ( `id` int(10) NOT NULL AUTO_INCREMENT, `ref` varchar(60) DEFAULT NULL, `ref_id` int(11) DEFAULT NULL, `file` varchar(255) DEFAULT NULL, `position` int(11) DEFAULT '0', PRIMARY KEY (`id`), KEY `ref` (`ref`), KEY `ref_id` (`ref_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Contenu de la table `medias` -- INSERT INTO `medias` (`id`, `ref`, `ref_id`, `file`, `position`) VALUES (1, 'Tourist', 1, '/uploads/2013/01/llv01.jpg', 0), (2, 'Tourist', 2, '/uploads/2013/01/llv02.JPG', 0), (3, 'Tourist', 1, '/profile/2013/1/1/1.jpg', 0), (4, 'Tourist', 1, '/uploads/profiles/2013/1/1/1.jpg', 0), (5, 'Tourist', 1, '/uploads/profiles/2013/1/1/1-1.jpg', 0); -- -------------------------------------------------------- -- -- Structure de la table `tourists` -- CREATE TABLE IF NOT EXISTS `tourists` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(100) DEFAULT NULL, `bio` text, `media_id` int(11) unsigned DEFAULT NULL, `user_id` int(11) unsigned DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Contenu de la table `tourists` -- INSERT INTO `tourists` (`id`, `first_name`, `last_name`, `bio`, `media_id`, `user_id`, `created`, `modified`) VALUES (1, 'Gaspard', 'Beernaert', 'Il aime les grandes plaines de neige, il veut un yak', 5, 1, NULL, '2013-01-28 15:02:14'), (2, 'Jo', 'Bo', 'Depuis tout petit, il aimait la glace à la chantilly', 2, 2, NULL, '2013-01-28 13:58:57'); -- -------------------------------------------------------- -- -- Structure de la table `tourists_friends` -- CREATE TABLE IF NOT EXISTS `tourists_friends` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `tourist_id` int(11) unsigned DEFAULT NULL, `friend_id` int(11) DEFAULT NULL, `status` char(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `tracks` -- CREATE TABLE IF NOT EXISTS `tracks` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `description` text NOT NULL, `duration` int(10) DEFAULT NULL, `zone_id` int(11) DEFAULT NULL, `journey_count` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Contenu de la table `tracks` -- INSERT INTO `tracks` (`id`, `name`, `description`, `duration`, `zone_id`, `journey_count`) VALUES (1, ' Kham', 'micum vel bellum patriae inferentem sequi; quod quidem, ut res ire coepit, haud scio an aliquando futurum sit. Mihi autem non minori curae est, qualis res publica post mortem meam futura, quam qualis hodie sit.', 3, 1, 3), (2, 'Tassili du Hoggar', 'non est sed potius supplicio omni vindicanda est, ut ne quis concessum putet amicum vel bellum patriae inferentem sequi; quod quidem, ut res ire coepit, haud scio an aliquando futurum sit. Mihi autem non minori curae est', 5, 2, 5); # Dump of table messages # ------------------------------------------------------------ CREATE TABLE `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `subject` varchar(150) NOT NULL, `message` longtext NOT NULL, `sender_id` int(11) NOT NULL, `receiver_id` int(11) NOT NULL, `date` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Contenu de la table `messages` -- INSERT INTO `messages` (`id`, `subject`, `message`, `sender_id`, `receiver_id`, `date`) VALUES (1, 'salut', 'ceci est un test', 2, 1, '2013-01-28 18:54:00'), (3, 'Vision d''horreur', 'As tu aperçus l''autre soir le petit poucet vert ?', 1, 4, '2013-01-28 19:58:00'), (4, 'Test coucou 2', 'ceci est un joli test', 2, 1, '2013-01-29 15:23:00'); -- -------------------------------------------------------- -- -- Structure de la table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(100) NOT NULL, `password` varchar(150) NOT NULL, `email` varchar(200) NOT NULL, `created` datetime DEFAULT NULL, `updated` datetime DEFAULT NULL, `group_id` int(11) DEFAULT '2', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` (`id`, `username`, `password`, `email`, `created`, `updated`, `group_id`) VALUES (1,'gasp','pass','gaspard@gmail.com','2013-01-24 13:29:28','2013-01-25 10:59:58',1), (2,'john','pass','jo@lamo.uk','2013-01-24 13:29:55','2013-01-24 16:30:15',NULL), (3,'martha','pass','martha@yahoo.com','2013-01-24 18:18:16','2013-01-24 18:18:16',NULL), (4,'joseph','pass','joseh@yahoo.com','2013-01-24 18:19:05','2013-01-24 18:19:05',NULL), (5,'veteran','pass','veteranmartha@yahoo.com','2013-01-24 18:19:34','2013-01-24 18:19:34',NULL), (6,'patrick','pass','patrick@yahoo.com','2013-01-24 18:20:25','2013-01-24 18:20:25',NULL), (7,'emile','pass','emile@yahoo.com','2013-01-24 18:57:35',NULL,NULL), (8,'ernesto','pass','ernesto@yahoo.com','2013-01-24 18:57:49',NULL,NULL), (9,'peter','pass','peter@yahoo.com','2013-01-24 18:57:53',NULL,NULL), (10,'beber','pass','beber@yahoo.com','2013-01-24 18:57:57',NULL,NULL), (11,'jack','pass','jack@yahoo.com','2013-01-24 18:58:00',NULL,NULL), (12,'greg','pass','greg@yahoo.com','2013-01-24 18:58:15',NULL,NULL), (13,'emilio','pass','emilio@yahoo.com','2013-01-24 18:58:29',NULL,NULL), (14,'michael','pass','michael@yahoo.com','2013-01-24 18:58:45',NULL,NULL), (15,'juan','pass','juan@yahoo.com','2013-01-24 18:59:07',NULL,NULL), (16,'wolfgang','pass','wolfgang@yahoo.com','2013-01-24 18:59:21',NULL,NULL), (17,'dieter','pass','dieter@yahoo.com','2013-01-24 18:59:41',NULL,NULL), (18,'sam','pass','sam@yahoo.com','2013-01-24 18:59:51',NULL,NULL), (19,'micah','pass','micah@yahoo.com','2013-01-24 19:00:06',NULL,NULL), (20,'ferdinand','pass','ferdinand@yahoo.com','2013-01-24 19:00:33',NULL,NULL), (21,'jekyll','pass','jekyll@yahoo.com','2013-01-24 19:00:49',NULL,NULL), (22,'hide','pass','hide@yahoo.com','2013-01-24 19:01:32',NULL,NULL), (23,'sergey','pass','sergey@yahoo.com','2013-01-24 19:33:30','2013-01-24 19:33:30',NULL), (24,'maria','pass','maria@yahoo.com','2013-01-24 19:36:44','2013-01-24 19:36:44',NULL), (25,'admin','5751c23ea765ca65fd4c2e7f4aae4b7189bc5587','admin@admin.com','2013-01-29 15:50:59','2013-01-29 15:50:59',1), (26,'user','679befe1c3f6278a9c6be45eab1ff4d1249424ef','user@user.net','2013-01-29 15:53:37','2013-01-29 15:53:37',2); /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES; # Dump of table zones # ------------------------------------------------------------ DROP TABLE IF EXISTS `zones`; CREATE TABLE `zones` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `description` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `zones` (`id`, `name`, `description`) VALUES (1, 'Tibet oriental', 'Quare talis improborum consensio non modo excusatione amicitiae tegenda non est sed potius'), (2, ' Sahara algérien', 'supplicio omni vindicanda est, ut ne quis concessum putet amicum vel bellum patriae inferentem sequi; quod quidem, ut res ire coepit, haud scio a'); # notifications by valou DROP TABLE IF EXISTS `notifications`; CREATE TABLE `notifications` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `type` char(160) DEFAULT NULL, `tourist_id` int(11) DEFAULT NULL, `link` varchar(200) DEFAULT NULL, `created` timestamp NULL DEFAULT NULL, `viewed` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `comments`; CREATE TABLE `comments` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `comment` text, `note` int(11) DEFAULT NULL, `created` datetime DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `object_id` int(11) DEFAULT NULL, `object_type` char(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `journeys_tourists` -- CREATE TABLE IF NOT EXISTS `journeys_tourists` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `journey_id` int(11) DEFAULT NULL, `tourist_id` int(11) DEFAULT NULL, `status` tinyint(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; -- -- Contenu de la table `journeys_tourists` -- INSERT INTO `journeys_tourists` (`id`, `journey_id`, `tourist_id`, `status`) VALUES (3, 1, 1, NULL), (4, 2, 7, NULL), (5, 3, 2, NULL), (7, 1, 7, NULL); ======= -- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le: Mer 30 Janvier 2013 à 15:53 -- Version du serveur: 5.5.24-log -- Version de PHP: 5.3.13 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données: `caketrek_default` -- -- -------------------------------------------------------- -- -- Structure de la table `badges` -- CREATE TABLE IF NOT EXISTS `badges` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` char(100) NOT NULL, `label` varchar(255) DEFAULT NULL, `description` text, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Contenu de la table `badges` -- INSERT INTO `badges` (`id`, `name`, `label`, `description`, `created`, `modified`) VALUES (1, 'rookie', 'Rookie', 'Premiers pas', NULL, NULL), (2, 'first_blood', 'First Blood', 'Première Journey qui a été annulée', NULL, NULL), (3, 'natural_born_leader', 'Natural Born Leader', 'A organisé plus de 10 journeys', NULL, NULL), (4, 'walker', 'Walker', 'A participé à au moins 5 journeys', NULL, NULL); -- -------------------------------------------------------- -- -- Structure de la table `badges_objects` -- CREATE TABLE IF NOT EXISTS `badges_objects` ( `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT, `badge_id` int(11) unsigned DEFAULT NULL, `object_id` int(11) unsigned DEFAULT NULL, `object` char(30) DEFAULT NULL, `created` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ; -- -- Contenu de la table `badges_objects` -- INSERT INTO `badges_objects` (`id`, `badge_id`, `object_id`, `object`, `created`) VALUES (21, 3, 2, 'Tourist', '2013-01-28 13:58:57'), (20, 2, 2, 'Tourist', '2013-01-28 13:58:57'), (29, 4, 1, 'Tourist', '2013-01-28 15:02:14'), (28, 1, 1, 'Tourist', '2013-01-28 15:02:14'), (26, 1, 1, 'Guide', '2013-01-28 15:01:34'), (27, 7, 2, 'Zone', '2013-01-28 15:01:50'); -- -------------------------------------------------------- -- -- Structure de la table `badges_users` -- CREATE TABLE IF NOT EXISTS `badges_users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `badge_id` int(10) unsigned DEFAULT NULL, `user_id` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; INSERT INTO `badges_users` (`id`, `badge_id`, `user_id`) VALUES (1, 1, 1), (2, 3, 1), (3, 3, 2), (4, 1, 4), (5, 2, 1); -- -- Contenu de la table `badges_users` -- # Dump of table groups # ------------------------------------------------------------ DROP TABLE IF EXISTS `groups`; CREATE TABLE `groups` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL DEFAULT '', `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; LOCK TABLES `groups` WRITE; /*!40000 ALTER TABLE `groups` DISABLE KEYS */; INSERT INTO `groups` (`id`, `name`, `created`, `modified`) VALUES (1,'admins','2013-01-29 15:49:11','2013-01-29 15:49:11'), (2,'tourists','2013-01-29 15:49:15','2013-01-29 15:49:15'), (3,'guides','2013-01-29 15:49:15','2013-01-29 15:49:15'), (4,'spammers','2013-01-29 15:49:15','2013-01-29 15:49:15'); /*!40000 ALTER TABLE `groups` ENABLE KEYS */; UNLOCK TABLES; # Dump of table friends # ------------------------------------------------------------ CREATE TABLE `friends` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `follower_id` int(11) unsigned NOT NULL, `following_id` int(11) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uq_following_follower` (`follower_id`,`following_id`), KEY `follower` (`follower_id`), KEY `following` (`following_id`) ) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `guides` -- CREATE TABLE IF NOT EXISTS `guides` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `slogan` varchar(200) DEFAULT NULL, `description` text, `tourist_id` int(11) DEFAULT NULL, `validated` tinyint(3) unsigned DEFAULT '0', `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Contenu de la table `guides` -- INSERT INTO `guides` (`id`, `slogan`, `description`, `tourist_id`, `validated`, `created`, `modified`) VALUES (1, 'il aime la montagne', '', 2, 1, '2013-01-27 16:31:08', '2013-01-27 16:31:26'), (2, 'Il aime les fleurs', 'Super Guide', 1, 1, '2013-01-29 16:08:50', '2013-01-29 16:08:50'); -- -------------------------------------------------------- -- -- Structure de la table `journeys` -- CREATE TABLE IF NOT EXISTS `journeys` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `tourist_id` int(11) unsigned DEFAULT NULL, `guide_id` int(11) unsigned DEFAULT NULL, `track_id` int(11) unsigned DEFAULT NULL, `zone_id` int(11) unsigned DEFAULT NULL, `name` varchar(200) DEFAULT NULL, `about` text, `body` text, `public` tinyint(3) unsigned DEFAULT '0', `crew` tinyint(4) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -- Contenu de la table `journeys` -- INSERT INTO `journeys` (`id`, `tourist_id`, `guide_id`, `track_id`, `zone_id`, `name`, `about`, `body`, `public`, `crew`, `created`, `modified`) VALUES (1, 1, 1, 1, 1, 'Découvrir Kham', 'gboh,,mpkpm', 'Vita est illis semper in fuga', 1, 1, '2013-01-28 17:46:09', '2013-01-30 14:59:45'), (4, NULL, NULL, 1, 2, 'Track 3', 'fezfefgzeg', 'ertyuh', 1, 48, '2013-01-29 16:16:07', '2013-01-29 16:33:26'), (12, NULL, NULL, 2, 2, 'Track 8', 'QsDG', NULL, 1, NULL, '2013-01-30 13:58:14', '2013-01-30 13:58:14'), (6, NULL, NULL, 2, 2, 'Track 5', 'zesrtfyguhj', 'yhujkl', 1, 32, '2013-01-30 10:25:57', '2013-01-30 15:37:06'), (11, NULL, NULL, 1, 1, 'Track 4', 'dzerty', NULL, 1, NULL, '2013-01-30 11:02:54', '2013-01-30 11:02:54'), (3, NULL, NULL, 2, 1, 'dsjd', 'hkjhkjh', 'sdshgjhg', 0, 99, '2013-01-29 14:42:53', '2013-01-29 16:19:22'), (9, NULL, NULL, 2, 2, 'Track 6', 'zsfergdhtf', 'gyhujkl', 1, 20, '2013-01-30 10:49:59', '2013-01-30 15:37:22'), (10, NULL, NULL, 2, 2, 'Track 7', 'zedrtyu', 'hjklm', 1, 20, '2013-01-30 10:54:00', '2013-01-30 15:37:30'); -- -------------------------------------------------------- -- -- Structure de la table `medias` -- CREATE TABLE IF NOT EXISTS `medias` ( `id` int(10) NOT NULL AUTO_INCREMENT, `ref` varchar(60) DEFAULT NULL, `ref_id` int(11) DEFAULT NULL, `file` varchar(255) DEFAULT NULL, `position` int(11) DEFAULT '0', PRIMARY KEY (`id`), KEY `ref` (`ref`), KEY `ref_id` (`ref_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Contenu de la table `medias` -- INSERT INTO `medias` (`id`, `ref`, `ref_id`, `file`, `position`) VALUES (1, 'Tourist', 1, '/uploads/2013/01/llv01.jpg', 0), (2, 'Tourist', 2, '/uploads/2013/01/llv02.JPG', 0), (3, 'Tourist', 1, '/profile/2013/1/1/1.jpg', 0), (4, 'Tourist', 1, '/uploads/profiles/2013/1/1/1.jpg', 0), (5, 'Tourist', 1, '/uploads/profiles/2013/1/1/1-1.jpg', 0); -- -------------------------------------------------------- -- -- Structure de la table `tourists` -- CREATE TABLE IF NOT EXISTS `tourists` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(100) DEFAULT NULL, `bio` text, `media_id` int(11) unsigned DEFAULT NULL, `user_id` int(11) unsigned DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Contenu de la table `tourists` -- INSERT INTO `tourists` (`id`, `first_name`, `last_name`, `bio`, `media_id`, `user_id`, `created`, `modified`) VALUES (1, 'Gaspard', 'Beernaert', 'Il aime les grandes plaines de neige, il veut un yak', 5, 1, NULL, '2013-01-28 15:02:14'), (2, 'Jo', 'Bo', 'Depuis tout petit, il aimait la glace à la chantilly', 2, 2, NULL, '2013-01-28 13:58:57'); -- -------------------------------------------------------- -- -- Structure de la table `tourists_friends` -- CREATE TABLE IF NOT EXISTS `tourists_friends` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `tourist_id` int(11) unsigned DEFAULT NULL, `friend_id` int(11) DEFAULT NULL, `status` char(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `tracks` -- CREATE TABLE IF NOT EXISTS `tracks` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `description` text NOT NULL, `duration` int(10) DEFAULT NULL, `zone_id` int(11) DEFAULT NULL, `journey_count` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Contenu de la table `tracks` -- INSERT INTO `tracks` (`id`, `name`, `description`, `duration`, `zone_id`, `journey_count`) VALUES (1, ' Kham', 'micum vel bellum patriae inferentem sequi; quod quidem, ut res ire coepit, haud scio an aliquando futurum sit. Mihi autem non minori curae est, qualis res publica post mortem meam futura, quam qualis hodie sit.', 3, 1, 3), (2, 'Tassili du Hoggar', 'non est sed potius supplicio omni vindicanda est, ut ne quis concessum putet amicum vel bellum patriae inferentem sequi; quod quidem, ut res ire coepit, haud scio an aliquando futurum sit. Mihi autem non minori curae est', 5, 2, 5); # Dump of table messages # ------------------------------------------------------------ CREATE TABLE `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `subject` varchar(150) NOT NULL, `message` longtext NOT NULL, `sender_id` int(11) NOT NULL, `receiver_id` int(11) NOT NULL, `date` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Contenu de la table `messages` -- INSERT INTO `messages` (`id`, `subject`, `message`, `sender_id`, `receiver_id`, `date`) VALUES (1, 'salut', 'ceci est un test', 2, 1, '2013-01-28 18:54:00'), (3, 'Vision d''horreur', 'As tu aperçus l''autre soir le petit poucet vert ?', 1, 4, '2013-01-28 19:58:00'), (4, 'Test coucou 2', 'ceci est un joli test', 2, 1, '2013-01-29 15:23:00'); -- -------------------------------------------------------- -- -- Structure de la table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(100) NOT NULL, `password` varchar(150) NOT NULL, `email` varchar(200) NOT NULL, `created` datetime DEFAULT NULL, `updated` datetime DEFAULT NULL, `group_id` int(11) DEFAULT '2', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` (`id`, `username`, `password`, `email`, `created`, `updated`, `group_id`) VALUES (1,'gasp','pass','gaspard@gmail.com','2013-01-24 13:29:28','2013-01-25 10:59:58',1), (2,'john','pass','jo@lamo.uk','2013-01-24 13:29:55','2013-01-24 16:30:15',NULL), (3,'martha','pass','martha@yahoo.com','2013-01-24 18:18:16','2013-01-24 18:18:16',NULL), (4,'joseph','pass','joseh@yahoo.com','2013-01-24 18:19:05','2013-01-24 18:19:05',NULL), (5,'veteran','pass','veteranmartha@yahoo.com','2013-01-24 18:19:34','2013-01-24 18:19:34',NULL), (6,'patrick','pass','patrick@yahoo.com','2013-01-24 18:20:25','2013-01-24 18:20:25',NULL), (7,'emile','pass','emile@yahoo.com','2013-01-24 18:57:35',NULL,NULL), (8,'ernesto','pass','ernesto@yahoo.com','2013-01-24 18:57:49',NULL,NULL), (9,'peter','pass','peter@yahoo.com','2013-01-24 18:57:53',NULL,NULL), (10,'beber','pass','beber@yahoo.com','2013-01-24 18:57:57',NULL,NULL), (11,'jack','pass','jack@yahoo.com','2013-01-24 18:58:00',NULL,NULL), (12,'greg','pass','greg@yahoo.com','2013-01-24 18:58:15',NULL,NULL), (13,'emilio','pass','emilio@yahoo.com','2013-01-24 18:58:29',NULL,NULL), (14,'michael','pass','michael@yahoo.com','2013-01-24 18:58:45',NULL,NULL), (15,'juan','pass','juan@yahoo.com','2013-01-24 18:59:07',NULL,NULL), (16,'wolfgang','pass','wolfgang@yahoo.com','2013-01-24 18:59:21',NULL,NULL), (17,'dieter','pass','dieter@yahoo.com','2013-01-24 18:59:41',NULL,NULL), (18,'sam','pass','sam@yahoo.com','2013-01-24 18:59:51',NULL,NULL), (19,'micah','pass','micah@yahoo.com','2013-01-24 19:00:06',NULL,NULL), (20,'ferdinand','pass','ferdinand@yahoo.com','2013-01-24 19:00:33',NULL,NULL), (21,'jekyll','pass','jekyll@yahoo.com','2013-01-24 19:00:49',NULL,NULL), (22,'hide','pass','hide@yahoo.com','2013-01-24 19:01:32',NULL,NULL), (23,'sergey','pass','sergey@yahoo.com','2013-01-24 19:33:30','2013-01-24 19:33:30',NULL), (24,'maria','pass','maria@yahoo.com','2013-01-24 19:36:44','2013-01-24 19:36:44',NULL), (25,'admin','5751c23ea765ca65fd4c2e7f4aae4b7189bc5587','admin@admin.com','2013-01-29 15:50:59','2013-01-29 15:50:59',1), (26,'user','679befe1c3f6278a9c6be45eab1ff4d1249424ef','user@user.net','2013-01-29 15:53:37','2013-01-29 15:53:37',2); /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES; # Dump of table zones # ------------------------------------------------------------ DROP TABLE IF EXISTS `zones`; CREATE TABLE `zones` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `description` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `zones` (`id`, `name`, `description`) VALUES (1, 'Tibet oriental', 'Quare talis improborum consensio non modo excusatione amicitiae tegenda non est sed potius'), (2, ' Sahara algérien', 'supplicio omni vindicanda est, ut ne quis concessum putet amicum vel bellum patriae inferentem sequi; quod quidem, ut res ire coepit, haud scio a'); # notifications by valou DROP TABLE IF EXISTS `notifications`; CREATE TABLE `notifications` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `type` char(160) DEFAULT NULL, `tourist_id` int(11) DEFAULT NULL, `link` varchar(200) DEFAULT NULL, `created` timestamp NULL DEFAULT NULL, `viewed` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `comments`; CREATE TABLE `comments` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `comment` text, `note` int(11) DEFAULT NULL, `created` datetime DEFAULT NULL, `tourist_id` int(11) DEFAULT NULL, `object_id` int(11) DEFAULT NULL, `object_type` char(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;
true
b9eabd5bf029997449cd36f86cb7be074a9e5c32
SQL
SARWARISSAM/coke
/Database file/library.sql
UTF-8
7,596
2.96875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Aug 02, 2018 at 06:19 AM -- Server version: 10.1.16-MariaDB -- PHP Version: 5.6.24 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: `library` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `id` int(11) NOT NULL, `FullName` varchar(100) DEFAULT NULL, `AdminEmail` varchar(120) DEFAULT NULL, `UserName` varchar(100) NOT NULL, `Password` varchar(100) NOT NULL, `updationDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `FullName`, `AdminEmail`, `UserName`, `Password`, `updationDate`) VALUES (1, 'Sarwar Alam', 'ansarisarwar97@gmail.com', 'admin', '21232f297a57a5a743894a0e4a801fc3', '2018-06-07 09:44:38'); -- -------------------------------------------------------- -- -- Table structure for table `moderator` -- CREATE TABLE `moderator` ( `id` int(11) NOT NULL, `UserName` varchar(100) NOT NULL, `Password` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `moderator` -- INSERT INTO `moderator` (`id`, `UserName`, `Password`) VALUES (1, 'moderator', 'mode'); -- -------------------------------------------------------- -- -- Table structure for table `tblemployees` -- CREATE TABLE `tblemployees` ( `id` int(11) NOT NULL, `EmployeeID` varchar(100) DEFAULT NULL, `FullName` varchar(120) DEFAULT NULL, `EmailId` varchar(120) DEFAULT NULL, `MobileNumber` char(11) DEFAULT NULL, `Password` varchar(120) DEFAULT NULL, `Status` int(1) DEFAULT NULL, `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `UpdationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblemployees` -- INSERT INTO `tblemployees` (`id`, `EmployeeID`, `FullName`, `EmailId`, `MobileNumber`, `Password`, `Status`, `RegDate`, `UpdationDate`) VALUES (15, '2', 'Neha Singh', 'neha@gmail.com', '1234567890', '262f5bdd0af9098e7443ab1f8e435290', 1, '2018-05-30 03:31:29', '2018-07-02 16:41:26'), (16, '3', 'Sam Wilson', 'sam@gmail.com', '7867867867', '332532dcfaa1cbf61e2a266bd723612c', 1, '2018-06-14 16:38:50', '2018-06-20 11:10:31'), (18, '4', 'Mintu', 'mintu@gmail.com', '1234567890', '5151d92e23889564623a29b431f66e24', 0, '2018-06-17 10:26:11', '2018-07-18 05:38:10'), (19, '5', 'Sundar', 'sun@gmail.com', '1236547890', 'ebd556e6dfc99dbed29675ce1c6c68e5', 1, '2018-06-17 11:22:36', '2018-06-17 12:18:16'), (20, '6', 'Maneesh Sagar', 'man@gmail.com', '7867864545', '39c63ddb96a31b9610cd976b896ad4f0', 0, '2018-06-19 14:41:35', '2018-06-25 16:47:13'), (21, '7', 'M S DHONI', 'msd@gmail.com', '7525827455', 'b0f2169aa609c42c1bc96d4aa5da3aea', 1, '2018-06-25 15:19:42', NULL), (22, '8', 'Shivam Verma', 'shivam@gmail.com', '7525877944', '3ae9d8799d1bb5e201e5704293bb54ef', 1, '2018-07-02 16:53:48', '2018-07-12 04:13:32'), (23, '9', 'sanjay', 'sanjusastri1008@gmail.com', '7379407904', '103534e87b05d67f52aacd44d2c9037b', 1, '2018-07-18 04:41:33', NULL); -- -------------------------------------------------------- -- -- Table structure for table `tblissuedworkdetails` -- CREATE TABLE `tblissuedworkdetails` ( `id` int(11) NOT NULL, `EmpID` int(10) NOT NULL, `Task` varchar(120) DEFAULT NULL, `Employee` varchar(150) DEFAULT NULL, `IssuesDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `ReturnDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `RetrunStatus` int(1) NOT NULL, `fine` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblissuedworkdetails` -- INSERT INTO `tblissuedworkdetails` (`id`, `EmpID`, `Task`, `Employee`, `IssuesDate`, `ReturnDate`, `RetrunStatus`, `fine`) VALUES (63, 15, 'Python', 'Neha Singh', '2018-06-19 04:35:48', '2018-06-25 15:15:00', 0, NULL), (72, 18, 'C', 'Mintu', '2018-06-19 14:08:53', NULL, 0, NULL), (79, 16, 'UPNIC', 'Sam', '2018-06-19 17:12:15', NULL, 0, NULL), (81, 15, 'J2EE', 'Neha Singh', '2018-06-20 11:37:50', '2018-06-25 12:09:22', 0, NULL), (82, 15, '.NET', 'Neha Singh', '2018-06-25 15:18:15', NULL, 0, NULL), (83, 19, 'Python', 'Sundar', '2018-06-25 15:18:40', '2018-07-18 04:46:54', 0, NULL), (84, 21, 'Python', 'M S DHONI', '2018-06-25 15:20:36', NULL, 0, NULL), (85, 16, 'J2EE', 'Sam Wilson', '2018-06-26 17:10:50', NULL, 0, NULL), (87, 21, 'C', 'M S DHONI', '2018-07-02 05:50:36', NULL, 0, NULL), (88, 22, 'UPSC', 'Shivam Verma', '2018-07-12 03:35:11', NULL, 0, NULL), (89, 22, '.NET', 'Shivam Verma', '2018-07-12 04:11:56', '2018-07-12 04:12:42', 0, NULL), (90, 16, 'Python', 'Sam Wilson', '2018-08-02 03:51:19', NULL, 0, NULL); -- -------------------------------------------------------- -- -- Table structure for table `tblwork` -- CREATE TABLE `tblwork` ( `id` int(11) NOT NULL, `WorkName` varchar(255) DEFAULT NULL, `WorkId` int(11) DEFAULT NULL, `WorkPrice` int(11) DEFAULT NULL, `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `UpdationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblwork` -- INSERT INTO `tblwork` (`id`, `WorkName`, `WorkId`, `WorkPrice`, `RegDate`, `UpdationDate`) VALUES (3, 'Python', 100, 15, '2017-07-08 20:17:31', '2018-06-17 11:46:06'), (4, 'UPNIC', 101, NULL, '2018-05-28 09:07:42', NULL), (5, 'UPSC', 102, NULL, '2018-05-28 09:08:03', NULL), (6, '.NET', 103, NULL, '2018-06-17 11:46:50', NULL), (7, 'C', 104, 50, '2018-06-19 09:23:02', NULL), (8, 'J2EE', 105, 1500, '2018-06-20 11:36:18', NULL), (9, 'ML using R', 106, 2000, '2018-07-03 06:52:43', NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `moderator` -- ALTER TABLE `moderator` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tblemployees` -- ALTER TABLE `tblemployees` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `StudentId` (`EmployeeID`); -- -- Indexes for table `tblissuedworkdetails` -- ALTER TABLE `tblissuedworkdetails` ADD PRIMARY KEY (`id`), ADD KEY `EmpID` (`EmpID`); -- -- Indexes for table `tblwork` -- ALTER TABLE `tblwork` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `moderator` -- ALTER TABLE `moderator` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tblemployees` -- ALTER TABLE `tblemployees` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `tblissuedworkdetails` -- ALTER TABLE `tblissuedworkdetails` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=91; -- -- AUTO_INCREMENT for table `tblwork` -- ALTER TABLE `tblwork` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- Constraints for dumped tables -- -- -- Constraints for table `tblissuedworkdetails` -- ALTER TABLE `tblissuedworkdetails` ADD CONSTRAINT `tblissuedworkdetails_ibfk_1` FOREIGN KEY (`EmpID`) REFERENCES `tblemployees` (`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
314da35b2191be63238f3ebb32b1f0cb4ab0b7be
SQL
falent05/cscripts
/cs_rsrc_mgr_update.sql
UTF-8
4,675
2.609375
3
[]
no_license
---------------------------------------------------------------------------------------- -- -- File name: dbrmu.sql | cs_rsrc_mgr_update.sql -- -- Purpose: Database Resource Manager (DBRM) Update -- -- Author: Carlos Sierra -- -- Version: 2020/12/16 -- -- Usage: Execute connected to CDB or PDB. -- -- Example: $ sqlplus / as sysdba -- SQL> @cs_rsrc_mgr_update.sql -- -- Notes: Developed and tested on 12.1.0.2. -- --------------------------------------------------------------------------------------- -- @@cs_internal/cs_primary.sql @@cs_internal/cs_cdb_warn.sql @@cs_internal/cs_set.sql @@cs_internal/cs_def.sql @@cs_internal/cs_file_prefix.sql -- DEF cs_script_name = 'cs_rsrc_mgr_update'; DEF cs_script_acronym = 'dbrmu.sql | '; -- DEF cs_parallel_server_limit = '50'; DEF default_utilization_limit = '8'; DEF default_shares = '4'; DEF default_days_to_expire = '7'; DEF min_utilization_limit = '4'; DEF max_utilization_limit = '96'; DEF min_shares = '1'; DEF max_shares = '16'; DEF min_days_to_expire = '0'; DEF max_days_to_expire = '365'; -- COL pdb_name NEW_V pdb_name FOR A30; ALTER SESSION SET container = CDB$ROOT; -- @@cs_internal/cs_rsrc_mgr_internal_set.sql @@cs_internal/cs_rsrc_mgr_internal_configuration.sql @@cs_internal/cs_rsrc_mgr_internal_directives.sql -- PRO PRO 1. Enter Pluggable Database name: DEF cs_pluggable_database = '&1.'; UNDEF 1; COL cs_pluggable_database NEW_V cs_pluggable_database NOPRI; SELECT UPPER(TRIM('&&cs_pluggable_database.')) AS cs_pluggable_database FROM DUAL; PRO PRO 2. Enter CPU Utilization Limit: [{&&default_utilization_limit.}|&&min_utilization_limit.-&&max_utilization_limit.] DEF new_utilization_limit = '&2.'; UNDEF 2; COL new_utilization_limit NEW_V new_utilization_limit NOPRI; SELECT TO_CHAR(LEAST(GREATEST(TO_NUMBER(COALESCE('&&new_utilization_limit.','&&default_utilization_limit.')), &&min_utilization_limit.), &&max_utilization_limit.)) AS new_utilization_limit FROM DUAL; PRO PRO 3. Enter Shares: [{&&default_shares.}|&&min_shares.-&&max_shares.] DEF new_shares = '&3.'; UNDEF 3; COL new_shares NEW_V new_shares NOPRI; SELECT TO_CHAR(LEAST(GREATEST(TO_NUMBER(COALESCE('&&new_shares.','&&default_shares.')), &&min_shares.), &&max_shares.)) AS new_shares FROM DUAL; PRO PRO 4. Enter Days to Expire: [{&&default_days_to_expire.}|&&min_days_to_expire.-&&max_days_to_expire.] DEF days_to_expire = '&4.'; UNDEF 4; COL days_to_expire NEW_V days_to_expire NOPRI; SELECT TO_CHAR(LEAST(GREATEST(TO_NUMBER(COALESCE('&&days_to_expire.','&&default_days_to_expire.')), &&min_days_to_expire.), &&max_days_to_expire.)) days_to_expire FROM DUAL; -- EXEC c##iod.iod_rsrc_mgr.update_cdb_plan_directive(p_plan => '&&resource_manager_plan.', p_pluggable_database => '&&cs_pluggable_database.', p_shares => TO_NUMBER('&&new_shares.'), p_utilization_limit => TO_NUMBER('&&new_utilization_limit.'), p_parallel_server_limit => '&&cs_parallel_server_limit.', p_comment => '&&cs_reference.'); -- MERGE INTO c##iod.rsrc_mgr_pdb_config t USING (SELECT '&&resource_manager_plan.' plan, '&&cs_pluggable_database.' pdb_name, TO_NUMBER('&&new_shares.') shares, TO_NUMBER('&&new_utilization_limit.') utilization_limit, TO_NUMBER('&&cs_parallel_server_limit.') parallel_server_limit, SYSDATE + TO_NUMBER('&&days_to_expire.') end_date, '&&cs_reference.' reference FROM DUAL) s ON (t.plan = s.plan AND t.pdb_name = s.pdb_name) WHEN MATCHED THEN UPDATE SET t.shares = s.shares, t.utilization_limit = s.utilization_limit, t.parallel_server_limit = s.parallel_server_limit, t.end_date = s.end_date, t.reference = s.reference WHEN NOT MATCHED THEN INSERT (plan, pdb_name, shares, utilization_limit, parallel_server_limit, end_date, reference) VALUES (s.plan, s.pdb_name, s.shares, s.utilization_limit, s.parallel_server_limit, s.end_date, s.reference) / COMMIT; -- SELECT '&&cs_file_prefix._&&cs_script_name.' cs_file_name FROM DUAL; -- @@cs_internal/cs_spool_head.sql PRO SQL> @&&cs_script_name..sql "&&cs_pluggable_database." "&&new_utilization_limit." "&&new_shares." "&&days_to_expire." @@cs_internal/cs_spool_id.sql -- PRO PDB_NAME : &&cs_pluggable_database. PRO UTILIZATION : &&new_utilization_limit. PRO SHARES : &&new_shares. PRO EXPIRE_IN : &&days_to_expire. day(s) -- @@cs_internal/cs_rsrc_mgr_internal_history.sql @@cs_internal/cs_rsrc_mgr_internal_directives.sql @@cs_internal/cs_rsrc_mgr_internal_configuration.sql -- PRO PRO SQL> @&&cs_script_name..sql "&&cs_pluggable_database." "&&new_utilization_limit." "&&new_shares." "&&days_to_expire." -- @@cs_internal/cs_spool_tail.sql -- ALTER SESSION SET CONTAINER = &&cs_con_name.; -- @@cs_internal/cs_undef.sql @@cs_internal/cs_reset.sql --
true
ca816903a0853baff70526dd5c3e8e5a09253a8e
SQL
Njoki254/News-Portal
/create.sql
UTF-8
463
2.6875
3
[ "MIT" ]
permissive
CREATE DATABASE news_portal; \c news_portal; CREATE TABLE news(id serial PRIMARY KEY, content VARCHAR, publisher VARCHAR); CREATE TABLE department_news(id serial PRIMARY KEY, content VARCHAR, publisher VARCHAR, departmentId INTEGER); CREATE TABLE users(id serial PRIMARY KEY, position VARCHAR, role VARCHAR, department VARCHAR); CREATE TABLE departments(id serial PRIMARY KEY, departmentId INTEGER); CREATE DATABASE news_portal_test WITH TEMPLATE news_portal;
true
8e32b8a3f89e2ee08f1b0a4bc97c4918d092c3f3
SQL
yenesey/Synapse
/tasks/Отчет по доходности в разрезе карт продуктов.sql
UTF-8
4,681
3.3125
3
[]
no_license
SELECT ID, /* Поля для доп. информации */ PRODUCT_NAME, PRODUCT_CODE_PC, PAN, DATE_BEGIN, DATE_CLOSE, STATE, (CASE WHEN lower(PRODUCT_NAME) like '%mfk%' or lower(PRODUCT_NAME) like '%мфк%' THEN 1 ELSE 0 END) MFK, (CASE WHEN lower(PRODUCT_NAME) like '%зарплат%' or lower(PRODUCT_NAME) like '%zp%' or lower(PRODUCT_NAME) like '%зп%' or lower(PRODUCT_NAME) like '%сотрудник%' THEN 1 ELSE 0 END) ZP, /* Ранжирование карт по продуктам в отчете. 1 - может стоять только в одном из идущих ниже полей, остальные поля должны быть - 0 Проверка правильности отнесения карт: select * from V_CARDS_BY_PRODUCTS where (MIR + VISA_ELECTRON + VISA_CLASSIC + VISA_GOLD + VISA_PLATINUM + VISA_INFINITE + VISA_K_N + MC_MAESTRO_EXPRESS + MC_EXPRESS + MC_STD_PAYPASS + MC_GOLD + MC_CLOCK + MC_WORLD_ELITE + MC_PLATINUM + MC_K_N + MC_ART) != 1 */ (CASE WHEN lower(PRODUCT_NAME) like '%мир%' THEN 1 ELSE 0 END) MIR, (CASE WHEN lower(PRODUCT_NAME) like '%visa%electron%' THEN 1 ELSE 0 END) VISA_ELECTRON, (CASE WHEN lower(PRODUCT_NAME) like '%visa%' and (lower(PRODUCT_NAME) like '%classic%' or lower(PRODUCT_NAME) like '%visa paywave%') THEN 1 ELSE 0 END) VISA_CLASSIC, (CASE WHEN lower(PRODUCT_NAME) like '%visa%gold%' and lower(PRODUCT_NAME) not like '%купил-накопил%' THEN 1 ELSE 0 END) VISA_GOLD, (CASE WHEN lower(PRODUCT_NAME) like '%visa%platinum%' THEN 1 ELSE 0 END) VISA_PLATINUM, (CASE WHEN lower(PRODUCT_NAME) like '%visa%infinite%' THEN 1 ELSE 0 END) VISA_INFINITE, (CASE WHEN lower(PRODUCT_NAME) like '%visa%' and lower(PRODUCT_NAME) like '%купил-накопил%' THEN 1 ELSE 0 END) VISA_K_N, (CASE WHEN lower(PRODUCT_NAME) like '%maestro%express%' or lower(PRODUCT_NAME) like '%cirrus maestro%' THEN 1 ELSE 0 END) MC_MAESTRO_EXPRESS, (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and lower(PRODUCT_NAME) like '%express%' THEN 1 ELSE 0 END) MC_EXPRESS, /* (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and lower(PRODUCT_NAME) not like '%express%' and ( lower(PRODUCT_NAME) like '%paypass%' or lower(PRODUCT_NAME) like '%stand%' or lower(PRODUCT_NAME) like '%корп. карта на представительские расходы%' ) THEN 1 ELSE 0 END) MC_STD_PAYPASS,*/ (CASE WHEN lower(PRODUCT_NAME) not like '%express%' and regexp_like(lower(PRODUCT_NAME), 'mastercard paypass prepaid rur|mastercard stand|mc paypass standart|mcard standart paypass|корп. карта на представительские расходы') THEN 1 ELSE 0 END) MC_STD_PAYPASS, (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and lower(PRODUCT_NAME) like '%gold%' and lower(PRODUCT_NAME) not like '%купил-накопил%' /*and not ( lower(PRODUCT_NAME) like '%paypass%' or lower(PRODUCT_NAME) like '%stand%' or lower(PRODUCT_NAME) like '%корп. карта на представительские расходы%' )*/ THEN 1 ELSE 0 END) MC_GOLD, (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and (lower(PRODUCT_NAME) like '%watch2pay%' or lower(PRODUCT_NAME) like '%часы%') /*and not ( lower(PRODUCT_NAME) like '%paypass%' or lower(PRODUCT_NAME) like '%stand%' or lower(PRODUCT_NAME) like '%корп. карта на представительские расходы%' )*/ THEN 1 ELSE 0 END) MC_CLOCK, (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and lower(PRODUCT_NAME) like '%world elite%' THEN 1 ELSE 0 END) MC_WORLD_ELITE, (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and lower(PRODUCT_NAME) like '%platinum%' and not lower(PRODUCT_NAME) like '%арт-карта%' THEN 1 ELSE 0 END) MC_PLATINUM, (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and lower(PRODUCT_NAME) like '%купил-накопил%' THEN 1 ELSE 0 END) MC_K_N, (CASE WHEN (lower(PRODUCT_NAME) like '%mc%' or lower(PRODUCT_NAME) like '%mastercard%') and lower(PRODUCT_NAME) like '%арт-карта%' THEN 1 ELSE 0 END) MC_ART FROM WH.IBS_CARDS
true
dc678f2401f8f1bec0d12a51788981bebe42fe37
SQL
subhamkrverma/subham
/project1234.sql
UTF-8
4,124
3.03125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 27, 2019 at 10:05 AM -- Server version: 10.1.31-MariaDB -- PHP Version: 7.2.3 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: `project1234` -- -- -------------------------------------------------------- -- -- Table structure for table `bookings` -- CREATE TABLE `bookings` ( `id` int(11) NOT NULL, `seminar_name` varchar(1000) DEFAULT NULL, `seminar_id` varchar(1000) DEFAULT NULL, `booking_date` date DEFAULT NULL, `start_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `bookings` -- INSERT INTO `bookings` (`id`, `seminar_name`, `seminar_id`, `booking_date`, `start_date`, `end_date`, `status`) VALUES (1, 'SEM1', '1', '2019-02-27', '2019-02-15', '2019-02-20', 1); -- -------------------------------------------------------- -- -- Table structure for table `seminar` -- CREATE TABLE `seminar` ( `id` int(11) NOT NULL, `username` varchar(1000) NOT NULL, `password` varchar(1000) NOT NULL, `status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `seminar` -- INSERT INTO `seminar` (`id`, `username`, `password`, `status`) VALUES (1, 'shiwangi', 'shiw123', 1); -- -------------------------------------------------------- -- -- Table structure for table `seminar1` -- CREATE TABLE `seminar1` ( `id` int(11) NOT NULL, `username` varchar(1000) DEFAULT NULL, `password` varchar(1000) DEFAULT NULL, `status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `seminar1` -- INSERT INTO `seminar1` (`id`, `username`, `password`, `status`) VALUES (1, 'admin', '1234', 1); -- -------------------------------------------------------- -- -- Table structure for table `seminarhall` -- CREATE TABLE `seminarhall` ( `id` int(11) NOT NULL, `seminar_name` varchar(1000) DEFAULT NULL, `image` varchar(1000) DEFAULT NULL, `building_name` varchar(1000) DEFAULT NULL, `college_name` varchar(1000) DEFAULT NULL, `capacity` varchar(1000) DEFAULT NULL, `seminar_floor` varchar(1000) DEFAULT NULL, `status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `seminarhall` -- INSERT INTO `seminarhall` (`id`, `seminar_name`, `image`, `building_name`, `college_name`, `capacity`, `seminar_floor`, `status`) VALUES (1, 'SEM1', '1.jpg', 'cotton bhawan', 'AEC', '60', '1', 1), (2, 'SEM2', '1.jpg', 'cotton bhawan', 'AEC', '60', '1', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `bookings` -- ALTER TABLE `bookings` ADD PRIMARY KEY (`id`); -- -- Indexes for table `seminar` -- ALTER TABLE `seminar` ADD PRIMARY KEY (`id`); -- -- Indexes for table `seminar1` -- ALTER TABLE `seminar1` ADD PRIMARY KEY (`id`); -- -- Indexes for table `seminarhall` -- ALTER TABLE `seminarhall` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `bookings` -- ALTER TABLE `bookings` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `seminar` -- ALTER TABLE `seminar` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `seminar1` -- ALTER TABLE `seminar1` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `seminarhall` -- ALTER TABLE `seminarhall` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; 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
422c1c74d3c3ac8e400965d239fbfff0d18c29d3
SQL
danielvitorti/plsql
/utils/criar_perfil_oracle.sql
UTF-8
773
3.09375
3
[ "Apache-2.0" ]
permissive
-- Tem que estar logado como usuario system -- Cria o tablespace para os dados create tablespace tbs_dados datafile 'C:\oraclexe\app\oracle\oradata\tbd_dados.dbf' size 100M reuse autoextend on next 10M maxsize 200M online; create user aluno -- usuario identified by "123" --senha default tablespace tbs_dados temporary tablespace temp; -- Cria e define a role de privilegios ( perfil ) create role perfil_desenv; grant create cluster, create database link, create procedure, create session, create sequence, create synonym, create table, create any type, create trigger, create view to perfil_desenv; grant alter session to perfil_desenv; grant create trigger to aluno; grant perfil_desenv to aluno; grant unlimited tablespace to aluno;
true
541528cb22447ea1a4616af4ef629296a05e963f
SQL
LoneRanger66/Longzhu
/resource/sql.sql
UTF-8
639
2.9375
3
[]
no_license
CREATE SCHEMA `longzhu` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ; CREATE TABLE `longzhu`.`danmu` ( `iddanmu` INT NOT NULL AUTO_INCREMENT, `uid` INT NULL COMMENT '龙珠号', `username` VARCHAR(30) NULL COMMENT '用户名', `content` VARCHAR(60) NULL COMMENT '弹幕内容', `grade` INT NULL COMMENT '用户等级', `time` DATETIME NULL COMMENT '发言时间', `via` VARCHAR(10) NULL COMMENT '观看直播的设备', `name` VARCHAR(10) NULL COMMENT '粉丝牌的名字', `level` INT NULL COMMENT '粉丝牌等级', PRIMARY KEY (`iddanmu`)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
true
6ec5dd508fbc71d8c829e15db8c91d4fb4b9ab84
SQL
soriaj/retraced
/migrations/pg/1492023766.do.templates.sql
UTF-8
383
2.890625
3
[ "Apache-2.0" ]
permissive
create table display_template ( id text not null, created_at timestamp without time zone, updated_at timestamp without time zone, project_id text not null references project(id) on delete cascade, environment_id text not null references environment(id) on delete cascade, name text not null, rule text not null, template text not null, primary key (id) );
true
3e614b0bdf77968d6f1adbc8d9757172626959fc
SQL
gashndolo/opinionneeded
/resources/migrations/20211030082005-create-comments-table.up.sql
UTF-8
223
3.1875
3
[]
no_license
CREATE TABLE comments( id SERIAL PRIMARY KEY, comment text not null, upvotes int default 0, argument_id int, CONSTRAINT fk_argument FOREIGN KEY(argument_id) REFERENCES arguments(id) ON DELETE SET NULL );
true
7b8fce70bc7d1d42272b25f2e1afa2cf4d62d703
SQL
dael-victoria-reyes/data-act-broker-backend
/dataactvalidator/config/sqlrules/fabs35_detached_award_financial_assistance_2.sql
UTF-8
344
3.28125
3
[ "CC0-1.0" ]
permissive
-- LegalEntityZIP5 is not a valid zip code. SELECT dafa.row_number, dafa.legal_entity_zip5 FROM detached_award_financial_assistance AS dafa WHERE dafa.submission_id = {0} AND COALESCE(dafa.legal_entity_zip5, '') <> '' AND NOT EXISTS ( SELECT 1 FROM zips AS z WHERE z.zip5 = dafa.legal_entity_zip5 );
true
f723012faaf9b5e06f64a1f375bc1d97c68665fe
SQL
pmacmil1/NBA-SQL
/F14_0_QUARTER _STATISTICS.sql
UTF-8
7,117
3.59375
4
[]
no_license
--Feature 14: Show statistics of a quarter in a game, including quarter level statistics listed --in Assumption 11 and statistics of a player in that quarter --(same as listed in Assumption 10 but at quarter level), which can be computed --using play-by-play data. --Create lots of temp tables to join the necessary data together. DECLARE p_quarter_id INT; BEGIN p_quarter_id := 31; f14_2_quarter_points(p_quarter_id); f14_3_quarter_missed_shots(p_quarter_id); f14_4_quarter_rebounds(p_quarter_id); f14_5_quarter_steals(p_quarter_id); f14_6_quarter_free_missed(p_quarter_id); f14_7_quarter_free_throws(p_quarter_id); END; --Show player score totals for the above quarter. SELECT QUARTER_SCORE_TOTAL.player_ID, PLAYER.name, QUARTER_SCORE_TOTAL.points FROM QUARTER_SCORE_TOTAL, PLAYER WHERE QUARTER_SCORE_TOTAL.player_ID = PLAYER.player_id ORDER BY QUARTER_SCORE_TOTAL.points DESC; --Show player smissed shot totals for the above quarter. SELECT SHOTS_MISSED.player_ID, PLAYER.name, SHOTS_MISSED.shots_missed FROM SHOTS_MISSED, PLAYER WHERE SHOTS_MISSED.player_ID = PLAYER.player_id ORDER BY SHOTS_MISSED.shots_missed DESC; --Show player missed shot totals for the above quarter. SELECT SHOTS_MISSED.player_ID, PLAYER.name, SHOTS_MISSED.shots_missed FROM SHOTS_MISSED, PLAYER WHERE SHOTS_MISSED.player_ID = PLAYER.player_id ORDER BY SHOTS_MISSED.shots_missed DESC; --Show player rebound totals for the above quarter. SELECT QUARTER_REBOUNDS_BY_PLAYER.player_ID, PLAYER.name, QUARTER_REBOUNDS_BY_PLAYER.rebounds FROM QUARTER_REBOUNDS_BY_PLAYER, PLAYER WHERE QUARTER_REBOUNDS_BY_PLAYER.player_ID = PLAYER.player_id ORDER BY QUARTER_REBOUNDS_BY_PLAYER.rebounds DESC; --Show player assist totals for the above quarter. SELECT QUARTER_REBOUNDS_BY_PLAYER.player_ID, PLAYER.name, QUARTER_REBOUNDS_BY_PLAYER.rebounds FROM QUARTER_REBOUNDS_BY_PLAYER, PLAYER WHERE QUARTER_REBOUNDS_BY_PLAYER.player_ID = PLAYER.player_id ORDER BY QUARTER_REBOUNDS_BY_PLAYER.rebounds DESC; --Show player steal totals for the above quarter. SELECT QUARTER_STEALS_BY_PLAYER.player_ID, PLAYER.name, QUARTER_STEALS_BY_PLAYER.steals FROM QUARTER_STEALS_BY_PLAYER, PLAYER WHERE QUARTER_STEALS_BY_PLAYER.player_ID = PLAYER.player_id ORDER BY QUARTER_STEALS_BY_PLAYER.steals DESC; --Show made free thrwo totals for the above quarter. SELECT FREE_THROW_MADE.player_ID, PLAYER.name, FREE_THROW_MADE.free_throw_made FROM FREE_THROW_MADE, PLAYER WHERE FREE_THROW_MADE.player_ID = PLAYER.player_id ORDER BY FREE_THROW_MADE.free_throw_made DESC; --Show made free thrwo totals for the above quarter. SELECT FREE_THROW_MADE.player_ID, PLAYER.name, FREE_THROW_MADE.free_throw_made FROM FREE_THROW_MADE, PLAYER WHERE FREE_THROW_MADE.player_ID = PLAYER.player_id ORDER BY FREE_THROW_MADE.free_throw_made DESC; --Show made free thrwo totals for the above quarter. SELECT FREES_MISSED.player_ID, PLAYER.name, FREES_MISSED.frees_missed FROM FREES_MISSED, PLAYER WHERE FREES_MISSED.player_ID = PLAYER.player_id ORDER BY FREES_MISSED.frees_missed DESC; DECLARE counter INT; only_team_id INT; p_quarter_id INT; p_home_team_id INT; p_away_team_id INT; empty_table VARCHAR2(50); BEGIN p_quarter_id := 31; p_home_team_id := get_teams_for_play_events('home', p_quarter_id); p_away_team_id := get_teams_for_play_events('away', p_quarter_id); --Exception handling for the situation where some tables created above are empty for some teams. --Insert 0 value rows for the null rows in the missed shots table. SELECT COUNT(*) INTO counter FROM QUARTER_SHOTS_MISSED; IF counter = 0 THEN empty_table := 'YES'; INSERT INTO QUARTER_SHOTS_MISSED VALUES (p_home_team_id, 0); INSERT INTO QUARTER_SHOTS_MISSED VALUES (p_away_team_id, 0); END IF; IF (counter < 2) THEN SELECT team_id INTO only_team_id FROM QUARTER_SHOTS_MISSED WHERE rownum = 1; IF only_team_id = p_away_team_id THEN INSERT INTO QUARTER_SHOTS_MISSED VALUES (p_home_team_id, 0); ELSE INSERT INTO QUARTER_SHOTS_MISSED VALUES (p_away_team_id, 0); END IF; END IF; --Insert 0 value rows for the null rows in the rebounds table. SELECT COUNT(*) INTO counter FROM QUARTER_REBOUNDS; IF counter = 0 THEN empty_table := 'YES'; INSERT INTO QUARTER_REBOUNDS VALUES (p_home_team_id, 0); INSERT INTO QUARTER_REBOUNDS VALUES (p_away_team_id, 0); END IF; IF (counter < 2) THEN SELECT team_id INTO only_team_id FROM QUARTER_REBOUNDS WHERE rownum = 1; IF only_team_id = p_away_team_id THEN INSERT INTO QUARTER_REBOUNDS VALUES (p_home_team_id, 0); ELSE INSERT INTO QUARTER_REBOUNDS VALUES (p_away_team_id, 0); END IF; END IF; --Insert 0 value rows for the null rows in the steals table. SELECT COUNT(*) INTO counter FROM QUARTER_STEALS; IF counter = 0 THEN empty_table := 'YES'; INSERT INTO QUARTER_STEALS VALUES (p_home_team_id, 0); INSERT INTO QUARTER_STEALS VALUES (p_away_team_id, 0); END IF; IF (counter < 2) THEN SELECT team_id INTO only_team_id FROM QUARTER_STEALS WHERE rownum = 1; IF only_team_id = p_away_team_id THEN INSERT INTO QUARTER_STEALS VALUES (p_home_team_id, 0); ELSE INSERT INTO QUARTER_STEALS VALUES (p_away_team_id, 0); END IF; END IF; --Insert 0 value rows for the null rows in the frees_missed table. SELECT COUNT(*) INTO counter FROM QUARTER_FREES_MISSED; IF counter = 0 THEN empty_table := 'YES'; INSERT INTO QUARTER_FREES_MISSED VALUES (p_home_team_id, 0); INSERT INTO QUARTER_FREES_MISSED VALUES (p_away_team_id, 0); END IF; IF (counter < 2) THEN SELECT team_id INTO only_team_id FROM QUARTER_FREES_MISSED WHERE rownum = 1; IF only_team_id = p_away_team_id THEN INSERT INTO QUARTER_FREES_MISSED VALUES (p_home_team_id, 0); ELSE INSERT INTO QUARTER_FREES_MISSED VALUES (p_away_team_id, 0); END IF; END IF; --Insert 0 value rows for the null rows in the free_throws table. SELECT COUNT(*) INTO counter FROM QUARTER_FREE_THROWS; IF counter = 0 THEN empty_table := 'YES'; INSERT INTO QUARTER_FREE_THROWS VALUES (p_home_team_id, 0); INSERT INTO QUARTER_FREE_THROWS VALUES (p_away_team_id, 0); END IF; IF (counter < 2) THEN SELECT team_id INTO only_team_id FROM QUARTER_FREE_THROWS WHERE rownum = 1; IF only_team_id = p_away_team_id THEN INSERT INTO QUARTER_FREE_THROWS VALUES (p_home_team_id, 0); ELSE INSERT INTO QUARTER_FREE_THROWS VALUES (p_away_team_id, 0); END IF; END IF; END; EXEC f14_1_team_quarter_stats (31); SELECT * FROM QUARTER_STATS; DROP TABLE QUARTER_STATS; DROP TABLE QUARTER_INFO; DROP TABLE QUARTER_POINTS; DROP TABLE QUARTER_SHOTS_MISSED; DROP TABLE QUARTER_REBOUNDS; DROP TABLE QUARTER_FREE_THROWS; DROP TABLE QUARTER_FREES_MISSED; DROP TABLE QUARTER_STEALS; DROP TABLE FREE_THROW_MADE; DROP TABLE FREES_MISSED; DROP TABLE FREE_THROW_MADE_LEADERS; DROP TABLE QUARTER_REBOUNDS_BY_PLAYER; DROP TABLE QUARTER_STEALS_BY_PLAYER; DROP TABLE QUARTER_SCORE_TOTAL; DROP TABLE SCORE_TOTALS; DROP TABLE SHOTS_MISSED; DROP TABLE SHOT_MADE_LEADERS; DROP TABLE THREE_MADE_LEADERS;
true
cb0ab4467bbf6c9e5f16a4dab9d4ada5ecbc4240
SQL
forestphoenix/Temperature-Logger
/templog-server/db/select-running-time.sql
UTF-8
711
4.15625
4
[]
no_license
WITH pairs AS ( SELECT ((julianday(late.taken_at) - julianday(early.taken_at)) * 24 * 60 * 60) as diff, early.taken_at as stop, late.taken_at as restart, early.*, late.* FROM measurement as early INNER JOIN measurement as late ON late.measurement_id = early.measurement_id + 1 ), long_pauses AS ( SELECT * from pairs WHERE diff > 120 ), time_online AS ( SELECT ((julianday(stopped.stop) - julianday(started.restart)) * 24) AS time_running, started.restart AS started, stopped.stop AS stopped, * FROM long_pauses AS stopped INNER JOIN long_pauses AS started ON started.restart = (SELECT max(restart) FROM long_pauses AS l WHERE l.restart < stopped.stop) ) SELECT * FROM time_online ORDER BY started DESC
true
6d74a45d3c233a77ecb6802a02ff454963100e85
SQL
Qvinticom/fightclub
/db/storedprocs.sql
UTF-8
23,494
3.640625
4
[]
no_license
/* ALL SQL QUERY STORED IN THIS FILE */ DROP PROCEDURE IF EXISTS CreateUser; DROP PROCEDURE IF EXISTS ValidateUser; DROP PROCEDURE IF EXISTS GetUser; DROP PROCEDURE IF EXISTS CreateTaskGroup; DROP PROCEDURE IF EXISTS UpdateTaskGroup; DROP PROCEDURE IF EXISTS UpdateTaskGroupOrder; DROP PROCEDURE IF EXISTS DeleteTaskGroup; DROP PROCEDURE IF EXISTS CreateTask; DROP PROCEDURE IF EXISTS DeleteTask; DROP PROCEDURE IF EXISTS UpdateTask; DROP PROCEDURE IF EXISTS ToogleTaskComplete; DROP PROCEDURE IF EXISTS GetAllMyTasks; DROP PROCEDURE IF EXISTS GetTask; DROP PROCEDURE IF EXISTS GetFriends; DROP PROCEDURE IF EXISTS GetMyFollows; DROP PROCEDURE IF EXISTS GetMyFans; DROP PROCEDURE IF EXISTS GetMyFriends; DROP PROCEDURE IF EXISTS GetUserFollows; DROP PROCEDURE IF EXISTS AddFriend; DROP PROCEDURE IF EXISTS UnfollowFriend; DROP PROCEDURE IF EXISTS SearchUsers; DROP PROCEDURE IF EXISTS UpdateAvatar; DROP PROCEDURE IF EXISTS GetAllFriendTasks; DROP PROCEDURE IF EXISTS Fighto; DROP PROCEDURE IF EXISTS GetUserTasks; DROP PROCEDURE IF EXISTS GetTexpByTgid; DROP PROCEDURE IF EXISTS CreateComment; DROP PROCEDURE IF EXISTS DeleteComment; DROP PROCEDURE IF EXISTS GetComments; DROP PROCEDURE IF EXISTS GetFightoList; DROP PROCEDURE IF EXISTS GetNews; DROP PROCEDURE IF EXISTS ExpHouseKeeping; DROP PROCEDURE IF EXISTS GetAlarmsByUid; DROP FUNCTION IF EXISTS SplitString; /* CREATE A USER */ DELIMITER // CREATE PROCEDURE CreateUser( IN myusername char(20) CHARACTER SET utf8, IN mypasswd char(32) CHARACTER SET utf8, IN myfirstname char(30) CHARACTER SET utf8, IN mylastname char(30) CHARACTER SET utf8, IN myemail char(50) CHARACTER SET utf8, IN myavatar int ) BEGIN DECLARE existU BOOLEAN; DECLARE existM BOOLEAN; DECLARE uid INTEGER; DECLARE tgid INTEGER; SET time_zone = "+00:00"; SELECT (COUNT(*)>0) INTO @existU FROM USER WHERE username = myusername; SELECT (COUNT(*)>0) INTO @existM FROM USER WHERE email = myemail; IF (@existM = TRUE OR @existU =TRUE) THEN SELECT 0 AS uid, @existM AS existM, @existU as existU; ELSE INSERT INTO USER (username, passwd, firstname, lastname, email, avatar) VALUES(myusername, mypasswd, myfirstname, mylastname, myemail, myavatar); SELECT LAST_INSERT_ID() AS uid into @uid; INSERT INTO T_GROUP (uid, title, priority, type) VALUES(@uid, 'My First Task Group', 0, 0); SELECT LAST_INSERT_ID() AS tgid into @tgid; INSERT INTO TASK(uid, tgid, content) VALUES(@uid, @tgid, 'Buy some milk'); SELECT @uid as uid; END IF; END // DELIMITER ; /* validate a user */ DELIMITER // CREATE PROCEDURE ValidateUser( IN myusername char(20) CHARACTER SET utf8, mypasswd char(32) CHARACTER SET utf8 ) BEGIN SELECT * FROM USER WHERE ((username = myusername AND passwd = mypasswd) OR (email = myusername AND passwd = mypasswd)); END // DELIMITER ; /* get a user */ DELIMITER // CREATE PROCEDURE GetUser( IN myuid int ) BEGIN SELECT USER.uid, USER.exp, USER.username, USER.firstname, USER.lastname, USER.email, USER.avatar FROM USER WHERE uid = myuid; END // DELIMITER ; /* CREATE A TASK GROUP */ DELIMITER // CREATE PROCEDURE CreateTaskGroup( IN myuid int, IN mytitle char(40) CHARACTER SET utf8, IN mypri int, IN mytype int, IN mytorder varchar(65535) CHARACTER SET utf8 ) BEGIN SET time_zone = "+00:00"; INSERT INTO T_GROUP (uid, title, priority, type, t_order) VALUES(myuid, mytitle, mypri, mytype, mytorder); END // DELIMITER ; /* UPDATE A TASK GROUP */ DELIMITER // CREATE PROCEDURE UpdateTaskGroup( IN mytgid int, IN mytitle char(40) CHARACTER SET utf8, IN mypri int, IN mytype int, IN mytorder varchar(65535) CHARACTER SET utf8 ) BEGIN UPDATE T_GROUP SET title = mytitle, priority = mypri, type = mytype, t_order = mytorder WHERE tgid = mytgid; SELECT ROW_COUNT() AS rows_affected; END // DELIMITER ; /* UPDATE A TASK GROUP TASK ORDER */ DELIMITER // CREATE PROCEDURE UpdateTaskGroupOrder( IN mytgid int, IN mytorder varchar(65535) CHARACTER SET utf8 ) BEGIN UPDATE T_GROUP SET t_order = mytorder WHERE tgid = mytgid; SELECT ROW_COUNT() AS rows_affected; END // DELIMITER ; /* DELETE A TASK GROUP */ DELIMITER // CREATE PROCEDURE DeleteTaskGroup( IN mytgid int ) BEGIN DELETE FROM T_GROUP WHERE T_GROUP.tgid = mytgid; SELECT ROW_COUNT() AS rows_affected; END // DELIMITER ; /* CREATE A ORIGINAL TO-DO TASK */ DELIMITER // CREATE PROCEDURE CreateTask( IN myuid int, IN myotid int, IN mytgid int, IN mycontent char(140) CHARACTER SET utf8 ) BEGIN SET time_zone = "+00:00"; INSERT INTO TASK (uid, otid, tgid, content) VALUES(myuid, myotid, mytgid, mycontent); END // DELIMITER ; /* DELETE A ORIGINAL TO-DO TASK */ DELIMITER // CREATE PROCEDURE DeleteTask( IN mytid int ) BEGIN DECLARE rows_affected, texp, status INTEGER; SET @status = 0; SELECT COUNT(EXP.expid) INTO @texp FROM TASK LEFT JOIN EXP ON TASK.tid = EXP.tid WHERE TASK.tid = mytid AND TASK.isdone = TRUE AND TASK.privacy > 0; DELETE FROM TASK WHERE TASK.tid = mytid; SELECT ROW_COUNT() INTO @rows_affected; IF(@texp > 0) THEN /* NEED MINUS EXP FROM THIS TASK */ UPDATE USER SET USER.exp = USER.exp - @texp; SET @status = 2; END IF; SELECT @status AS status; END // DELIMITER ; /* UPDATE A ORIGINAL TO-DO TASK */ DELIMITER // CREATE PROCEDURE UpdateTask( IN mytid int, IN mycontent char(140) CHARACTER SET utf8, IN myprivacy int, IN mydeadline TIMESTAMP ) BEGIN DECLARE ispublish, isprivate, event_exists, isdone, isdone2 BOOLEAN; DECLARE rows_affected,eventid,tuid,tuid2,texp, status INTEGER; SET status = -1; SELECT (COUNT(*)>0), TASK.uid, TASK.isdone INTO @ispublish, @tuid, @isdone FROM TASK WHERE tid = mytid AND myprivacy > 0 AND privacy = 0; SELECT (COUNT(*)>0), TASK.uid,TASK.isdone INTO @isprivate, @tuid2,@isdone2 FROM TASK WHERE tid = mytid AND myprivacy = 0 AND privacy > 0; UPDATE TASK SET TASK.content = mycontent, TASK.privacy = myprivacy, TASK.lastupdate = now(), TASK.deadline = mydeadline WHERE TASK.tid = mytid; IF (@ispublish = TRUE) THEN IF(@isdone = TRUE) THEN SELECT COUNT(EXP.expid) INTO @texp FROM TASK LEFT JOIN EXP ON TASK.tid = EXP.tid WHERE TASK.tid = mytid; UPDATE USER SET USER.exp = USER.exp + @texp WHERE USER.uid = @tuid; SET @status = 1; ELSE SET @status = 0; END IF; SELECT (COUNT(*)>0), EVENT.eventid INTO @event_exists, @eventid FROM EVENT WHERE EVENT.eventtype = 4 AND EVENT.tid = mytid; IF (@event_exists = TRUE) THEN UPDATE EVENT SET EVENT.tstamp = now() WHERE EVENT.eventid = @eventid; ELSE INSERT INTO EVENT(eventtype, uid1, tid) VALUES (4, @tuid, mytid); END IF; ELSE IF (@isprivate = TRUE) THEN IF (@isdone2 = TRUE) THEN SELECT COUNT(EXP.expid) INTO @texp FROM TASK LEFT JOIN EXP ON TASK.tid = EXP.tid WHERE TASK.tid = mytid; UPDATE USER SET USER.exp = USER.exp - @texp WHERE USER.uid = @tuid2; SET @status = 2; ELSE SET @status = 0; END IF; /* IS TO SET BACK TO PRIVATE, EXP ROLL BACK */ ELSE SET @status = 0; END IF; END IF; SELECT @status AS status; END // DELIMITER ; /* COMPLETE A ORIGINAL TO-DO TASK */ DELIMITER // CREATE PROCEDURE ToogleTaskComplete( IN mytid int, IN myisdone boolean ) BEGIN DECLARE rowno INTEGER; DECLARE isdone boolean; DECLARE privacy INTEGER; DECLARE tuid INTEGER; DECLARE texp, status INTEGER; SELECT TASK.isdone, TASK.privacy, TASK.uid, COUNT(*) INTO @isdone, @privacy, @tuid, @rowno FROM TASK WHERE TASK.tid = mytid; SET @status = 0; IF @rowno = 0 THEN /* NO RECORD EXISTS */ SET @status = -1; ELSE SELECT COUNT(EXP.expid) INTO @texp FROM TASK LEFT JOIN EXP ON TASK.tid = EXP.tid WHERE TASK.tid = mytid; IF @privacy <> 0 THEN /* IF ALREADY PUBLISHED */ UPDATE TASK SET TASK.isdone = myisdone, TASK.lastupdate = now() WHERE TASK.tid = mytid; IF(myisdone <> @isdone) AND (myisdone = FALSE) THEN /* NOT ALLOWED WHEN PUBLISHED */ /* SELECT (-1) AS status; */ UPDATE USER SET USER.exp = USER.exp - @texp WHERE USER.uid = @tuid; SET @status = 2; ELSE UPDATE USER SET USER.exp = USER.exp + @texp WHERE USER.uid = @tuid; INSERT INTO EVENT (eventtype, uid1, tid) VALUES (6, @tuid, mytid); SET @status = 1; END IF; ELSE /* IS PRIVATE, OK TO MODIFY */ UPDATE TASK SET TASK.isdone = myisdone WHERE TASK.tid = mytid; SET @status = 0; END IF; END IF; SELECT @status AS status; END // DELIMITER ; /* GET ALL TASKS BY USER */ DELIMITER // CREATE PROCEDURE GetAllMyTasks( IN myuid int ) BEGIN SET time_zone = "+00:00"; SELECT TASK.tid, TASK.otid, USER.uid, USER.username, USER.firstname, USER.lastname, USER.email, TASK.content, expc.texp, TASK.tstamp, TASK.deadline, TASK.isdone, T_GROUP.t_order, T_GROUP.tgid, T_GROUP.priority, T_GROUP.title, USER.exp, USER.avatar, T_GROUP.type, TASK.privacy, commentc.ccount FROM USER LEFT JOIN T_GROUP ON T_GROUP.uid = USER.uid LEFT JOIN TASK ON T_GROUP.tgid = TASK.tgid LEFT JOIN ( SELECT expid, tid, COUNT(expid) AS texp FROM EXP GROUP BY tid ) expc on TASK.tid = expc.tid LEFT JOIN ( SELECT commentid, tid, COUNT(commentid) AS ccount FROM COMMENT GROUP BY tid ) commentc on TASK.tid = commentc.tid WHERE USER.uid = myuid ORDER BY priority DESC,tgid DESC, tstamp DESC; END // DELIMITER ; /* GET A ORIGINAL TO-DO TASK */ DELIMITER // CREATE PROCEDURE GetTask( IN mytid int ) BEGIN SET time_zone = "+00:00"; SELECT TASK.tid, TASK.uid, USER.username, USER.firstname, USER.lastname, TASK.content, COUNT(EXP.expid) AS expcount, TASK.tstamp, TASK.isdone, TASK.privacy FROM TASK LEFT JOIN USER ON TASK.uid = USER.uid LEFT JOIN EXP ON TASK.tid = EXP.tid WHERE TASK.tid = mytid GROUP BY EXP.tid; END // DELIMITER ; /* GET ALL PEOPLE I FOLLOW */ DELIMITER // CREATE PROCEDURE GetMyFollows( IN myuid int ) BEGIN SELECT USER.uid, ft.fuid, USER.exp, USER.username, USER.firstname, USER.lastname, USER.email, USER.avatar FROM ( SELECT * FROM FRIEND WHERE uid = myuid ) ft LEFT JOIN USER ON USER.uid = ft.fuid ORDER BY ft.frid DESC; END // DELIMITER ; /* GET ALL MY FANS */ DELIMITER // CREATE PROCEDURE GetMyFans( IN myuid int ) BEGIN DELETE FROM ALARM WHERE frid IN (SELECT FRIEND.frid FROM FRIEND WHERE fuid = myuid) AND frid NOT IN ( SELECT FRIEND2.frid FROM (SELECT * FROM FRIEND WHERE uid = myuid ) FRIEND1 JOIN (SELECT * FROM FRIEND WHERE fuid = myuid ) FRIEND2 ON FRIEND1.fuid = FRIEND2.uid ); SELECT ft.uid, USER.exp, USER.username, USER.firstname, USER.lastname, USER.email, USER.avatar FROM ( SELECT * FROM FRIEND WHERE fuid = myuid AND frid NOT IN ( SELECT FRIEND2.frid FROM (SELECT * FROM FRIEND WHERE uid = myuid ) FRIEND1 JOIN (SELECT * FROM FRIEND WHERE fuid = myuid ) FRIEND2 ON FRIEND1.fuid = FRIEND2.uid ) ) ft LEFT JOIN USER ON USER.uid = ft.uid ORDER BY ft.frid DESC; END // DELIMITER ; /* GET ALL MY FRIENDS */ DELIMITER // CREATE PROCEDURE GetMyFriends( IN myuid int ) BEGIN DELETE FROM ALARM WHERE frid IN ( SELECT FRIEND2.frid FROM (SELECT * FROM FRIEND WHERE uid = myuid ) FRIEND1 JOIN (SELECT * FROM FRIEND WHERE fuid = myuid ) FRIEND2 ON FRIEND1.fuid = FRIEND2.uid ); SELECT myuid AS fuid, ft.fuid AS uid, USER.exp, USER.username, USER.firstname, USER.lastname, USER.email, USER.avatar FROM ( SELECT FRIEND1.uid, FRIEND1.fuid, FRIEND1.frid FROM (SELECT * FROM FRIEND WHERE uid = myuid ) FRIEND1 JOIN (SELECT * FROM FRIEND WHERE fuid = myuid ) FRIEND2 ON FRIEND1.fuid = FRIEND2.uid ) ft LEFT JOIN USER ON USER.uid = ft.fuid ORDER BY ft.frid DESC; END // DELIMITER ; /* GET ALL PEOPLE THE USER FOLLOW */ DELIMITER // CREATE PROCEDURE GetUserFollows( IN myfuid int, IN myuid int ) BEGIN SELECT USER.uid, FRIEND.fuid, USER.exp, USER.username, USER.firstname, USER.lastname, USER.email, USER.avatar FROM ( SELECT * FROM FRIEND WHERE uid = myfuid ) ft LEFT JOIN USER ON USER.uid = ft.fuid LEFT JOIN FRIEND ON USER.uid = FRIEND.fuid AND FRIEND.uid = myuid ORDER BY ft.frid DESC; END // DELIMITER ; /* ADD A FRIEND */ DELIMITER // CREATE PROCEDURE AddFriend( IN myuid int, IN myfuid int ) BEGIN DECLARE rowno INTEGER; DECLARE eventid,alarmid, frid INTEGER; SELECT COUNT(*) INTO @rowno FROM FRIEND f WHERE f.uid = myuid AND f.fuid = myfuid; IF @rowno <> 0 THEN SELECT (-1) AS status; ELSE INSERT INTO FRIEND (uid, fuid) VALUES(myuid, myfuid); SELECT LAST_INSERT_ID() INTO @frid; SELECT COUNT(*), EVENT.eventid INTO @rowno, @eventid FROM EVENT WHERE EVENT.uid1 = myuid AND EVENT.uid2 = myfuid AND EVENT.eventtype=3; IF @rowno > 0 THEN /* ALREADY EXISTS,UPDATE TIMESTAMP */ UPDATE EVENT SET EVENT.tstamp = now() WHERE EVENT.eventid = @eventid; ELSE INSERT INTO EVENT(eventtype, uid1, uid2) VALUES(3, myuid, myfuid); END IF; INSERT INTO ALARM(alarmtype, frid) VALUES(0, @frid); SELECT (1) AS status; END IF; END // DELIMITER ; /* UNFOLLOW I.E DELETE A FRIEND */ DELIMITER // CREATE PROCEDURE UnfollowFriend( IN myuid int, IN myfuid int ) BEGIN DELETE FROM FRIEND WHERE FRIEND.uid = myuid AND FRIEND.fuid = myfuid; SELECT ROW_COUNT() AS rows_affected; END // DELIMITER ; /* SEARCH FRIENDS */ DELIMITER // CREATE PROCEDURE SearchUsers( IN myuid int, IN myinput VARCHAR(50) CHARACTER SET utf8 ) BEGIN SELECT uid, username, firstname, lastname, avatar,fuid FROM USER u LEFT JOIN (SELECT fuid FROM FRIEND WHERE uid = myuid) f ON u.uid = f.fuid WHERE (LOWER(CONCAT(firstname, ' ', lastname)) LIKE CONCAT('%', LOWER(myinput), '%') OR LOWER(CONCAT(lastname, ' ', firstname)) LIKE CONCAT('%', LOWER(myinput), '%') OR LOWER(username) LIKE CONCAT('%', LOWER(myinput), '%')); END // DELIMITER ; /* UPDATE AVATAR */ DELIMITER // CREATE PROCEDURE UpdateAvatar( IN myuid int, IN myavatar int ) BEGIN UPDATE USER SET avatar = myavatar WHERE uid = myuid; SELECT ROW_COUNT() AS rows_affected; END // DELIMITER ; /* GET ALL FRIEND'S TASKS */ DELIMITER // CREATE PROCEDURE GetUserTasks( IN myfuid int, IN myuid int ) BEGIN DECLARE privacylevel INTEGER; DECLARE isfans BOOLEAN; SET @privacylevel = 1; SET time_zone = "+00:00"; SELECT (COUNT(*)>0) into @isfans FROM FRIEND WHERE fuid = myuid AND uid = myfuid; IF(@isfans = TRUE OR myfuid = myuid) THEN SET @privacylevel = 0; END IF; SELECT utg.fuid, myfuid AS uid, TASK1.tid, TASK1.otid, utg.username, utg.firstname, utg.lastname, utg.email, TASK1.content, COUNT(EXP.expid) AS texp, TASK1.tstamp, TASK1.isdone,utg.t_order, utg.tgid, utg.priority, utg.title, utg.exp, utg.avatar, utg.type, TASK1.privacy, CONCAT(CONCAT(IFNULL(TASK1.tid, 'NULL'), ' '),utg.tgid) AS pk, (EXP1.expid IS NOT NULL) AS isliked FROM ( SELECT T_GROUP.tgid, T_GROUP.priority, T_GROUP.type, T_GROUP.title, IFNULL(T_GROUP.t_order,"") AS t_order, uf.username, uf.firstname, uf.lastname, uf.email, uf.exp, uf.avatar, uf.fuid FROM T_GROUP RIGHT JOIN ( SELECT * FROM USER LEFT JOIN ( SELECT fuid FROM FRIEND WHERE uid = myuid AND fuid = myfuid )f ON USER.uid = f.fuid WHERE USER.uid = myfuid )uf ON T_GROUP.uid = uf.uid ) utg LEFT JOIN ( SELECT * FROM TASK WHERE privacy > @privacylevel AND uid = myfuid )TASK1 ON TASK1.tgid = utg.tgid LEFT JOIN EXP ON TASK1.tid = EXP.tid LEFT JOIN EXP EXP1 ON TASK1.tid = EXP1.tid AND EXP1.uid = myuid GROUP BY pk ORDER BY priority DESC,tgid DESC, tstamp DESC; END // DELIMITER ; /* ADD 1 EXP TO A TASK */ DELIMITER // CREATE PROCEDURE Fighto( IN myuid int, IN mytid int ) BEGIN DECLARE exist BOOLEAN; DECLARE ismypost BOOLEAN; DECLARE tuid INTEGER; DECLARE alarmid INTEGER; DECLARE status INTEGER; DECLARE isdone BOOLEAN; SET time_zone = "+00:00"; SET @status = 0; SELECT (COUNT(expid)>0) INTO @exist FROM EXP WHERE uid = myuid AND tid = mytid; IF(@exist = FALSE) THEN INSERT INTO EXP (uid, tid) VALUES(myuid, mytid); SELECT TASK.uid, TASK.isdone INTO @tuid, @isdone FROM TASK WHERE TASK.tid = mytid; IF (@isdone = TRUE) THEN UPDATE USER SET USER.exp = USER.exp + 1 WHERE USER.uid = @tuid; SET @status = 1; END IF; INSERT INTO EVENT (eventtype, uid1, uid2, tid) VALUES(2, myuid, @tuid, mytid); SELECT (COUNT(*)>0),ALARM.alarmid INTO @exist, @alarmid FROM ALARM WHERE ALARM.alarmtype = 2 AND ALARM.tid = mytid; IF(@exist = TRUE) THEN UPDATE ALARM SET ALARM.tstamp = now() WHERE ALARM.alarmid = @alarmid; ELSE IF(myuid <> @tuid) THEN INSERT INTO ALARM(alarmtype, tid) VALUES(2, mytid); END IF; END IF; ELSE SET @status = -1; END IF; SELECT @status AS status; END // DELIMITER ; /* CREATE COMMENT */ DELIMITER // CREATE PROCEDURE CreateComment( IN myuid int, IN mytid int, IN mycontent char(140) CHARACTER SET utf8, IN myat varchar(256) CHARACTER SET utf8 ) BEGIN DECLARE cid INTEGER; DECLARE tuid INTEGER; DECLARE tid INTEGER; DECLARE tgid, privacy INTEGER; DECLARE rowno INTEGER; DECLARE alarmid, noOfCommas, atuid INTEGER; DECLARE exist BOOLEAN; DECLARE x INT DEFAULT 0; DECLARE y INT DEFAULT 0; DECLARE atusername varchar(256) CHARACTER SET utf8; SET time_zone = "+00:00"; INSERT INTO COMMENT (uid, tid, content) VALUES(myuid, mytid, mycontent); SELECT LAST_INSERT_ID() INTO @cid; SELECT TASK.uid, COMMENT.tid, TASK.tgid, TASK.privacy INTO @tuid,@tid, @tgid, @privacy FROM COMMENT LEFT JOIN TASK ON COMMENT.tid = TASK.tid WHERE COMMENT.commentid = @cid; IF(@privacy > 0 AND myuid <> @tuid) THEN INSERT INTO EVENT(eventtype, uid1, uid2, cid, tid, tgid) VALUES(0, myuid, @tuid, @cid, @tid, @tgid); END IF; IF (myat <> "") THEN SET y = 1; SELECT LENGTH(myat) - LENGTH(REPLACE(myat, ',', '')) INTO @noOfCommas; IF @noOfCommas = 0 THEN SET @exist = FALSE; SELECT SplitString(myat, ',', y) INTO @atusername; SELECT USER.uid, (COUNT(USER.uid)>0) INTO @atuid, @exist FROM USER WHERE username = @atusername; IF(@exist = TRUE) THEN INSERT INTO EVENT(eventtype, uid1, uid2, tid, cid) VALUES(1, myuid, @atuid, mytid, @cid); END IF; ELSE SET x = @noOfCommas + 1; WHILE y <= x DO SET @exist = FALSE; SELECT SplitString(myat, ',', y) INTO @atusername; SELECT USER.uid, (COUNT(USER.uid)>0) INTO @atuid, @exist FROM USER WHERE username = @atusername; IF(@exist = TRUE) THEN INSERT INTO EVENT(eventtype, uid1, uid2, tid, cid) VALUES(1, myuid, @atuid, mytid, @cid); END IF; SET y = y + 1; END WHILE; END IF; END IF; SELECT COUNT(*),ALARM.alarmid INTO @rowno, @alarmid FROM ALARM WHERE ALARM.alarmtype = 1 AND ALARM.tid = @tid; IF(@rowno > 0) THEN UPDATE ALARM SET ALARM.tstamp = now() WHERE ALARM.alarmid = @alarmid; ELSE IF(myuid <> @tuid) THEN INSERT INTO ALARM(alarmtype, tid) VALUES(1, @tid); END IF; END IF; END // DELIMITER ; /* DELETE COMMENT */ DELIMITER // CREATE PROCEDURE DeleteComment( IN mycommentid int ) BEGIN DELETE FROM COMMENT WHERE commentid = mycommentid; SELECT ROW_COUNT() AS rows_affected; DELETE FROM EVENT WHERE EVENT.eventtype=0 AND EVENT.cid=mycommentid; END // DELIMITER ; /* GET COMMENTS */ DELIMITER // CREATE PROCEDURE GetComments( IN myuid int, IN mytid int, IN mylastcid int ) BEGIN DECLARE tuid INTEGER; SET time_zone = "+00:00"; DELETE FROM ALARM WHERE tid = mytid AND alarmtype = 1; SELECT TASK.uid INTO @tuid FROM TASK WHERE tid = mytid; SELECT COMMENT.commentid, COMMENT.uid, COMMENT.tid, COMMENT.content, COMMENT.tstamp, USER.username, USER.firstname, USER.lastname, USER.email, USER.avatar FROM COMMENT LEFT JOIN USER ON COMMENT.uid = USER.uid WHERE COMMENT.commentid > mylastcid AND tid = mytid ORDER BY COMMENT.tstamp ASC LIMIT 10; END // DELIMITER ; /* GET FIGHTOLIST */ DELIMITER // CREATE PROCEDURE GetFightoList( IN mytid int ) BEGIN SET time_zone = "+00:00"; DELETE FROM ALARM WHERE alarmtype = 2 AND tid = mytid; SELECT EXP.expid, USER.firstname, USER.lastname, USER.username, USER.email, USER.avatar, USER.uid FROM EXP LEFT JOIN USER ON EXP.uid = USER.uid WHERE EXP.tid = mytid ORDER BY EXP.expid DESC LIMIT 30; END // DELIMITER ; /* GET NEWS */ DELIMITER // CREATE PROCEDURE GetNews( IN myuid int ) BEGIN SET time_zone = "+00:00"; UPDATE USER SET newststamp = now() WHERE USER.uid = myuid; /* STEP GET ALL COMMENT */ SELECT u1.uid AS uid1,u1.firstname AS firstname1, u1.lastname AS lastname1, u1.avatar AS avatar1, u1.username AS username1, u2.uid AS uid2, u2.username AS username2, u2.firstname AS firstname2, u2.lastname AS lastname2, u2.avatar AS avatar2, TASK.tid, TASK.content AS tcontent, TASK.isdone, TASK.privacy, TASK.deadline, EVENT.tstamp, COMMENT.content AS ccontent, EVENT.cid, EVENT.eventtype,EVENT.eventid, T_GROUP.title,T_GROUP.type, e2.expid IS NOT NULL AS isliked, IFNULL(e3c.texp,0) AS texp, FRIEND.fuid FROM EVENT LEFT JOIN USER u1 ON EVENT.uid1 = u1.uid LEFT JOIN USER u2 ON EVENT.uid2 = u2.uid LEFT JOIN TASK ON EVENT.tid = TASK.tid LEFT JOIN COMMENT ON EVENT.cid = COMMENT.commentid LEFT JOIN T_GROUP ON T_GROUP.tgid = EVENT.tgid LEFT JOIN EXP e2 ON TASK.tid = e2.tid AND myuid = e2.uid LEFT JOIN ( SELECT expid, tid, COUNT(expid) AS texp FROM EXP e3 GROUP BY tid )e3c ON EVENT.tid = e3c.tid LEFT JOIN FRIEND ON (FRIEND.uid = EVENT.uid1 AND FRIEND.fuid = myuid) WHERE EVENT.uid1 = myuid OR EVENT.uid2 = myuid OR EXISTS ( SELECT frid FROM FRIEND WHERE uid = myuid AND EVENT.uid1 = FRIEND.fuid ) ORDER BY EVENT.tstamp DESC LIMIT 50; END // DELIMITER ; /* GET NEWS */ DELIMITER // CREATE PROCEDURE ExpHouseKeeping( ) BEGIN /* STEP GET ALL COMMENT */ DECLARE done BOOLEAN DEFAULT 0; DECLARE huid, htid, hprivacy, htexp INTEGER; DECLARE hisdone BOOLEAN; DECLARE cur1 CURSOR FOR SELECT TASK.uid, TASK.tid, TASK.isdone, TASK.privacy, COUNT(EXP.expid) FROM TASK LEFT JOIN EXP ON TASK.tid = EXP.tid GROUP BY TASK.tid; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; UPDATE USER SET USER.exp = 0; OPEN cur1; read_loop: LOOP FETCH cur1 INTO huid,htid,hisdone,hprivacy,htexp; IF done THEN LEAVE read_loop; END IF; IF(hisdone = TRUE AND hprivacy > 0) THEN UPDATE USER SET USER.exp = USER.exp + htexp WHERE USER.uid = huid; END IF; END LOOP; CLOSE cur1; END // DELIMITER ; /* GET ALARMS */ DELIMITER // CREATE PROCEDURE GetAlarmsByUid( IN myuid int ) BEGIN DECLARE nstamp TIMESTAMP; DECLARE newscount INTEGER; SELECT USER.newststamp INTO @nstamp FROM USER WHERE USER.uid = myuid; SELECT COUNT(*) INTO @newscount FROM EVENT WHERE (EVENT.uid1 = myuid OR EVENT.uid2 = myuid OR EXISTS ( SELECT frid FROM FRIEND WHERE uid = myuid AND EVENT.uid1 = FRIEND.fuid )) AND EVENT.tstamp > @nstamp; ( SELECT ALARM.alarmtype, ALARM.tid, TASK.tgid, ALARM.frid FROM ALARM LEFT JOIN TASK ON ALARM.tid = TASK.tid LEFT JOIN FRIEND ON ALARM.frid = FRIEND.frid WHERE FRIEND.fuid = myuid OR TASK.uid = myuid ) UNION ( SELECT 3 AS alarmtype, @newscount AS tid, null AS tgid, null AS frid ) ORDER BY alarmtype ASC, tgid ASC; END // DELIMITER ; DELIMITER // CREATE FUNCTION SplitString( stringToSplit VARCHAR(256) CHARACTER SET utf8, sign VARCHAR(12) CHARACTER SET utf8, position INT) RETURNS VARCHAR(256) CHARACTER SET utf8 DETERMINISTIC BEGIN RETURN REPLACE( SUBSTRING( SUBSTRING_INDEX(stringToSplit, sign, position), LENGTH(SUBSTRING_INDEX(stringToSplit, sign, position -1)) + 1), sign, ''); END // DELIMITER ;
true
1674345e14c6fa3f4048567b3f0c6e30c472b203
SQL
nogsantos/plsql-oracle-introducao-basica
/aula_02_20-04-2013/Exercicio06_procedure.sql
UTF-8
1,858
3.9375
4
[]
no_license
/* Criar uma procedure que mostre o numero, nome, data admissão (formatar a data em dd/mm/yyyy) e o nome do departamento do empregado 7369. Caso o salário seja menor do que R$1000,00, conceder 20% de aumento. Caso seja maior ou igual a R$1000,00 e menor do que R$10000,00 conceder 15% de aumento. Caso o salário seja maior ou igual a R$10000,00, conceder 10% de aumento. OBS.: Além de mostrar os dados acima, mostrar o salário antigo, o percentual aplicado e o salário novo. */ create or replace procedure aumento_func (incdfunc in func.cd_mat%type) is vcdmat func.cd_mat%type; vnmfunc func.nm_func%type; vdtadm func.dt_adm%type; vvlsal func.vl_sal%type; vcddepto func.cd_depto%type; vpercent number(2); vdeptonome varchar2(250); begin select f.cd_mat, f.nm_func, f.dt_adm, f.vl_sal, f.cd_depto, d.nm_depto into vcdmat, vnmfunc, vdtadm, vvlsal, vcddepto, vdeptonome from func f, depto d where f.cd_depto = d.cd_depto and cd_mat = incdfunc; if vvlsal < 1000 then vpercent := 20; elsif vvlsal >= 1000 and vvlsal < 10000 then vpercent := 15; else vpercent := 10; end if; update func set vl_sal = vl_sal + (vl_sal * vpercent/100); dbms_output.put_line('Número: '||vcdmat||' Nome: '||vnmfunc|| ' Data Adm.: '||to_char(vdtadm,'dd/mm/yyyy')|| ' Nome Depto: '||vdeptonome||' Salário Ant. '||vvlsal|| ' Percentual: '||vpercent||'%'|| ' Salário Novo: '||(vvlsal+(vvlsal*vpercent)/100)); end; / begin aumento_func(10); end; / Resultado: Número: 10 Nome: CRISTINA Data Adm.: 01/01/1995 Nome Depto: DIRETORIA DA EMPRESA Salário Ant. 5275 Percentual: 15% Salário Novo: 6066.25
true
ff26d26fdba55a2b316b8baa35fcda6a6b8a066f
SQL
huiboz/school_intro-to-database
/hw3/hw3_advanced.sql
UTF-8
6,627
4.59375
5
[]
no_license
# Given a month, return what semester that month corresponds to DROP FUNCTION IF EXISTS `convert_semester`; DELIMITER $$ CREATE FUNCTION `convert_semester` (`month` int(16)) RETURNS int(16) BEGIN DECLARE semester INT; if `month` in (9,10,11,12) then SET semester = 1; end if; if `month` in (1,2,3,4) then SET semester = 2; end if; if `month` in (5,6) then SET semester = 3; end if; if `month` in (7,8) then SET semester = 4; end if; RETURN semester; END $$ DELIMITER ; # a view that contains what courses students have taken in what time DROP VIEW IF EXISTS `completed_course`; CREATE VIEW completed_course AS SELECT `course_participant`.`uni` AS `uni`, `sections`.`course_id` AS `courseid`, `sections`.`year` AS `year`, `sections`.`semester` AS `semester` FROM `course_participant` JOIN `sections` ON (`course_participant`.`section_call_no` = `sections`.`call_no`) where EXTRACT(YEAR FROM date(now())) > `sections`.`year` OR (EXTRACT(YEAR FROM date(now())) = `sections`.`year` AND convert_semester(EXTRACT(MONTH FROM date(now()))) > `sections`.`semester`); # a view that contains what courses faculties have taught DROP VIEW IF EXISTS `faculty_course`; CREATE VIEW faculty_course AS SELECT `course_participant`.`uni` AS `uni`, `sections`.`course_id` AS `courseid`, `sections`.`year` AS `year`, `sections`.`semester` AS `semester` FROM `course_participant` JOIN `sections` ON (`course_participant`.`section_call_no` = `sections`.`call_no`) where `course_participant`.`uni` in (select `uni` from `faculty_view`); # Given a student uni and section call number, it checks # if this student satisfies the prereq for that course DROP FUNCTION IF EXISTS `prereq_valid`; DELIMITER $$ CREATE FUNCTION `prereq_valid` (this_uni VARCHAR(12),call_no VARCHAR(5)) RETURNS tinyint(1) BEGIN DECLARE valid int(1); SET valid = (select exists (select a.prereq_id from ((select prereq_id from `course_prereqs` where `course_prereqs`.`course_id` = (select course_id from `sections` where `sections`.`call_no` = call_no)) as a) where a.prereq_id not in (select `courseid` from `completed_course` where `completed_course`.`uni` = `this_uni`))); IF valid = 1 THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END $$ DELIMITER ; # Given a section call number, check if that section still has spots DROP FUNCTION IF EXISTS `student_limit`; DELIMITER $$ CREATE FUNCTION `student_limit` (this_call_no VARCHAR(5)) RETURNS tinyint(1) BEGIN DECLARE currentsize int(10); DECLARE sizelimit int(10); SET sizelimit = (select enrollment_limit from `sections` where call_no = this_call_no); SET currentsize = (select count(*) from `course_participant` where `section_call_no` = `this_call_no` and `course_participant`.`uni` in (select uni from student_view)); IF currentsize < sizelimit THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END $$ DELIMITER ; # given a faculty uni and section call number, check if that faculty # can still teach for the semester of that section DROP FUNCTION IF EXISTS `faculty_limit`; DELIMITER $$ CREATE FUNCTION `faculty_limit` (this_uni VARCHAR(11),this_call_no VARCHAR(5)) RETURNS tinyint(1) BEGIN DECLARE this_year int(11); DECLARE this_semester varchar(45); DECLARE total_count int(11); SET this_year = (select `year` from `sections` where call_no = this_call_no); SET this_semester = (select `semester` from `sections` where call_no = this_call_no); SET total_count = (select count(*) from `course_participant` where (`uni` = this_uni) and ((select `year` from `sections` where `sections`.`call_no` = `course_participant`.section_call_no) = this_year) and ((select `semester` from `sections` where `sections`.`call_no` = `course_participant`.section_call_no) = this_semester)); IF total_count < 3 THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END $$ DELIMITER ; # trigger before insert into `course_participant` # Different constraints apply according to the uni (faculty or student) DROP TRIGGER IF EXISTS `trigger_insert_participant`; DELIMITER $$ CREATE TRIGGER `trigger_insert_participant` BEFORE INSERT ON `course_participant` FOR EACH ROW BEGIN DECLARE uni_type varchar(12); IF NOT EXISTS (select uni from `Person` where `Person`.uni = New.uni) Then SIGNAL SQLSTATE '45002' SET MESSAGE_TEXT = 'uni not found in person table'; END IF; SET uni_type = (select `type` from `Person` where `Person`.uni = New.uni); IF NOT (uni_type = "Student" or uni_type = "Faculty") THEN SIGNAL SQLSTATE '45003' SET MESSAGE_TEXT = 'not valid type'; END IF; IF uni_type = "Student" then IF NOT prereq_valid(New.uni,New.section_call_no) THEN SIGNAL SQLSTATE '45004' SET MESSAGE_TEXT = 'prereq course not satisfied'; END IF; IF NOT student_limit(New.section_call_no) THEN SIGNAL SQLSTATE '45005' SET MESSAGE_TEXT = 'exceed section limit size'; END IF; END IF; IF uni_type = "Faculty" then IF NOT faculty_limit(New.uni,New.section_call_no) THEN SIGNAL SQLSTATE '45004' SET MESSAGE_TEXT = 'faculty can not teach more than 3 sections'; END IF; END IF; END $$ DELIMITER ; #(select `type` from `Person` where `Person`.uni = "BUST1"); #select * from completed_course; #INSERT INTO `course_participant` VALUES ('BUST1','00006'); #select faculty_limit('lafe1','00002') as test, courseid,`year`,semester from completed_course where semester = 4; #(select `courseid` from `completed_course` where `completed_course`.`uni` = 'BUST1'); #INSERT INTO `course_participant` VALUES ('BUST1','00006'); #INSERT INTO `course_participant` VALUES ('BUST1','00001'); #INSERT INTO `course_participant` VALUES ('dajo1','00003'); #INSERT INTO `course_participant` VALUES ('rogo1','00003'); #INSERT INTO `course_participant` VALUES ('edfe1','00003'); #INSERT INTO `course_participant` VALUES ('kelu1','00003'); #INSERT INTO `course_participant` VALUES ('lafe1','00001'); #INSERT INTO `course_participant` VALUES ('lafe1','00003'); #INSERT INTO `course_participant` VALUES ('lafe1','00005'); #INSERT INTO `course_participant` VALUES ('lafe1','00009'); select * from `faculty_course`;
true
d207a9efcc4b247085b161dced115931b8d432ad
SQL
mkcafe/sample
/multitenant/fix_unique_constraint.sql
UTF-8
1,460
3.984375
4
[ "MIT" ]
permissive
create or replace procedure fix_unique_constraint (table_name in varchar2 ,constraint_name in varchar2 := null) is -- Modify unique constraint(s) to include security_group_id l_ddl varchar2(32767); begin for r in ( select c.table_name, c.constraint_name ,decode(c.constraint_type ,'U','unique' ,'P','primary key') as constraint_type ,(select listagg('"'||cc.column_name||'"',',') within group (order by position) from user_cons_columns cc where cc.constraint_name = c.constraint_name and cc.table_name = c.table_name and cc.column_name != 'SECURITY_GROUP_ID' ) as column_list from user_constraints c where c.table_name = fix_unique_constraint.table_name and ((fix_unique_constraint.constraint_name is null and c.constraint_type = 'U') or c.constraint_name = fix_unique_constraint.constraint_name) ) loop l_ddl := 'alter table "' || r.table_name || '" drop constraint "' || r.constraint_name || '"'; dbms_output.put_line(l_ddl); execute immediate l_ddl; l_ddl := 'alter table "' || r.table_name || '" add constraint "' || r.constraint_name || '" ' || r.constraint_type || ' (security_group_id,' || r.column_list || ')'; dbms_output.put_line(l_ddl); execute immediate l_ddl; end loop; end fix_unique_constraint; / show err
true
837a5a70c7fdbaab326a3678384dfcaff14eaf04
SQL
prateekinfi/sapestore
/FinalSapestoreBackup 20180409 1802.sql
UTF-8
163,229
3.140625
3
[]
no_license
-- MySQL Administrator dump 1.4 -- -- ------------------------------------------------------ -- Server version 5.7.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -- -- Create schema sapestore -- CREATE DATABASE IF NOT EXISTS sapestore; USE sapestore; -- -- Definition of table `book_rent` -- DROP TABLE IF EXISTS `book_rent`; CREATE TABLE `book_rent` ( `book_rent_id` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `is_returned` bit(1) DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `return_date` datetime DEFAULT NULL, `isbn` varchar(255) DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, `order_id` bigint(20) DEFAULT NULL, `is_late_fee_paid` bit(1) DEFAULT NULL, PRIMARY KEY (`book_rent_id`), KEY `FKe6xfapmm2vx199xlnmc6tswuy` (`isbn`), KEY `FKt1x509xtyewif4k5vq95jhpnh` (`user_id`), KEY `FKrka54gyx67lus5j9dtq4huck0` (`order_id`), CONSTRAINT `FKe6xfapmm2vx199xlnmc6tswuy` FOREIGN KEY (`isbn`) REFERENCES `books` (`isbn`), CONSTRAINT `FKrka54gyx67lus5j9dtq4huck0` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`order_id`), CONSTRAINT `FKt1x509xtyewif4k5vq95jhpnh` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=662 DEFAULT CHARSET=latin1; -- -- Dumping data for table `book_rent` -- /*!40000 ALTER TABLE `book_rent` DISABLE KEYS */; INSERT INTO `book_rent` (`book_rent_id`,`created_date`,`is_returned`,`last_modified_date`,`return_date`,`isbn`,`user_id`,`order_id`,`is_late_fee_paid`) VALUES (598,'2018-04-05 15:26:23',0x01,'2018-04-05 18:15:46','2018-03-31 15:29:21','2220000000000',99,1256,0x01), (599,'2018-04-05 15:26:23',0x01,'2018-04-05 18:17:43','2018-03-31 15:29:21','9580000000000',99,1256,0x01), (610,'2018-04-05 18:21:50',0x01,'2018-04-06 10:05:34','2018-05-05 00:00:00','9470000000000',137,1278,0x01), (611,'2018-04-05 18:21:50',0x01,'2018-04-05 18:22:31','2018-05-05 00:00:00','9880000000000',137,1278,0x01), (612,'2018-04-05 18:21:50',0x01,'2018-04-06 15:09:25','2018-05-05 00:00:00','9782000000000',137,1278,0x01), (613,'2018-04-05 18:24:02',0x01,'2018-04-06 15:10:30','2018-05-05 00:00:00','9220000000000',137,1279,0x01), (614,'2018-04-05 18:24:02',0x01,'2018-04-06 10:21:34','2018-05-05 00:00:00','1170000000000',137,1279,0x01), (615,'2018-04-06 09:46:29',0x01,'2018-04-06 10:05:37','2018-05-06 00:00:00','9470000000000',99,1284,0x01), (616,'2018-04-06 09:50:18',0x01,'2018-04-06 11:29:30','2018-05-06 00:00:00','1170000000000',99,1288,0x01); INSERT INTO `book_rent` (`book_rent_id`,`created_date`,`is_returned`,`last_modified_date`,`return_date`,`isbn`,`user_id`,`order_id`,`is_late_fee_paid`) VALUES (617,'2018-04-06 10:05:37',0x01,'2018-04-06 11:01:50','2018-05-06 00:00:00','1170000000000',137,1298,0x01), (618,'2018-04-06 11:08:56',0x01,'2018-04-06 11:28:12','2018-05-06 00:00:00','1170000000000',137,1309,0x01), (619,'2018-04-06 11:37:29',0x01,'2018-04-06 15:09:28','2018-05-06 00:00:00','9639000000000',137,1313,0x01), (620,'2018-04-06 11:37:29',0x00,'2018-04-06 19:35:41','2018-05-06 00:00:00','9782000000000',137,1313,0x01), (621,'2018-04-06 12:10:26',0x01,'2018-04-06 19:35:41','2018-05-06 00:00:00','9360000000000',137,1320,0x01), (622,'2018-04-06 12:10:26',0x00,'2018-04-06 19:35:41','2018-05-06 00:00:00','2220000000000',137,1320,0x01), (623,'2018-04-06 12:10:26',0x00,'2018-04-06 19:35:41','2018-05-06 00:00:00','1170000000000',137,1320,0x01), (624,'2018-04-06 12:13:50',0x01,'2018-04-06 14:44:57','2018-05-06 00:00:00','9220000000000',137,1321,0x01), (625,'2018-04-06 12:13:50',0x00,'2018-04-06 14:44:57','2018-05-06 00:00:00','9639000000000',137,1321,0x01); INSERT INTO `book_rent` (`book_rent_id`,`created_date`,`is_returned`,`last_modified_date`,`return_date`,`isbn`,`user_id`,`order_id`,`is_late_fee_paid`) VALUES (626,'2018-04-06 12:21:16',0x01,'2018-04-06 13:00:50','2018-05-06 00:00:00','9360000000000',137,1322,0x01), (627,'2018-04-06 12:32:14',0x01,'2018-04-06 14:39:01','2018-04-08 12:34:56','9638000000000',137,1323,0x01), (628,'2018-04-06 12:38:10',0x01,'2018-04-06 13:21:02','2018-04-04 12:41:12','9560000000000',137,1324,0x01), (629,'2018-04-06 12:55:33',0x01,'2018-04-06 13:01:34','2018-04-04 12:58:48','9220000000000',137,1325,0x01), (630,'2018-04-06 12:55:33',0x01,'2018-04-06 13:15:51','2018-04-04 12:58:48','9560000000000',137,1325,0x01), (631,'2018-04-06 14:47:18',0x00,'2018-04-06 14:57:48','2018-04-07 14:49:57','9560000000000',137,1331,0x01), (632,'2018-04-06 14:47:18',0x01,'2018-04-06 15:10:26','2018-04-07 14:49:57','9638000000000',137,1331,0x01), (633,'2018-04-06 15:45:41',0x01,'2018-04-06 16:30:28','2018-04-07 16:11:46','123',137,1336,0x00), (634,'2018-04-06 15:45:41',0x00,'2018-04-06 19:35:41','2018-04-07 16:11:46','9580000000000',137,1336,0x01); INSERT INTO `book_rent` (`book_rent_id`,`created_date`,`is_returned`,`last_modified_date`,`return_date`,`isbn`,`user_id`,`order_id`,`is_late_fee_paid`) VALUES (635,'2018-04-06 16:34:47',0x01,'2018-04-09 12:47:17','2018-05-06 00:00:00','5560000000000',137,1350,0x01), (636,'2018-04-06 19:30:50',0x00,'2018-04-06 19:52:37','2018-04-07 19:52:37','95812',139,1358,0x00), (637,'2018-04-06 19:30:50',0x00,'2018-04-06 19:52:37','2018-04-07 19:52:37','9220000000000',139,1358,0x01), (638,'2018-04-06 19:30:50',0x00,'2018-04-06 19:52:37','2018-04-07 19:52:37','9780000000000',139,1358,0x01), (639,'2018-04-06 19:30:50',0x00,'2018-04-06 19:52:37','2018-04-07 19:52:37','2220000000000',139,1358,0x01), (640,'2018-04-06 19:30:52',0x01,'2018-04-09 12:46:44','2018-05-06 00:00:00','95812',139,1359,0x01), (641,'2018-04-06 19:30:52',0x01,'2018-04-09 12:47:21','2018-05-06 00:00:00','9220000000000',139,1359,0x01), (642,'2018-04-06 19:30:52',0x01,'2018-04-09 12:46:47','2018-05-06 00:00:00','9780000000000',139,1359,0x01), (643,'2018-04-06 19:30:52',0x01,'2018-04-09 12:46:49','2018-05-06 00:00:00','2220000000000',139,1359,0x01); INSERT INTO `book_rent` (`book_rent_id`,`created_date`,`is_returned`,`last_modified_date`,`return_date`,`isbn`,`user_id`,`order_id`,`is_late_fee_paid`) VALUES (644,'2018-04-06 19:34:27',0x01,'2018-04-09 10:13:49','2018-05-06 00:00:00','95812',139,1360,0x01), (645,'2018-04-06 19:34:27',0x01,'2018-04-09 12:47:24','2018-05-06 00:00:00','9360000000000',139,1360,0x01), (646,'2018-04-07 09:33:14',0x01,'2018-04-09 12:46:20','2018-05-07 00:00:00','9360000000000',5,1369,0x01), (647,'2018-04-09 09:53:57',0x01,'2018-04-09 10:31:52','2018-04-10 09:54:59','5454000000000',5,1374,0x00), (648,'2018-04-09 10:03:36',0x01,'2018-04-09 10:48:57','2018-05-09 00:00:00','5560000000000',5,1376,0x01), (649,'2018-04-09 10:07:22',0x01,'2018-04-09 12:47:49','2018-04-10 10:39:48','9350000000000',137,1377,0x01), (650,'2018-04-09 10:18:04',0x01,'2018-04-09 12:47:52','2018-04-10 10:18:38','1170000000000',155,1379,0x01), (651,'2018-04-09 10:20:43',0x01,'2018-04-09 12:14:08','2018-05-09 00:00:00','7777777777777',155,1380,0x01), (652,'2018-04-09 10:21:06',0x00,'2018-04-09 10:28:43','2018-04-07 10:24:13','9350000000000',137,1381,0x01); INSERT INTO `book_rent` (`book_rent_id`,`created_date`,`is_returned`,`last_modified_date`,`return_date`,`isbn`,`user_id`,`order_id`,`is_late_fee_paid`) VALUES (653,'2018-04-09 10:21:06',0x01,'2018-04-09 17:11:13','2018-04-07 10:24:13','7777777777777',137,1381,0x01), (654,'2018-04-09 10:36:23',0x01,'2018-04-09 11:47:25','2018-05-09 00:00:00','9781473647770',10,1386,0x01), (655,'2018-04-09 10:42:08',0x00,'2018-04-09 10:42:42','2018-04-07 10:42:42','9780141359151',155,1387,0x00), (656,'2018-04-09 10:42:08',0x01,'2018-04-09 17:10:23','2018-04-07 10:42:42','9781473647770',155,1387,0x00), (657,'2018-04-09 10:47:16',0x01,'2018-04-09 12:46:51','2018-05-09 00:00:00','7777777777777',19,1388,0x01), (658,'2018-04-09 11:02:32',0x00,'2018-04-09 11:46:27','2018-04-07 11:06:01','7777777777777',19,1391,0x01), (659,'2018-04-09 12:43:58',0x01,'2018-04-09 12:44:38','2018-04-10 12:44:38','7777777777777',165,1423,0x01), (660,'2018-04-09 12:51:56',0x01,'2018-04-09 12:59:06','2018-04-11 12:59:06','9780141359151',155,1425,0x01), (661,'2018-04-09 13:00:24',0x01,'2018-04-09 16:16:34','2018-04-11 13:01:55','9820000000000',155,1426,0x01); /*!40000 ALTER TABLE `book_rent` ENABLE KEYS */; -- -- Definition of table `books` -- DROP TABLE IF EXISTS `books`; CREATE TABLE `books` ( `isbn` varchar(255) NOT NULL, `author` varchar(255) DEFAULT NULL, `average_rating` float DEFAULT NULL, `book_title` varchar(255) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `full_image` varchar(255) DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `late_fees` double DEFAULT NULL, `publisher` varchar(255) DEFAULT NULL, `rent_price` double DEFAULT NULL, `sell_price` double DEFAULT NULL, `short_desc` varchar(255) DEFAULT NULL, `thumb_image` varchar(255) DEFAULT NULL, `category_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`isbn`), KEY `FK8el3ddb59ciucupyc17vu7835` (`category_id`), CONSTRAINT `FK8el3ddb59ciucupyc17vu7835` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `books` -- /*!40000 ALTER TABLE `books` DISABLE KEYS */; INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('0132335530000','Douglas E Commer',0,'The Internet Book','2018-04-06 17:22:21','0132335530000full.jpg','2018-04-06 17:22:21',12,'Commer Publishers.',50,720,'Internet Book, The: Everything You Need to Know About Computer Networking and How the Internet Works','0132335530000thumb.jpg',4), ('1170000000000','Ranjan Rajveer',4.83,'MESSI : Superstar In Dreams','2018-04-05 10:51:56','1170000000000full.jpg','2018-04-09 17:57:15',25,'Veer Publishing & Co.',75,800,'Messi: More Than a Superstar by Luca Caioli is a biography about the world-class soccer player, Lionel Messi. The book begins with his birth and slowly guides the reader through the life of the star and love of his life','1170000000000thumb.jpg',12), ('123','Bjarne Stroustrup',4.5,'C++ Programming Language','2018-03-29 15:56:45','123full.jpg','2018-04-09 17:57:15',0,'David Thomas',30,300,'C book','123thumb.jpg',1), ('123111','Robert T Kiyosaki',0,'T Rich Dad Poor Dad','2018-04-09 11:31:07','123111full.jpg','2018-04-09 11:31:07',20,'APC Publishers',45,450,'RichDadPoorDad','123111thumb.jpg',1); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('2220000000000','Rachel Renee Russell',4.67,'Dork Diaries 1','2018-03-20 17:08:00','2220000000000full.jpg','2018-04-09 17:57:15',9,'Lady Pippin Publishing',94,978,'book of the New York Times bestselling Dork Diaries series.','2220000000000thumb.jpg',3), ('2399000000000','Amit Saraf',0,'Manufacturing','2018-04-06 17:55:11','2399000000000full.jpg','2018-04-06 17:55:11',12,'ABP Publishers',12,120,'To make this subject easy & interesting main concentration is given on concepts and tries to explain the concepts with proper method.','2399000000000thumb.jpg',11), ('3111','Karl Marks',0,'T Das Kapital','2018-04-09 11:31:09','3111full.jpg','2018-04-09 11:31:09',20,'Rupa Publication',5,55,'DasKapital','3111thumb.jpg',1), ('3216540000','Zidane',5,'Cristiano Ronaldo: Four Times Ballon d\'Or Champion','2018-04-09 12:10:37','3216540000full.jpg','2018-04-09 17:57:15',255,'Mess Mess Messi Publications',956,9674,'Cristiano Ronaldo dos Santos Aveiro GOIH, ComM is a Portuguese professional footballer who plays as a forward for Spanish club Real Madrid and the Portugal national team','3216540000thumb.jpg',12), ('3620000000000','Walter Isaacson',5,'Steve Jobs','2018-03-20 17:08:00','3620000000000full.jpg','2018-04-09 17:57:15',5,'Academic Press',60,666,'Based on more than forty interviews with Jobs conducted over two years','3620000000000thumb.jpg',14); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('5454000000000','Christina Baker Kline',0,'Orphan Train','2018-03-29 14:31:52','5454000000000full.jpg','2018-03-29 14:36:02',16,'William Morrow Paperbacks',43,434,'The author of Bird in Hand and The Way Life Should Be delivers her most ambitious and powerful novel to date: a captivating story of two very different women who build an unexpected friendship','5454000000000thumb.jpg',8), ('5560000000000','Nayantara Shehgal',3.5,'A Voice of Freedom','2018-03-20 17:08:00','5560000000000full.jpg','2018-04-09 17:57:15',9,'W W Norton and co Inc.',75,786,'Voice of Freedom is a participatory photography project in Israel for formerly trafficked women.','5560000000000thumb.jpg',1), ('7777000000000','Nagi Maehashi',0,'The Food Photography','2018-04-06 17:19:32','7777000000000full.jpg','2018-04-06 17:19:32',10,'Meaghan Cook Press',22,230,'This book will not only inspire you to be a better photographer, but it will actually make you one','7777000000000thumb.jpg',5), ('7777777777777','M N Dutt',3.75,'Mahabharat','2018-04-06 18:00:43','7777777777777full.jpg','2018-04-09 17:57:15',100,'New Indian Books',120,1200,'The Mahabharata is a curious mixture of history and mythology','7777777777777thumb.jpg',10); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('787700000000','Robert T Kiyosaki',0,'Rich Dad Poor Dad','2018-04-06 17:32:21','787700000000full.jpg','2018-04-06 17:32:21',2,'APC Publishers',12,120,'Rich Dad Poor Dad is a 1997 book written by Robert Kiyosaki and Sharon Lechter. It advocates the importance of financial literacy','787700000000thumb.jpg',2), ('789456','Robin Sharma',4.5,'Monk Who Sold His Ferrari','2018-04-06 15:37:47','789456full.jpg','2018-04-09 17:57:15',50,'HarperSanFrancisco',12,123,'goodbook','789456thumb.jpg',8), ('8888000000000','Andre Bazin',4.5,'What is Cinema?','2018-04-06 17:17:02','8888000000000full.jpg','2018-04-09 17:57:15',10,'University of California Press',23,230,'Andr Bazin\'s What Is Cinema? (volumes I and II) have been classics of film studies for as long as they\'ve been available','8888000000000thumb.jpg',9), ('9110000000000','Paulo Coelho',0,'The Zaheer','2018-03-20 17:08:00','9110000000000full.jpg','2018-03-29 14:36:02',9,'Harper Collins',75,764,'A guide book or travel guide is \"a book of information about a place, designed for the use of visitors or tourists','9110000000000thumb.jpg',8); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('9150000000000','Mulkraj Anand',0,'Coolie','2018-03-20 17:08:00','9150000000000full.jpg','2018-03-29 14:36:02',8,'Harper Collins',64,654,'Coolie is a novel by Mulk Raj Anand first published in 1936','9150000000000thumb.jpg',8), ('9210000000000','Karl Marks',0,'Das Kapital','2018-03-20 17:08:00','9210000000000full.jpg','2018-04-06 17:39:33',8,'Rupa Publication',64,654,'It is a critical analysis of political economy','9210000000000thumb.jpg',7), ('9220000000000','Ram Mohan Roy',0,'A Gift of Monotheists','2018-03-20 17:08:00','9220000000000full.jpg','2018-03-29 14:36:03',7,'iUniverse',35,450,'A cart or barrow from which apples and other fruit are sold in the street.','9220000000000thumb.jpg',7), ('9350000000000','R. Kippling',5,'Jungle Book','2018-03-20 17:08:00','9350000000000full.jpg','2018-04-09 17:57:15',8,'Academic Press',63,677,'The Jungle Book (1894) is a collection of stories by English Nobel laureate Rudyard Kipling.','9350000000000thumb.jpg',8), ('9360000000000','G. B. Shaw',4.5,'Apple Cart','2018-03-20 17:08:00','9360000000000full.jpg','2018-04-09 17:57:15',7,'Maple Press',35,450,'A cart or barrow from which apples and other fruit are sold in the street.','9360000000000thumb.jpg',8); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('9470000000000','Maxim Gorkay',0,'Mother Mother','2018-03-20 17:08:00','9470000000000full.jpg','2018-04-06 16:56:37',1,'Maple Press',17,220,'The definition can also be extended to non-\',\'Dteail about test book','9470000000000thumb.jpg',8), ('9560000000000','Jawahar Lal Nehru',0,'The Discovery of India','2018-03-20 17:08:00','9560000000000full.jpg','2018-04-06 16:45:53',1,'Kogan Page',19,212,'In The Discovery of India','9560000000000thumb.jpg',7), ('9580000000000','Surendra Nath Bandhopadhye',0,'A Nation is Making','2018-03-20 17:08:00','9580000000000full.jpg','2018-04-06 16:56:37',3,'Harpel Perennial',20,222,'A nation in making; Being the reminiscences of fifty years of public life','9580000000000thumb.jpg',7), ('95812','Helen Keller',4.5,'The Story of My Life','2018-04-06 15:41:02','95812full.jpg','2018-04-09 17:57:15',20,'Bharati Bhavan',5,55,'The Story of My Life, first published in 1903.','95812thumb.jpg',8), ('9630000000000','Charls Dikens',0,'A Tale of Two Cities','2018-03-20 17:08:00','9630000000000full.jpg','2018-04-06 16:41:00',7,'South Asia Books',40,444,'A guide book or travel guide is \"a book of information about a place, designed for the use of visitors or tourists','9630000000000thumb.jpg',8); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('9638000000000','R. K. Narayanan',0,'Guide','2018-03-20 17:08:00','9638000000000full.jpg','2018-04-06 16:41:09',8,'Star Publication',64,786,'A guide book or travel guide is \"a book of information about a place, designed for the use of visitors or tourists','9638000000000thumb.jpg',8), ('9639000000000','Arthur Cotterell',4.5,'A History of Southeast Asia','2018-03-20 17:08:00','9639000000000full.jpg','2018-04-09 17:57:15',9,'South Asia Books',92,977,'A guide book or travel guide is \"a book of information about a place, designed for the use of visitors or tourists\".[1] Travel guides can also take the form of travel websites.','9639000000000thumb.jpg',1), ('9700000000000','Ronald,John,Rafal,Jonathan',0,'Access Contest','2018-03-20 17:08:00','9700000000000full.jpg','2018-04-06 16:50:26',7,'Kogan Page',78,793,'A daily battle for rights and freedoms in cyberspace is being waged in Asia.','9700000000000thumb.jpg',11), ('9729000000000','Nancy Buckingham',3.67,'Tell Me Why #1','2018-03-20 17:08:00','9729000000000full.jpg','2018-04-09 17:57:15',7,'Penguin books',74,342,'The world we knew is gone.','9729000000000thumb.jpg',1); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('9780000000000','Rolf Dobelli',4.25,'The Art of Thinking Clearly','2018-03-20 17:08:00','9780000000000full.jpg','2018-04-09 17:57:15',2,'AA Publishing',41,444,'The Art of Thinking Clearly by world-class thinker and entrepreneur Rolf Dobelli is an eye-opening look at human psychology and reasoning.','9780000000000thumb.jpg',8), ('9780000000067','Ken Blanchard',0.5,'The One Minute Manager','2018-04-06 17:14:20','9780000000067full.jpg','2018-04-09 17:57:15',10,'William Morrow & Co',60,600,'The One Minute Manager is a very short book by Ken Blanchard and Spencer Johnson.','9780000000067thumb.jpg',2), ('978013233559','Olivier Hersent',0,'The Internet Of Things','2018-04-06 17:27:10','978013233559full.jpg','2018-04-06 17:27:10',2,'Wiley India',6.33,64.99,'This book describes the Home Area Networking, Building Automation and AMI protocols and their evolution towards open protocols based on IP.','978013233559thumb.jpg',4), ('9780141359151','John Green',5,'The Fault in Our Stars','2018-04-03 18:28:06','9780141359151full.jpg','2018-04-09 17:57:15',50,'Penguin Books',37.25,374.25,'The Fault in Our Stars is award-winning author John Green\'s most ambitious work','9780141359151thumb.jpg',8); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('9781473647770','David Perlmutter',5,'Grain Brain','2018-03-29 14:34:03','9781473647770full.jpg','2018-04-09 17:57:15',23,'Penguin Books',23,952,'Its about gluten intolerance, a gluten free diet or the foods that help improve brain health.','9781473647770thumb.jpg',6), ('9782000000000','Ramesh Chandra Dutta',0,'Economic History of India','2018-03-20 17:08:00','9782000000000full.jpg','2018-04-06 16:56:37',7,'Perason India',71,737,'Egeon, a merchant of Syracuse, is condemned to death in Ephesus for violating the ban against travel between the two rival cities. ','9782000000000thumb.jpg',7), ('9788177091878','H C Verma',5,'Concepts of Physics 1','2018-03-29 17:09:19','9788177091878full.jpg','2018-04-09 17:57:15',50,'Bharati Bhawan Publishers & Distributors',50,540,'This book is a gem for IIT JEE and AIEEE aspirants who have completed 10th standard.','9788177091878thumb.jpg',1), ('9820000000000','Katharin Mayo',4.75,'Mother India','2018-03-20 17:08:00','9820000000000full.jpg','2018-04-09 17:57:16',2,'AA Publishing',22,630,'It is the story of a poverty-stricken village woman named Radha','9820000000000thumb.jpg',8); INSERT INTO `books` (`isbn`,`author`,`average_rating`,`book_title`,`created_date`,`full_image`,`last_modified_date`,`late_fees`,`publisher`,`rent_price`,`sell_price`,`short_desc`,`thumb_image`,`category_id`) VALUES ('9880000000000','John',4.5,'Rafa','2018-03-20 17:08:00','9880000000000full.jpg','2018-04-09 11:23:39',8,'Kogan Page',62,645,'Egeon, a merchant of Syracuse, is condemned to death in Ephesus for violating the ban against travel between the two rival cities.','9880000000000thumb.jpg',12), ('9900010011112','William Shakespeare',4.5,'As You Like It','2018-04-06 15:17:24','9900010011112full.jpg','2018-04-09 11:23:39',10,'Bharti Bhavan',20,340,'As You Like It is a pastoral comedy by William Shakespeare','9900010011112thumb.jpg',8), ('9960000000000','John Milton',3.75,'Paradise Lost','2018-03-20 17:08:00','9960000000000full.jpg','2018-04-09 11:23:39',2,'BelGrave house',20,631,'A guide book or travel guide is \"a book of information about a place, designed for the use of visitors or tourists\".[1] Travel guides can also take the form of travel websites.','9960000000000thumb.jpg',10); /*!40000 ALTER TABLE `books` ENABLE KEYS */; -- -- Definition of table `cart_details` -- DROP TABLE IF EXISTS `cart_details`; CREATE TABLE `cart_details` ( `cart_details_id` bigint(20) NOT NULL AUTO_INCREMENT, `isbn` varchar(255) DEFAULT NULL, `purchase_type` int(11) DEFAULT NULL, `quantity` int(11) DEFAULT NULL, `cart_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`cart_details_id`), KEY `FKmckpnoiba7pi881nfdjmghnnm` (`cart_id`), CONSTRAINT `FKmckpnoiba7pi881nfdjmghnnm` FOREIGN KEY (`cart_id`) REFERENCES `user_cart` (`cart_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1245 DEFAULT CHARSET=latin1; -- -- Dumping data for table `cart_details` -- /*!40000 ALTER TABLE `cart_details` DISABLE KEYS */; INSERT INTO `cart_details` (`cart_details_id`,`isbn`,`purchase_type`,`quantity`,`cart_id`) VALUES (20,'234567800000',0,8,5), (25,'9880000000000',1,1,7), (78,'9960000000000',0,3,9), (79,'9782000000000',1,1,9), (80,'9880000000000',0,1,9), (81,'9470000000000',0,1,9), (407,'9782000000000',1,1,4), (422,'9470000000000',1,1,33), (1034,'9780000000000',1,1,28), (1035,'9900010011112',1,1,28), (1170,'3111',1,1,8), (1231,'9780141359151',1,1,24), (1232,'9638000000000',1,1,1), (1233,'9560000000000',1,1,1), (1234,'9960000000000',1,1,1), (1235,'9880000000000',1,1,1), (1236,'123',0,1,1), (1242,'9470000000000',1,1,48), (1243,'3216540000',1,1,48), (1244,'9960000000000',1,1,16); /*!40000 ALTER TABLE `cart_details` ENABLE KEYS */; -- -- Definition of table `category` -- DROP TABLE IF EXISTS `category`; CREATE TABLE `category` ( `category_id` bigint(20) NOT NULL AUTO_INCREMENT, `category_name` varchar(255) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, PRIMARY KEY (`category_id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1; -- -- Dumping data for table `category` -- /*!40000 ALTER TABLE `category` DISABLE KEYS */; INSERT INTO `category` (`category_id`,`category_name`,`created_date`,`last_modified_date`) VALUES (1,'Academic and Professional','2018-03-20 21:16:11','2018-03-20 21:16:11'), (2,'Business and Management','2018-03-20 21:16:11','2018-03-20 21:16:11'), (3,'Comics and Graphic Novels','2018-03-20 21:16:11','2018-03-20 21:16:11'), (4,'Computers and Internet','2018-03-20 21:16:11','2018-03-20 21:16:11'), (5,'Food and Wine','2018-03-20 21:16:11','2018-03-20 21:16:11'), (6,'Health','2018-03-20 21:16:11','2018-03-20 21:16:11'), (7,'History and Politics','2018-03-20 21:16:11','2018-03-20 21:16:11'), (8,'Literature and Fiction','2018-03-20 21:16:11','2018-03-20 21:16:11'), (9,'Music Films and Entertainment','2018-03-20 21:16:11','2018-03-20 21:16:11'), (10,'Religion and Spirituality','2018-03-20 21:16:11','2018-03-20 21:16:11'), (11,'Science and Technology','2018-03-20 21:16:11','2018-03-20 21:16:11'), (12,'Sports and Games','2018-03-20 21:16:11','2018-03-20 21:16:11'), (14,'Biography','2018-04-06 17:36:47','2018-04-06 17:36:47'); /*!40000 ALTER TABLE `category` ENABLE KEYS */; -- -- Definition of table `city` -- DROP TABLE IF EXISTS `city`; CREATE TABLE `city` ( `city_id` bigint(20) NOT NULL AUTO_INCREMENT, `city_name` varchar(255) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `postal_code` varchar(255) DEFAULT NULL, `state_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`city_id`), KEY `FK6p2u50v8fg2y0js6djc6xanit` (`state_id`), CONSTRAINT `FK6p2u50v8fg2y0js6djc6xanit` FOREIGN KEY (`state_id`) REFERENCES `state` (`state_id`) ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1; -- -- Dumping data for table `city` -- /*!40000 ALTER TABLE `city` DISABLE KEYS */; INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (1,'Bellflower','2018-03-20 16:01:00','2018-03-20 16:01:00','90706',3), (2,'Avon Park','2018-03-20 16:01:00','2018-03-20 16:01:00','33825',1), (3,'Palo Alto ','2018-03-20 16:01:00','2018-03-20 16:01:00','94020',2), (4,'Los Angeles','2018-03-20 16:01:00','2018-03-20 16:01:00','90001',2), (5,'Tallahassee','2018-03-20 16:01:00','2018-03-20 16:01:00','32301',1), (6,'Bell','2018-03-20 16:01:00','2018-03-20 16:01:00','90040',1), (7,'Cape Coral','2018-03-20 16:01:00','2018-03-20 16:01:00','33903',1), (8,'Eatonville','2018-03-20 16:01:00','2018-03-20 16:01:00','98328',1), (9,'Esto','2018-03-20 16:01:00','2018-03-20 16:01:00','32425',1), (10,'Gretna','2018-03-20 16:01:00','2018-03-20 16:01:00','70053',1), (11,'Hollywood','2018-03-20 16:01:00','2018-03-20 16:01:00','90028',1), (12,'Lake Mary','2018-03-20 16:01:00','2018-03-20 16:01:00','32746',1), (13,'Margate','2018-03-20 16:01:00','2018-03-20 16:01:00','33063',1), (14,'Moody','2018-03-20 16:01:00','2018-03-20 16:01:00','35004',3); INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (15,'McMullen','2018-03-20 16:01:00','2018-03-20 16:01:00','78007',3), (16,'Leeds','2018-03-20 16:01:00','2018-03-20 16:01:00','35094',3), (17,'Irondale','2018-03-20 16:01:00','2018-03-20 16:01:00','35210',3), (18,'Geneva','2018-03-20 16:01:00','2018-03-20 16:01:00','60134',3), (19,'Florala','2018-03-20 16:01:00','2018-03-20 16:01:00','36442',3), (20,'Cardiff','2018-03-20 16:01:00','2018-03-20 16:01:00','92007',3), (21,'Troy','2018-03-20 16:01:00','2018-03-20 16:01:00','48007',3), (22,'San Francisco','2018-03-20 16:01:00','2018-03-20 16:01:00','94016',2), (23,'San Jose','2018-03-20 16:01:00','2018-03-20 16:01:00','94088',2), (24,'Long Beach','2018-03-20 16:01:00','2018-03-20 16:01:00','90712',2), (25,'Orange','2018-03-20 16:01:00','2018-03-20 16:01:00','92705',2), (26,'Redding','2018-03-20 16:01:00','2018-03-20 16:01:00','96001',3), (27,'Corona','2018-03-20 16:01:00','2018-03-20 16:01:00','92877',2), (28,'Santa Cruz','2018-03-20 16:01:00','2018-03-20 16:01:00','95060',2); INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (29,'Napa','2018-03-20 16:01:00','2018-03-20 16:01:00','94558',2), (30,'Dothan','2018-03-20 16:01:00','2018-03-20 16:01:00','36301',2), (31,'Sugar Land','2018-03-20 16:01:00','2018-03-20 16:01:00','77478',4), (32,'McKinney','2018-03-20 16:01:00','2018-03-20 16:01:00','75013',4), (33,'Conroe','2018-03-20 16:01:00','2018-03-20 16:01:00','77301',4), (34,'Denton','2018-03-20 16:01:00','2018-03-20 16:01:00','75065',4), (35,'Allen','2018-03-20 16:01:00','2018-03-20 16:01:00','75002',4), (36,'Elephant','2018-03-20 16:01:00','2018-03-20 16:01:00','87935',4), (37,'Tyler','2018-03-20 16:01:00','2018-03-20 16:01:00','75701',4), (38,'San Marcos','2018-03-20 16:01:00','2018-03-20 16:01:00','92024',4), (39,'Abilene','2018-03-20 16:01:00','2018-03-20 16:01:00','79601',4), (40,'Abilene','2018-03-20 16:01:00','2018-03-20 16:01:00','79601',4), (41,'Newark','2018-03-20 16:01:00','2018-03-20 16:01:00','71010',5), (42,'Atlantic City','2018-03-20 16:01:00','2018-03-20 16:01:00','82010',5); INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (43,'Jersey City','2018-03-20 16:01:00','2018-03-20 16:01:00','73990',5), (44,'Trenton','2018-03-20 16:01:00','2018-03-20 16:01:00','86010',5), (45,'Hoboken','2018-03-20 16:01:00','2018-03-20 16:01:00','70300',5), (46,'Princeton','2018-03-20 16:01:00','2018-03-20 16:01:00','85440',5), (47,'Paterson','2018-03-20 16:01:00','2018-03-20 16:01:00','75220',5), (48,'Paramus','2018-03-20 16:01:00','2018-03-20 16:01:00','76530',5), (49,'Jackson Township','2018-03-20 16:01:00','2018-03-20 16:01:00','85270',5), (50,'Livingston','2018-03-20 16:01:00','2018-03-20 16:01:00','77351',5), (51,'Hughes','2018-03-20 16:01:00','2018-03-20 16:01:00','72348',6), (52,'Bettles','2018-03-20 16:01:00','2018-03-20 16:01:00','99726',6), (53,'Wales','2018-03-20 16:01:00','2018-03-20 16:01:00','10810',6), (54,'Ruby','2018-03-20 16:01:00','2018-03-20 16:01:00','22545',6), (55,'Hydaburg','2018-03-20 16:01:00','2018-03-20 16:01:00','99922',6), (56,'Noorvik','2018-03-20 16:01:00','2018-03-20 16:01:00','99763',6); INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (57,'Gambell','2018-03-20 16:01:00','2018-03-20 16:01:00','90040',6), (58,'Selawik','2018-03-20 16:01:00','2018-03-20 16:01:00','33903',6), (59,'Craig','2018-03-20 16:01:00','2018-03-20 16:01:00','98328',6), (60,'Petersburg','2018-03-20 16:01:00','2018-03-20 16:01:00','32425',6), (61,'Auburn','2018-03-20 16:01:00','2018-03-20 16:01:00','70053',7), (62,'Hampton','2018-03-20 16:01:00','2018-03-20 16:01:00','90028',7), (63,'Clarkston','2018-03-20 16:01:00','2018-03-20 16:01:00','32746',7), (64,'Garden City','2018-03-20 16:01:00','2018-03-20 16:01:00','33063',7), (65,'Thomaston','2018-03-20 16:01:00','2018-03-20 16:01:00','35004',7), (66,'Cedartown','2018-03-20 16:01:00','2018-03-20 16:01:00','78007',7), (67,'Vidalia','2018-03-20 16:01:00','2018-03-20 16:01:00','35094',7), (68,'Cairo','2018-03-20 16:01:00','2018-03-20 16:01:00','35210',7), (69,'dallas','2018-03-20 16:01:00','2018-03-20 16:01:00','60134',7), (70,'Bainbridge','2018-03-20 16:01:00','2018-03-20 16:01:00','36442',7); INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (71,'Bedford','2018-03-20 16:01:00','2018-03-20 16:01:00','92007',8), (72,'Columbia City','2018-03-20 16:01:00','2018-03-20 16:01:00','48007',8), (73,'Columbus','2018-03-20 16:01:00','2018-03-20 16:01:00','94016',8), (74,'Delphi','2018-03-20 16:01:00','2018-03-20 16:01:00','94088',8), (75,'Frankfort','2018-03-20 16:01:00','2018-03-20 16:01:00','90712',8), (76,'Franklin','2018-03-20 16:01:00','2018-03-20 16:01:00','92705',8), (77,'Greensburg','2018-03-20 16:01:00','2018-03-20 16:01:00','96001',8), (78,'Hobart','2018-03-20 16:01:00','2018-03-20 16:01:00','92877',8), (79,'Lawrenceburg','2018-03-20 16:01:00','2018-03-20 16:01:00','95060',8), (80,'Linton','2018-03-20 16:01:00','2018-03-20 16:01:00','94558',8), (81,'ada','2018-03-20 16:01:00','2018-03-20 16:01:00','36301',9), (82,'Avon Park','2018-03-20 16:01:00','2018-03-20 16:01:00','77478',9), (83,'Bellbrook','2018-03-20 16:01:00','2018-03-20 16:01:00','75013',9), (84,'Bellevue','2018-03-20 16:01:00','2018-03-20 16:01:00','77301',9); INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (85,'Brooklyn','2018-03-20 16:01:00','2018-03-20 16:01:00','75065',9), (86,'Brookville','2018-03-20 16:01:00','2018-03-20 16:01:00','75002',9), (87,'Cambridge','2018-03-20 16:01:00','2018-03-20 16:01:00','87935',9), (88,'Campbell','2018-03-20 16:01:00','2018-03-20 16:01:00','75701',9), (89,'Canfield','2018-03-20 16:01:00','2018-03-20 16:01:00','92024',9), (90,'Cheviot','2018-03-20 16:01:00','2018-03-20 16:01:00','79601',9), (91,'Warren','2018-03-20 16:01:00','2018-03-20 16:01:00','79601',10), (92,'Lansing','2018-03-20 16:01:00','2018-03-20 16:01:00','71013',10), (93,'Dearborn','2018-03-20 16:01:00','2018-03-20 16:01:00','36442',10), (94,'Livonia','2018-03-20 16:01:00','2018-03-20 16:01:00','92007',10), (95,'Canton','2018-03-20 16:01:00','2018-03-20 16:01:00','48007',10), (96,'Macomb','2018-03-20 16:01:00','2018-03-20 16:01:00','94016',10), (97,'Southfield','2018-03-20 16:01:00','2018-03-20 16:01:00','94088',10), (98,'Shelby','2018-03-20 16:01:00','2018-03-20 16:01:00','90712',10); INSERT INTO `city` (`city_id`,`city_name`,`created_date`,`last_modified_date`,`postal_code`,`state_id`) VALUES (99,'Westland','2018-03-20 16:01:00','2018-03-20 16:01:00','92720',10), (100,'Flint','2018-03-20 16:01:00','2018-03-20 16:01:00','96001',10); /*!40000 ALTER TABLE `city` ENABLE KEYS */; -- -- Definition of table `country` -- DROP TABLE IF EXISTS `country`; CREATE TABLE `country` ( `country_id` bigint(20) NOT NULL AUTO_INCREMENT, `country_name` varchar(255) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, PRIMARY KEY (`country_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- -- Dumping data for table `country` -- /*!40000 ALTER TABLE `country` DISABLE KEYS */; INSERT INTO `country` (`country_id`,`country_name`,`created_date`,`last_modified_date`) VALUES (1,'USA','2018-03-19 23:58:38','2018-03-20 16:01:00'); /*!40000 ALTER TABLE `country` ENABLE KEYS */; -- -- Definition of table `inventory` -- DROP TABLE IF EXISTS `inventory`; CREATE TABLE `inventory` ( `unique_no` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `is_for_purchase` bit(1) DEFAULT NULL, `is_for_rent` bit(1) DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `purchase_quantity` int(11) DEFAULT NULL, `rent_quantity` int(11) DEFAULT NULL, `isbn` varchar(255) DEFAULT NULL, PRIMARY KEY (`unique_no`), KEY `FKocp9rqsnv1we54njqgpgegu1r` (`isbn`), CONSTRAINT `FKocp9rqsnv1we54njqgpgegu1r` FOREIGN KEY (`isbn`) REFERENCES `books` (`isbn`) ) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=latin1; -- -- Dumping data for table `inventory` -- /*!40000 ALTER TABLE `inventory` DISABLE KEYS */; INSERT INTO `inventory` (`unique_no`,`created_date`,`is_for_purchase`,`is_for_rent`,`last_modified_date`,`purchase_quantity`,`rent_quantity`,`isbn`) VALUES (1,'2018-03-24 16:15:16',0x01,0x01,'2018-04-06 17:23:38',30,48,'2220000000000'), (2,'2018-03-26 16:44:41',0x01,0x01,'2018-04-09 10:18:48',15,6,'3620000000000'), (3,'2018-03-26 16:44:41',0x01,0x01,'2018-04-09 10:18:59',9,3,'5560000000000'), (4,'2018-03-26 16:44:41',0x01,0x01,'2018-04-06 16:43:30',100,100,'9110000000000'), (5,'2018-03-26 16:44:41',0x01,0x01,'2018-03-26 16:44:41',10,4,'9150000000000'), (6,'2018-03-26 16:44:41',0x01,0x01,'2018-03-26 16:44:41',10,5,'9210000000000'), (7,'2018-03-26 16:44:41',0x01,0x01,'2018-04-06 16:45:19',10,8,'9220000000000'), (8,'2018-03-26 16:44:41',0x01,0x01,'2018-04-09 10:23:34',193,100,'9350000000000'), (9,'2018-03-26 16:44:41',0x01,0x01,'2018-04-06 16:46:10',300,197,'9360000000000'), (10,'2018-03-26 16:44:41',0x01,0x01,'2018-04-09 16:16:05',1,10,'9470000000000'), (12,'2018-03-26 16:44:41',0x01,0x01,'2018-04-06 16:45:53',100,100,'9560000000000'), (14,'2018-03-26 16:44:41',0x01,0x01,'2018-04-05 16:03:31',12,22,'9580000000000'); INSERT INTO `inventory` (`unique_no`,`created_date`,`is_for_purchase`,`is_for_rent`,`last_modified_date`,`purchase_quantity`,`rent_quantity`,`isbn`) VALUES (15,'2018-03-26 16:44:41',0x01,0x01,'2018-04-05 16:05:52',80,50,'9630000000000'), (17,'2018-03-26 16:44:41',0x01,0x01,'2018-04-06 16:20:46',58,60,'9638000000000'), (18,'2018-03-26 16:44:41',0x01,0x01,'2018-04-05 16:03:51',88,296,'9639000000000'), (19,'2018-03-26 16:44:41',0x01,0x01,'2018-04-05 16:06:23',10,50,'9700000000000'), (21,'2018-03-26 16:44:41',0x01,0x01,'2018-04-06 10:06:59',7,4,'9729000000000'), (22,'2018-03-26 16:44:41',0x01,0x01,'2018-04-06 10:06:47',10,4,'9780000000000'), (23,'2018-03-26 16:44:41',0x01,0x01,'2018-04-05 16:04:09',211,327,'9782000000000'), (24,'2018-03-26 16:44:41',0x01,0x01,'2018-04-05 16:05:32',88,49,'9820000000000'), (25,'2018-03-26 16:44:42',0x01,0x01,'2018-04-05 16:04:22',0,19,'9880000000000'), (26,'2018-03-26 16:44:42',0x01,0x01,'2018-04-05 16:04:52',17,10,'9960000000000'), (35,'2018-03-29 14:31:52',0x01,0x01,'2018-04-09 09:57:24',3,4,'5454000000000'), (36,'2018-03-29 14:34:03',0x01,0x01,'2018-03-29 14:34:03',117,97,'9781473647770'); INSERT INTO `inventory` (`unique_no`,`created_date`,`is_for_purchase`,`is_for_rent`,`last_modified_date`,`purchase_quantity`,`rent_quantity`,`isbn`) VALUES (42,'2018-03-29 15:56:45',0x01,0x01,'2018-04-09 09:57:10',999,37,'123'), (43,'2018-03-29 17:09:19',0x01,0x01,'2018-04-04 11:44:13',997,500,'9788177091878'), (67,'2018-04-03 18:28:06',0x01,0x01,'2018-04-06 18:23:57',396,98,'9780141359151'), (84,'2018-04-05 10:51:56',0x01,0x01,'2018-04-09 10:18:15',96,31,'1170000000000'), (126,'2018-04-06 15:17:24',0x01,0x01,'2018-04-06 15:17:24',1000,500,'9900010011112'), (131,'2018-04-06 15:37:47',0x01,0x01,'2018-04-06 15:37:47',55,65,'789456'), (134,'2018-04-06 15:41:02',0x01,0x01,'2018-04-06 15:41:02',24,22,'95812'), (140,'2018-04-06 17:14:20',0x01,0x01,'2018-04-06 17:14:20',100,100,'9780000000067'), (141,'2018-04-06 17:17:02',0x01,0x01,'2018-04-06 17:17:02',100,200,'8888000000000'), (142,'2018-04-06 17:19:32',0x01,0x01,'2018-04-06 17:19:32',100,50,'7777000000000'), (143,'2018-04-06 17:22:21',0x00,0x00,'2018-04-09 16:59:20',0,0,'0132335530000'), (144,'2018-04-06 17:27:10',0x01,0x01,'2018-04-06 17:27:10',100,100,'978013233559'); INSERT INTO `inventory` (`unique_no`,`created_date`,`is_for_purchase`,`is_for_rent`,`last_modified_date`,`purchase_quantity`,`rent_quantity`,`isbn`) VALUES (145,'2018-04-06 17:32:21',0x01,0x01,'2018-04-06 17:32:21',100,100,'787700000000'), (146,'2018-04-06 17:55:11',0x01,0x01,'2018-04-06 17:55:11',100,100,'2399000000000'), (147,'2018-04-06 18:00:43',0x01,0x01,'2018-04-06 18:00:43',100,93,'7777777777777'), (159,'2018-04-09 11:31:07',0x01,0x01,'2018-04-09 11:31:07',25,25,'123111'), (160,'2018-04-09 11:31:09',0x01,0x01,'2018-04-09 11:31:09',25,25,'3111'), (161,'2018-04-09 12:10:37',0x01,0x01,'2018-04-09 12:10:37',324,65,'3216540000'); /*!40000 ALTER TABLE `inventory` ENABLE KEYS */; -- -- Definition of table `login` -- DROP TABLE IF EXISTS `login`; CREATE TABLE `login` ( `login_id` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `is_active` bit(1) DEFAULT NULL, `is_verified` bit(1) DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `otp` int(11) DEFAULT NULL, `token_generated_date` datetime DEFAULT NULL, `token_id` varchar(255) DEFAULT NULL, `user_name` varchar(255) DEFAULT NULL, `user_password` varchar(255) DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`login_id`), UNIQUE KEY `UK_mdn86t4w3fej4iei71lv79w6f` (`user_name`), KEY `FK5ajtethlf6rmcnipoat0r1qrb` (`user_id`), CONSTRAINT `FK5ajtethlf6rmcnipoat0r1qrb` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=144 DEFAULT CHARSET=latin1; -- -- Dumping data for table `login` -- /*!40000 ALTER TABLE `login` DISABLE KEYS */; INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (1,'2018-03-22 13:14:58',0x00,0x00,'2018-03-22 13:42:07',NULL,'2018-03-22 13:42:07','5ae3eac2-d9a4-4500-a47c-78b8280dc210','vsanse','8B64D2451B7A8F3FD17390F88EA35917',1), (2,'2018-03-22 13:42:34',0x00,0x00,'2018-04-03 19:14:33',NULL,'2018-04-03 19:14:33','e669f352-9879-4594-aadb-7e88c20da9f8','vishu','3FC0A7ACF087F549AC2B266BAF94B8B1',2), (3,'2018-03-22 13:43:05',0x00,0x00,'2018-03-28 12:25:06',NULL,NULL,NULL,'vishalmujumdar','A0E2842A48F4B678D1E9A5872C07BD6D',3), (4,'2018-03-22 13:57:51',0x00,0x00,'2018-03-24 18:51:30',NULL,'2018-03-24 18:51:30','0d1d9685-3ea7-4532-ab59-32d22b1dd257','ksha','25D55AD283AA400AF464C76D713C07AD',4), (5,'2018-03-22 17:02:57',0x00,0x01,'2018-04-09 15:01:06',NULL,'2018-04-06 09:19:36','8657ecc6-675e-468c-872d-fd2957db69f2','prachithapliyal10@gmail.com','368C601C9D0D574764E425ECC8EEF60A',5), (6,'2018-03-22 17:07:44',0x00,0x00,'2018-03-27 16:14:27',NULL,'2018-03-27 16:14:27','3040a581-d6ea-44e7-a622-af9e5eee42f5','a','4124BC0A9335C27F086F24BA207A4912',6); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (7,'2018-03-22 17:18:26',0x00,0x00,'2018-03-22 17:18:26',NULL,NULL,NULL,'navu','09B80A86065734F0C58BEFDD30E80E8F',7), (8,'2018-03-23 08:39:55',0x00,0x00,'2018-03-23 08:39:55',NULL,NULL,NULL,'xx','4A8A08F09D37B73795649038408B5F33',8), (9,'2018-03-23 09:26:47',0x00,0x00,'2018-03-23 09:26:47',NULL,NULL,NULL,'j','7B774EFFE4A349C6DD82AD4F4F21D34C',9), (10,'2018-03-23 09:30:49',0x00,0x01,'2018-04-09 11:06:44',NULL,'2018-04-09 10:33:09','025bb77c-7c63-444d-916b-c2ff06d01410','absvgdf','368C601C9D0D574764E425ECC8EEF60A',10), (11,'2018-03-23 09:33:51',0x00,0x00,'2018-03-27 15:12:38',NULL,'2018-03-27 15:12:38','95a3fc1d-c05d-4ca8-9eb7-7b6a38e4ef83','p','83878C91171338902E0FE0FB97A8C47A',11), (12,'2018-03-23 10:30:07',0x00,0x00,'2018-03-23 10:30:07',NULL,NULL,NULL,'test','97EED2A2741515AC3F659C5F63D4EB7A',14), (13,'2018-03-23 10:29:48',0x00,0x00,'2018-04-02 16:12:09',NULL,'2018-04-02 16:12:09','75912277-6a2a-40fc-8552-9bbc526a5b57','thakur','95F70335C1E28EB9F01E3DCA665187FF',15), (14,'2018-03-23 10:35:04',0x00,0x00,'2018-04-02 16:12:21',NULL,'2018-04-02 16:12:21','9e6803eb-dd17-4f42-a719-cad36f63e3f2','ad','0CC175B9C0F1B6A831C399E269772661',16); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (15,'2018-03-23 10:36:26',0x00,0x00,'2018-03-23 10:36:26',NULL,NULL,NULL,'7','03C7C0ACE395D80182DB07AE2C30F034',18), (16,'2018-03-23 10:38:20',0x00,0x01,'2018-04-09 10:17:12',NULL,'2018-04-04 14:24:05','8fb9b9c7-2af8-41cc-bb89-404fafed2f26','shreya','25F9E794323B453885F5181F1B624D0B',19), (18,'2018-03-23 10:59:22',0x00,0x00,'2018-04-03 23:06:02',NULL,'2018-04-03 23:06:02','071f6d0c-c1d4-41a2-9444-65072f554120','q','0AB7FACF236F7A9FD08B9A57D4FC10EE',22), (19,'2018-03-23 11:43:14',0x00,0x00,'2018-03-23 11:43:14',NULL,NULL,NULL,'l','2DB95E8E1A9267B7A1188556B2013B33',23), (20,'2018-03-23 12:40:17',0x00,0x00,'2018-03-28 14:20:49',NULL,'2018-03-28 14:20:49','6f7c3e1e-0d02-4baa-b73d-e6aa94bb6618','vb','E9AD559F94FBA77B26482D168E0A6908',24), (21,'2018-03-23 12:55:48',0x00,0x01,'2018-04-09 14:09:35',NULL,'2018-04-04 11:47:28','08846efb-5a51-428a-af5b-d5c4da9d9dc6','aditya.dobhal','25F9E794323B453885F5181F1B624D0B',26), (23,'2018-03-23 13:01:02',0x00,0x00,'2018-03-23 13:01:02',NULL,NULL,NULL,'adi','099B3B060154898840F0EBDFB46EC78F',28); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (24,'2018-03-23 14:35:06',0x00,0x00,'2018-03-26 10:42:30',NULL,'2018-03-26 10:42:30','bf3f6675-c764-4122-a675-93a942792884','aaaa','578D5AD6D436B446A5DB03A558112DDF',30), (25,'2018-03-23 16:09:34',0x00,0x00,'2018-04-02 14:13:21',NULL,'2018-04-02 14:13:21','50ab5f5a-e7e9-44ec-b088-bc52fdc3c666','sakshi','773E306FD551975CD27E40FCC0FBE3A3',31), (26,'2018-03-23 16:14:37',0x00,0x00,'2018-03-26 14:26:15',NULL,'2018-03-26 14:26:15','a73c7280-3e31-4c0a-902a-a1cac8d62319','ab','0CC175B9C0F1B6A831C399E269772661',33), (27,'2018-03-23 16:16:06',0x00,0x00,'2018-03-26 14:26:16',NULL,'2018-03-26 14:26:16','c22e233a-fdf2-47aa-9db3-849e26f33b96','abc','0CC175B9C0F1B6A831C399E269772661',34), (28,'2018-03-23 18:30:35',0x00,0x00,'2018-03-23 18:30:35',NULL,NULL,NULL,'sagar','11E83F0F17A13ACCF02A837B5D563E2C',35), (29,'2018-03-23 19:12:17',0x00,0x00,'2018-03-23 19:12:17',NULL,NULL,NULL,'pgar','prateek123',37), (30,'2018-03-24 17:23:43',0x00,0x00,'2018-04-09 16:32:54',NULL,'2018-04-02 16:12:06','de44cee1-aba9-4ee7-9d1a-d59cea087f55','thakursagar','B4078C14FBCB7B3EF69A5F915A753D5B',38); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (31,'2018-03-24 18:17:55',0x00,0x00,'2018-03-24 18:17:55',NULL,NULL,NULL,'mehran','78E9C8087EB1516F5ACF58A36DAF6194',39), (32,'2018-03-24 18:51:54',0x00,0x00,'2018-03-24 18:51:54',NULL,NULL,NULL,'asdas','B4078C14FBCB7B3EF69A5F915A753D5B',40), (33,'2018-03-26 09:17:23',0x00,0x00,'2018-04-04 13:59:25',NULL,NULL,NULL,'PrachiThapliyal','1A01B667D658BC8DDADDC296909BDC36',41), (34,'2018-03-26 09:46:58',0x00,0x01,'2018-04-02 14:32:05',NULL,'2018-04-02 14:31:31','9af6c2f2-cddc-4774-90d3-32b486beee60','veersrish101','0659C7992E268962384EB17FAFE88364',42), (35,'2018-03-26 09:51:45',0x00,0x00,'2018-04-09 16:18:36',NULL,'2018-04-05 09:37:15','6ac85218-a1a3-41ae-a3f5-9042e2ac230a','tgarg9','ED4E7298B1F3F1A3E233E7385E788D85',43), (36,'2018-03-26 09:55:25',0x00,0x00,'2018-03-26 10:44:54',NULL,'2018-03-26 10:44:54','dd132eae-6464-441e-82a2-4bf511ab2ed8','kladha','25D55AD283AA400AF464C76D713C07AD',44), (37,'2018-03-26 10:43:01',0x00,0x00,'2018-03-26 19:53:25',NULL,'2018-03-26 19:53:25','f45d1d8f-2d97-4a53-a6ac-86e2fd50b110','abcdefghijklmnopqrstuvwxyz','CBF11C02FAED18AD0BB69BD6285178F5',48); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (38,'2018-03-26 10:45:21',0x00,0x00,'2018-04-09 14:25:41',NULL,'2018-04-09 09:29:05','32670fb1-6341-426a-b4e5-b3cc92756efd','sapient','691EC91F8FC238EDEE46CDE1E4731402',49), (39,'2018-03-26 10:43:43',0x00,0x00,'2018-03-28 14:18:03',NULL,NULL,NULL,'vbisht','E9AD559F94FBA77B26482D168E0A6908',50), (40,'2018-03-26 10:43:47',0x00,0x00,'2018-04-03 09:28:16',NULL,'2018-04-03 09:28:16','d394f471-8aff-4dab-8bf7-1be23defe085','SHREYA1','F430D1F5D67E8DA6A429A0417A537E1C',51), (41,'2018-03-26 10:44:50',0x00,0x00,'2018-03-26 10:46:19',NULL,'2018-03-26 10:46:19','61bccbfc-8915-47d8-8cb1-202ae3264e7b','tseth1','ED4E7298B1F3F1A3E233E7385E788D85',52), (42,'2018-03-26 10:46:11',0x00,0x00,'2018-03-26 10:54:40',NULL,'2018-03-26 10:54:40','9a7a58ce-183d-4608-99b0-cbb41b954f04','aditya','442E0AA812E5C50C41A8726EC6AF8870',53), (43,'2018-03-26 10:46:24',0x00,0x00,'2018-04-09 17:17:54',NULL,NULL,NULL,'pallavi','25F9E794323B453885F5181F1B624D0B',54); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (44,'2018-03-26 11:32:41',0x00,0x00,'2018-03-28 16:20:22',NULL,NULL,NULL,'vyad5','25D55AD283AA400AF464C76D713C07AD',57), (45,'2018-03-26 11:32:53',0x00,0x00,'2018-03-26 11:32:53',NULL,NULL,NULL,'aaaaaa','442E0AA812E5C50C41A8726EC6AF8870',58), (46,'2018-03-26 12:10:31',0x00,0x00,'2018-03-26 12:10:31',NULL,NULL,NULL,'prateek','25D55AD283AA400AF464C76D713C07AD',59), (47,'2018-03-26 12:35:37',0x00,0x00,'2018-03-26 16:05:27',NULL,NULL,NULL,'aditya10','25D55AD283AA400AF464C76D713C07AD',60), (48,'2018-03-26 14:00:44',0x00,0x00,'2018-03-26 14:00:44',NULL,NULL,NULL,'salsalal','7DD8C8E30FDC70F1A7CD8E7BD62395D0',61), (49,'2018-03-26 14:22:54',0x00,0x00,'2018-03-26 14:22:54',NULL,NULL,NULL,'stanuj','613A9001C83F9C13F6630EBAD3BACF00',62), (50,'2018-03-26 14:35:19',0x00,0x00,'2018-03-26 14:35:19',NULL,NULL,NULL,'Razorfish','767FE49694D7CF668F47D717C49B9E13',63), (51,'2018-03-26 15:00:20',0x00,0x00,'2018-04-03 11:25:30',NULL,'2018-04-03 11:25:30','a9c48118-b20a-4831-b844-1255b8739651','vikas','25D55AD283AA400AF464C76D713C07AD',64); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (52,'2018-03-26 15:01:59',0x00,0x00,'2018-03-26 15:01:59',NULL,NULL,NULL,'vikas1','25D55AD283AA400AF464C76D713C07AD',65), (53,'2018-03-26 15:03:56',0x00,0x00,'2018-03-26 15:03:56',NULL,NULL,NULL,'vikas12','25D55AD283AA400AF464C76D713C07AD',66), (54,'2018-03-26 15:05:19',0x00,0x00,'2018-03-26 15:05:19',NULL,NULL,NULL,'vikas2','25D55AD283AA400AF464C76D713C07AD',67), (55,'2018-03-26 16:17:00',0x00,0x00,'2018-03-26 20:21:00',NULL,NULL,NULL,'abcde','578D5AD6D436B446A5DB03A558112DDF',68), (56,'2018-03-26 16:54:55',0x00,0x00,'2018-03-26 16:54:55',NULL,NULL,NULL,'sap_digitas','482C811DA5D5B4BC6D497FFA98491E38',69), (57,'2018-03-26 17:13:58',0x00,0x00,'2018-03-26 17:13:58',NULL,NULL,NULL,'testUser','25DF916B353D4BA24E3B2731F55CA882',70), (58,'2018-03-26 19:43:47',0x00,0x00,'2018-03-26 19:43:47',NULL,NULL,NULL,'abcdefghijklmnopqrstuvwxyz1','F06F2B64EE918E735C50678F5FF066F2',71), (60,'2018-03-27 11:08:43',0x00,0x01,'2018-04-06 11:06:01',NULL,'2018-04-03 12:28:56','36b2a99b-f674-47e3-9419-66d4b4268cb3','abhan95','1FFDBC3EB59E4BA0755DB58CEF169778',77); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (61,'2018-03-27 12:07:06',0x00,0x00,'2018-03-27 12:07:06',NULL,NULL,NULL,'abcdeabcdeabcdeabcdeabcdea','25D55AD283AA400AF464C76D713C07AD',78), (62,'2018-03-27 13:54:06',0x00,0x00,'2018-03-28 10:20:32',NULL,'2018-03-28 10:20:32','4194476e-dbb6-4563-8fa7-04ee0eb06573','prachi','D8398E38E4A54822B964134AEAA2E165',79), (63,'2018-03-27 14:53:05',0x00,0x00,'2018-03-29 14:36:50',NULL,NULL,NULL,'prachi10','0BCBBF73E55E58DF87527A6D406D0FA9',80), (64,'2018-03-27 15:13:55',0x00,0x00,'2018-03-27 15:13:55',NULL,NULL,NULL,'prachi101','0BCBBF73E55E58DF87527A6D406D0FA9',81), (65,'2018-03-27 17:11:23',0x00,0x00,'2018-03-27 17:11:23',NULL,NULL,NULL,'keshav1234','DD9D21E22391090DDCE7C6ED58C6412D',82), (66,'2018-03-28 08:50:25',0x00,0x00,'2018-04-03 12:45:22',NULL,'2018-04-03 11:50:58','33bc3f94-aabb-473f-a262-f189c4fa2892','khushi123','B4F1AD4EFAD256223FCB6126F9BD7385',83), (67,'2018-03-28 09:06:49',0x00,0x00,'2018-03-28 09:06:49',NULL,NULL,NULL,'khushi1','25D55AD283AA400AF464C76D713C07AD',84); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (68,'2018-03-28 09:21:43',0x00,0x00,'2018-03-28 09:21:43',NULL,NULL,NULL,'aditi123','2B6AF4C5A1A6387FD6FBFF6C7089A76D',85), (69,'2018-03-28 09:52:46',0x00,0x00,'2018-03-28 09:52:46',NULL,NULL,NULL,'vyad6','25D55AD283AA400AF464C76D713C07AD',86), (70,'2018-03-28 09:57:10',0x00,0x00,'2018-04-02 16:22:36',NULL,'2018-04-02 16:22:36','f1f9487b-e78a-47e7-80e2-94dba0c4d82e','henry','25F9E794323B453885F5181F1B624D0B',87), (71,'2018-03-28 09:58:53',0x00,0x00,'2018-03-28 09:58:53',NULL,NULL,NULL,'vyad7','25D55AD283AA400AF464C76D713C07AD',88), (72,'2018-03-28 09:59:58',0x00,0x00,'2018-03-28 10:09:10',NULL,'2018-03-28 10:09:10','a2dc17b3-a6d9-4632-a4ea-ca321c93ab24','sunaina','25F9E794323B453885F5181F1B624D0B',89), (73,'2018-03-28 10:09:16',0x00,0x00,'2018-03-28 10:09:16',NULL,NULL,NULL,'bhavana','25F9E794323B453885F5181F1B624D0B',90), (74,'2018-03-28 10:12:59',0x00,0x00,'2018-03-28 10:12:59',NULL,NULL,NULL,'prachi111','1A01B667D658BC8DDADDC296909BDC36',91); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (75,'2018-03-28 10:20:55',0x00,0x00,'2018-04-02 15:34:23',NULL,NULL,NULL,'prach11','1A01B667D658BC8DDADDC296909BDC36',92), (76,'2018-03-28 10:31:37',0x00,0x00,'2018-04-03 09:31:54',NULL,'2018-04-03 09:31:54','3ebfde62-6d4f-4dab-a426-0062f69b1fca','ajain','25F9E794323B453885F5181F1B624D0B',93), (79,'2018-03-28 10:57:24',0x00,0x00,'2018-03-28 10:57:24',NULL,NULL,NULL,'qazwsx','8A9170C42EFFA2F6B3346818338D8EE3',96), (80,'2018-03-28 12:48:59',0x00,0x00,'2018-03-28 12:52:22',NULL,'2018-03-28 12:52:22','237b8bd2-3468-4aa8-a3c0-12372ce3a205','12','578D5AD6D436B446A5DB03A558112DDF',97), (81,'2018-03-28 13:24:25',0x00,0x00,'2018-03-28 13:24:25',NULL,NULL,NULL,'rsingla','359C95FC5A9652CD47C265F556FDE987',98), (82,'2018-03-28 14:21:41',0x00,0x00,'2018-04-09 16:28:41',NULL,'2018-04-06 16:52:05','76e76444-e467-42bd-a187-6923ce12c17e','vb123','00F7FC67CB14BD9BB6ABF6385EA59F34',99), (83,'2018-03-28 14:32:59',0x00,0x00,'2018-03-28 14:32:59',NULL,NULL,NULL,'vb1234','68F43C8272E5B808FB0B2A0EEFF46D1F',100); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (84,'2018-03-28 15:07:44',0x00,0x00,'2018-03-28 15:08:15',NULL,NULL,NULL,'prachi222','FC9BDFA11BEBA02131E2DB8CFF35DF47',101), (87,'2018-03-28 16:00:56',0x00,0x00,'2018-03-28 16:00:56',NULL,NULL,NULL,'addddd','25D55AD283AA400AF464C76D713C07AD',104), (93,'2018-03-29 12:21:35',0x00,0x00,'2018-03-29 12:27:47',NULL,NULL,NULL,'mohandas','A7F1AB5740211857C2945B8832F28889',111), (94,'2018-03-29 13:59:11',0x00,0x00,'2018-03-29 13:59:11',NULL,NULL,NULL,'adddddd','25D55AD283AA400AF464C76D713C07AD',112), (95,'2018-03-29 14:47:12',0x00,0x00,'2018-03-29 14:47:12',NULL,NULL,NULL,'abhan951','93A66FCA8C017B1803E20EA5F55A464E',113), (96,'2018-03-29 22:50:50',0x00,0x00,'2018-04-03 15:46:08',NULL,'2018-04-03 15:46:08','ae804b75-bef4-43a4-b2d9-4e9df666231f','ccccc','B95E04D2820BB1DA245C6F9A1273AD28',114), (97,'2018-03-29 23:17:33',0x00,0x00,'2018-03-29 23:17:33',NULL,NULL,NULL,'xedro','16A9733968596A00EEF7E673046CE6DD',115), (98,'2018-04-02 14:14:08',0x00,0x00,'2018-04-02 14:14:08',NULL,NULL,NULL,'sakshi_k','773E306FD551975CD27E40FCC0FBE3A3',116); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (99,'2018-04-02 15:19:03',0x00,0x00,'2018-04-02 15:21:23',NULL,'2018-04-02 15:20:56','3501b630-cc8a-41b2-bff4-7012b19ed973','vyad25','55E45D5A71D538CD392E74A0FF23747C',117), (100,'2018-04-02 16:16:46',0x00,0x00,'2018-04-02 16:18:26',NULL,'2018-04-02 16:18:26','be05499e-ddba-4fda-adaf-888742dee090','swati','56467F0B2BE99421FAA52776D31D98EE',119), (101,'2018-04-03 09:32:28',0x00,0x00,'2018-04-06 09:19:15',NULL,'2018-04-06 09:19:15','6bf2c6e1-de00-489a-8148-5fc2b5a652fa','ajain1','702140C403565A01209CDA7A1C4097C1',120), (102,'2018-04-03 09:40:39',0x00,0x01,'2018-04-06 10:41:08',NULL,'2018-04-06 10:40:43','706c7bef-9d27-46ee-a45a-a076d27bfd7a','aditi_madaan','D67804709BCAD0DE0EDB8861A0918877',121), (103,'2018-04-03 10:48:06',0x00,0x00,'2018-04-03 10:48:06',NULL,NULL,NULL,'khushi1234','8C3B4E0723398AA778FD8C1D08983297',122), (104,'2018-04-03 15:46:34',0x00,0x00,'2018-04-03 15:46:34',NULL,NULL,NULL,'aaaaa','4423F3812D3EAEDA369E9CBE963A7854',123); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (106,'2018-04-03 18:02:21',0x00,0x00,'2018-04-03 18:02:21',NULL,NULL,NULL,'123456789','25F9E794323B453885F5181F1B624D0B',125), (110,'2018-04-04 09:36:23',0x00,0x00,'2018-04-04 09:36:23',NULL,NULL,NULL,'vsanse1','3FC0A7ACF087F549AC2B266BAF94B8B1',132), (111,'2018-04-04 09:48:21',0x00,0x01,'2018-04-09 09:42:19',NULL,'2018-04-09 09:41:42','ec397b0c-5950-446d-bfac-2b6eee951f56','keshav','3FC0A7ACF087F549AC2B266BAF94B8B1',133), (113,'2018-04-04 10:08:52',0x00,0x00,'2018-04-04 10:08:52',NULL,NULL,NULL,'ashu.s','8CFA2282B17DE0A598C010F5F0109E7D',135), (114,'2018-04-04 10:17:08',0x00,0x01,'2018-04-09 16:33:10',NULL,NULL,NULL,'vishu123','8E0A4056E0A3449E9322E3250F71E34F',137), (115,'2018-04-04 11:23:25',0x00,0x00,'2018-04-04 11:23:25',NULL,NULL,NULL,'prachithapl','368C601C9D0D574764E425ECC8EEF60A',138), (116,'2018-04-04 12:41:00',0x00,0x01,'2018-04-05 10:55:56',NULL,'2018-04-05 10:57:27','cde264ae-0d30-4a60-838e-c77ed7c2eeae','khushi','25D55AD283AA400AF464C76D713C07AD',139), (117,'2018-04-04 13:56:45',0x00,0x00,'2018-04-04 13:56:45',NULL,NULL,NULL,'asasa','578D5AD6D436B446A5DB03A558112DDF',140); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (118,'2018-04-04 14:07:21',0x00,0x00,'2018-04-09 16:56:59',NULL,NULL,NULL,'Tarun','25D55AD283AA400AF464C76D713C07AD',141), (122,'2018-04-04 14:28:27',0x00,0x00,'2018-04-04 14:28:27',NULL,NULL,NULL,'sid123','25F9E794323B453885F5181F1B624D0B',145), (124,'2018-04-04 14:42:56',0x00,0x00,'2018-04-04 14:42:56',NULL,NULL,NULL,'siddharth','8AB18827EB6877F6D400EE67EC732EE7',147), (125,'2018-04-04 14:47:17',0x00,0x01,'2018-04-09 14:09:08',NULL,'2018-04-04 14:48:03','c4b5dcf2-6a0d-445d-bd82-7cfdca7db3fb','siddharthgupta','578D5AD6D436B446A5DB03A558112DDF',148), (127,'2018-04-04 14:56:40',0x00,0x00,'2018-04-04 14:56:40',NULL,NULL,NULL,'prachithapliyalt','DB32DB4324B078144F368E327BE99D56',150), (128,'2018-04-04 15:00:31',0x00,0x00,'2018-04-05 11:44:16',NULL,'2018-04-05 11:44:16','34b21da2-00d5-492f-8a7f-af8ccb7bc02c','khushi12','25D55AD283AA400AF464C76D713C07AD',151), (129,'2018-04-04 14:58:18',0x00,0x00,'2018-04-09 09:38:57',NULL,'2018-04-09 09:38:57','55090087-89d8-4c73-8bcb-ef2096ca7b16','kladha1','691EC91F8FC238EDEE46CDE1E4731402',152); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (130,'2018-04-04 14:58:40',0x00,0x00,'2018-04-04 14:58:40',NULL,NULL,NULL,'prachii','368C601C9D0D574764E425ECC8EEF60A',153), (131,'2018-04-04 15:43:25',0x00,0x01,'2018-04-05 13:35:25',NULL,'2018-04-04 15:44:12','952ac53f-2067-4cff-8eab-bf3e9ccb5ceb','abhi10','6EBE76C9FB411BE97B3B0D48B791A7C9',154), (132,'2018-04-05 11:00:24',0x00,0x01,'2018-04-09 14:34:58',NULL,'2018-04-09 10:11:25','4ab62c9d-648b-4756-a83d-18543beb7878','veersrish','E807F1FCF82D132F9BB018CA6738A19F',155), (133,'2018-04-05 14:38:35',0x00,0x00,'2018-04-05 14:38:35',NULL,NULL,NULL,'vsanser','0D0E2338B8F6AF31AC7227AAED4E819C',156), (135,'2018-04-06 10:25:46',0x00,0x00,'2018-04-06 10:25:46',NULL,NULL,NULL,'prachiiii','174A8AA2ED1D77A12D133A5BB2C4D00A',159), (136,'2018-04-06 12:03:25',0x00,0x00,'2018-04-06 12:03:25',NULL,NULL,NULL,'srishti','35FF6F6F54F472346785E6C725AB29EB',160), (137,'2018-04-06 16:57:47',0x00,0x00,'2018-04-09 14:39:06',NULL,'2018-04-09 14:37:38','405823cf-63a6-46ac-9514-d57b4649cab3','ashu.18','3FC0A7ACF087F549AC2B266BAF94B8B1',161); INSERT INTO `login` (`login_id`,`created_date`,`is_active`,`is_verified`,`last_modified_date`,`otp`,`token_generated_date`,`token_id`,`user_name`,`user_password`,`user_id`) VALUES (138,'2018-04-06 16:59:26',0x00,0x00,'2018-04-09 15:57:19',NULL,NULL,NULL,'palakh`','3FC0A7ACF087F549AC2B266BAF94B8B1',162), (139,'2018-04-06 17:01:31',0x00,0x00,'2018-04-09 16:13:48',NULL,'2018-04-06 17:29:23','094aa1bd-0fbf-4047-a146-778ecb3c61b2','messi','25D55AD283AA400AF464C76D713C07AD',163), (140,'2018-04-06 17:15:52',0x00,0x00,'2018-04-06 17:15:52',NULL,NULL,NULL,'prat123','25D55AD283AA400AF464C76D713C07AD',164), (141,'2018-04-09 12:04:24',0x00,0x01,'2018-04-09 17:15:48',NULL,'2018-04-09 12:42:35','e1dda5f4-0d07-4866-ab1a-b028435bb794','riya123','25F9E794323B453885F5181F1B624D0B',165), (142,'2018-04-09 14:51:20',0x00,0x00,'2018-04-09 14:54:35',NULL,NULL,NULL,'ssalal','B4078C14FBCB7B3EF69A5F915A753D5B',166), (143,'2018-04-09 14:55:30',0x00,0x00,'2018-04-09 14:55:49',NULL,NULL,NULL,'sagarsalal','B4078C14FBCB7B3EF69A5F915A753D5B',167); /*!40000 ALTER TABLE `login` ENABLE KEYS */; -- -- Definition of table `order_details` -- DROP TABLE IF EXISTS `order_details`; CREATE TABLE `order_details` ( `order_detail_id` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `item_price` float DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `purchase_type` bit(1) DEFAULT NULL, `quantity` int(11) DEFAULT NULL, `isbn` varchar(255) DEFAULT NULL, `order_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`order_detail_id`), KEY `FKkv782vqb3bg5su4kw1puj3t1j` (`isbn`), KEY `FKii1vcsoitl3124dakasioxsm0` (`order_id`), CONSTRAINT `FKii1vcsoitl3124dakasioxsm0` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`order_id`), CONSTRAINT `FKkv782vqb3bg5su4kw1puj3t1j` FOREIGN KEY (`isbn`) REFERENCES `books` (`isbn`) ) ENGINE=InnoDB AUTO_INCREMENT=936 DEFAULT CHARSET=latin1; -- -- Dumping data for table `order_details` -- /*!40000 ALTER TABLE `order_details` DISABLE KEYS */; INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (680,'2018-04-05 15:26:23',94,'2018-04-05 15:26:23',0x00,1,'2220000000000',1256), (681,'2018-04-05 15:26:23',20,'2018-04-05 15:26:23',0x00,1,'9580000000000',1256), (682,'2018-04-05 15:28:23',645,'2018-04-05 15:28:23',0x01,1,'9880000000000',1257), (683,'2018-04-05 15:28:23',737,'2018-04-05 15:28:23',0x01,1,'9782000000000',1257), (684,'2018-04-05 15:29:10',450,'2018-04-05 15:29:10',0x01,1,'9220000000000',1258), (685,'2018-04-05 15:29:10',222,'2018-04-05 15:29:10',0x01,1,'9580000000000',1258), (686,'2018-04-05 15:29:10',978,'2018-04-05 15:29:10',0x01,1,'2220000000000',1258), (687,'2018-04-05 15:29:10',212,'2018-04-05 15:29:10',0x01,1,'9560000000000',1258), (688,'2018-04-05 15:29:10',220,'2018-04-05 15:29:10',0x01,1,'9470000000000',1258), (689,'2018-04-05 15:29:10',737,'2018-04-05 15:29:10',0x01,1,'9782000000000',1258), (690,'2018-04-05 15:29:10',631,'2018-04-05 15:29:10',0x01,1,'9960000000000',1258), (691,'2018-04-05 15:29:10',800,'2018-04-05 15:29:10',0x01,1,'1170000000000',1258); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (719,'2018-04-05 16:21:42',450,'2018-04-05 16:21:42',0x01,1,'9360000000000',1274), (720,'2018-04-05 16:21:42',977,'2018-04-05 16:21:42',0x01,1,'9639000000000',1274), (721,'2018-04-05 16:21:42',222,'2018-04-05 16:21:42',0x01,1,'9580000000000',1274), (722,'2018-04-05 16:21:42',212,'2018-04-05 16:21:42',0x01,1,'9560000000000',1274), (723,'2018-04-05 16:21:42',737,'2018-04-05 16:21:42',0x01,1,'9782000000000',1274), (724,'2018-04-05 16:19:53',800,'2018-04-05 16:19:53',0x01,1,'1170000000000',1275), (725,'2018-04-05 16:20:36',800,'2018-04-05 16:20:36',0x01,1,'1170000000000',1276), (726,'2018-04-05 16:23:20',800,'2018-04-05 16:23:20',0x01,1,'1170000000000',1277), (727,'2018-04-05 18:21:50',17,'2018-04-05 18:21:50',0x00,1,'9470000000000',1278), (728,'2018-04-05 18:21:50',62,'2018-04-05 18:21:50',0x00,1,'9880000000000',1278), (729,'2018-04-05 18:21:50',71,'2018-04-05 18:21:50',0x00,1,'9782000000000',1278), (730,'2018-04-05 18:24:02',35,'2018-04-05 18:24:02',0x00,1,'9220000000000',1279); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (731,'2018-04-05 18:24:02',75,'2018-04-05 18:24:02',0x00,1,'1170000000000',1279), (732,'2018-04-06 09:20:55',645,'2018-04-06 09:20:55',0x01,1,'9880000000000',1280), (733,'2018-04-06 09:21:25',450,'2018-04-06 09:21:25',0x01,1,'9220000000000',1281), (734,'2018-04-06 09:21:25',222,'2018-04-06 09:21:25',0x01,1,'9580000000000',1281), (735,'2018-04-06 09:42:21',220,'2018-04-06 09:42:21',0x01,1,'9470000000000',1282), (736,'2018-04-06 09:42:21',737,'2018-04-06 09:42:21',0x01,1,'9782000000000',1282), (737,'2018-04-06 09:42:29',786,'2018-04-06 09:42:29',0x01,1,'5560000000000',1283), (738,'2018-04-06 09:46:29',17,'2018-04-06 09:46:29',0x00,2,'9470000000000',1284), (739,'2018-04-06 09:46:29',737,'2018-04-06 09:46:29',0x01,4,'9782000000000',1284), (740,'2018-04-06 09:46:29',800,'2018-04-06 09:46:29',0x01,1,'1170000000000',1284), (741,'2018-04-06 09:44:24',220,'2018-04-06 09:44:24',0x01,1,'9470000000000',1285), (742,'2018-04-06 09:45:17',977,'2018-04-06 09:45:17',0x01,1,'9639000000000',1286); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (743,'2018-04-06 09:45:38',977,'2018-04-06 09:45:38',0x01,1,'9639000000000',1287), (744,'2018-04-06 09:45:38',645,'2018-04-06 09:45:38',0x01,1,'9880000000000',1287), (745,'2018-04-06 09:50:18',220,'2018-04-06 09:50:18',0x01,2,'9470000000000',1288), (746,'2018-04-06 09:50:18',737,'2018-04-06 09:50:18',0x01,1,'9782000000000',1288), (747,'2018-04-06 09:50:18',75,'2018-04-06 09:50:18',0x00,2,'1170000000000',1288), (748,'2018-04-06 09:52:04',342,'2018-04-06 09:52:04',0x01,1,'9729000000000',1289), (749,'2018-04-06 09:52:39',645,'2018-04-06 09:52:39',0x01,1,'9880000000000',1290), (750,'2018-04-06 09:52:39',737,'2018-04-06 09:52:39',0x01,1,'9782000000000',1290), (751,'2018-04-06 09:55:38',220,'2018-04-06 09:55:38',0x01,1,'9470000000000',1291), (752,'2018-04-06 09:55:38',800,'2018-04-06 09:55:38',0x01,1,'1170000000000',1291), (753,'2018-04-06 09:55:54',978,'2018-04-06 09:55:54',0x01,1,'2220000000000',1292), (754,'2018-04-06 09:55:54',645,'2018-04-06 09:55:54',0x01,1,'9880000000000',1292); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (755,'2018-04-06 09:56:04',222,'2018-04-06 09:56:04',0x01,1,'9580000000000',1293), (756,'2018-04-06 09:56:15',631,'2018-04-06 09:56:15',0x01,1,'9960000000000',1294), (757,'2018-04-06 09:56:23',977,'2018-04-06 09:56:23',0x01,1,'9639000000000',1295), (758,'2018-04-06 10:01:17',977,'2018-04-06 10:01:17',0x01,1,'9639000000000',1296), (759,'2018-04-06 10:01:17',737,'2018-04-06 10:01:17',0x01,1,'9782000000000',1296), (760,'2018-04-06 10:00:14',342,'2018-04-06 10:00:14',0x01,1,'9729000000000',1297), (761,'2018-04-06 10:05:37',737,'2018-04-06 10:05:37',0x01,4,'9782000000000',1298), (762,'2018-04-06 10:05:37',75,'2018-04-06 10:05:37',0x00,3,'1170000000000',1298), (763,'2018-04-06 10:03:57',977,'2018-04-06 10:03:57',0x01,2,'9639000000000',1299), (764,'2018-04-06 10:10:07',450,'2018-04-06 10:10:07',0x01,1,'9220000000000',1300), (765,'2018-04-06 10:10:39',222,'2018-04-06 10:10:39',0x01,1,'9580000000000',1301), (766,'2018-04-06 10:11:02',800,'2018-04-06 10:11:02',0x01,1,'1170000000000',1302); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (767,'2018-04-06 10:36:41',450,'2018-04-06 10:36:41',0x01,1,'9220000000000',1303), (768,'2018-04-06 10:36:41',800,'2018-04-06 10:36:41',0x01,1,'1170000000000',1303), (769,'2018-04-06 10:35:09',666,'2018-04-06 10:35:09',0x01,1,'3620000000000',1304), (770,'2018-04-06 10:35:09',540,'2018-04-06 10:35:09',0x01,2,'9788177091878',1304), (771,'2018-04-06 10:36:25',220,'2018-04-06 10:36:25',0x01,1,'9470000000000',1305), (772,'2018-04-06 10:41:49',737,'2018-04-06 10:41:49',0x01,1,'9782000000000',1306), (773,'2018-04-06 10:41:49',800,'2018-04-06 10:41:49',0x01,1,'1170000000000',1306), (774,'2018-04-06 10:44:15',800,'2018-04-06 10:44:15',0x01,1,'1170000000000',1307), (776,'2018-04-06 11:08:56',645,'2018-04-06 11:08:56',0x01,2,'9880000000000',1309), (777,'2018-04-06 11:08:56',75,'2018-04-06 11:08:56',0x00,1,'1170000000000',1309), (778,'2018-04-06 11:15:43',737,'2018-04-06 11:15:43',0x01,1,'9782000000000',1310), (779,'2018-04-06 11:18:13',631,'2018-04-06 11:18:13',0x01,1,'9960000000000',1311); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (780,'2018-04-06 11:18:03',800,'2018-04-06 11:18:03',0x01,1,'1170000000000',1312), (781,'2018-04-06 11:37:29',92,'2018-04-06 11:37:29',0x00,3,'9639000000000',1313), (782,'2018-04-06 11:37:29',71,'2018-04-06 11:37:29',0x00,2,'9782000000000',1313), (783,'2018-04-06 11:57:07',450,'2018-04-06 11:57:07',0x01,1,'9220000000000',1314), (784,'2018-04-06 11:57:07',977,'2018-04-06 11:57:07',0x01,1,'9639000000000',1314), (785,'2018-04-06 11:55:45',786,'2018-04-06 11:55:45',0x01,1,'5560000000000',1315), (786,'2018-04-06 12:01:48',786,'2018-04-06 12:01:48',0x01,1,'5560000000000',1316), (787,'2018-04-06 12:04:26',786,'2018-04-06 12:04:26',0x01,1,'5560000000000',1317), (788,'2018-04-06 12:06:06',220,'2018-04-06 12:06:06',0x01,1,'9470000000000',1318), (789,'2018-04-06 12:09:54',450,'2018-04-06 12:09:54',0x01,1,'9360000000000',1319), (790,'2018-04-06 12:09:54',977,'2018-04-06 12:09:54',0x01,1,'9639000000000',1319), (791,'2018-04-06 12:09:54',800,'2018-04-06 12:09:54',0x01,1,'1170000000000',1319); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (792,'2018-04-06 12:10:26',35,'2018-04-06 12:10:26',0x00,1,'9360000000000',1320), (793,'2018-04-06 12:10:26',94,'2018-04-06 12:10:26',0x00,1,'2220000000000',1320), (794,'2018-04-06 12:10:26',75,'2018-04-06 12:10:26',0x00,1,'1170000000000',1320), (795,'2018-04-06 12:13:50',35,'2018-04-06 12:13:50',0x00,1,'9220000000000',1321), (796,'2018-04-06 12:13:50',92,'2018-04-06 12:13:50',0x00,1,'9639000000000',1321), (797,'2018-04-06 12:21:16',35,'2018-04-06 12:21:16',0x00,1,'9360000000000',1322), (798,'2018-04-06 12:32:14',64,'2018-04-06 12:32:14',0x00,1,'9638000000000',1323), (799,'2018-04-06 12:38:10',19,'2018-04-06 12:38:10',0x00,1,'9560000000000',1324), (800,'2018-04-06 12:55:33',35,'2018-04-06 12:55:33',0x00,2,'9220000000000',1325), (801,'2018-04-06 12:55:33',19,'2018-04-06 12:55:33',0x00,1,'9560000000000',1325), (802,'2018-04-06 13:01:01',222,'2018-04-06 13:01:01',0x01,1,'9580000000000',1326), (803,'2018-04-06 13:06:58',222,'2018-04-06 13:06:58',0x01,1,'9580000000000',1327); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (804,'2018-04-06 13:07:16',222,'2018-04-06 13:07:16',0x01,1,'9580000000000',1328), (805,'2018-04-06 13:15:45',222,'2018-04-06 13:15:45',0x01,1,'9580000000000',1329), (806,'2018-04-06 13:35:38',342,'2018-04-06 13:35:38',0x01,1,'9729000000000',1330), (807,'2018-04-06 14:47:18',19,'2018-04-06 14:47:18',0x00,1,'9560000000000',1331), (808,'2018-04-06 14:47:18',64,'2018-04-06 14:47:18',0x00,60,'9638000000000',1331), (809,'2018-04-06 15:07:32',450,'2018-04-06 15:07:32',0x01,1,'9220000000000',1332), (810,'2018-04-06 15:30:30',222,'2018-04-06 15:30:30',0x01,1,'9580000000000',1333), (811,'2018-04-06 15:31:02',645,'2018-04-06 15:31:02',0x01,1,'9880000000000',1334), (812,'2018-04-06 15:31:38',222,'2018-04-06 15:31:38',0x01,1,'9580000000000',1335), (813,'2018-04-06 15:45:41',30,'2018-04-06 15:45:41',0x00,1,'123',1336), (814,'2018-04-06 15:45:41',20,'2018-04-06 15:45:41',0x00,1,'9580000000000',1336), (815,'2018-04-06 16:14:25',764,'2018-04-06 16:14:25',0x01,1,'9110000000000',1338); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (816,'2018-04-06 16:14:27',764,'2018-04-06 16:14:27',0x01,1,'9110000000000',1339), (817,'2018-04-06 16:14:30',764,'2018-04-06 16:14:30',0x01,1,'9110000000000',1341), (818,'2018-04-06 16:15:49',764,'2018-04-06 16:15:49',0x01,1,'9110000000000',1342), (819,'2018-04-06 16:16:53',666,'2018-04-06 16:16:53',0x01,1,'3620000000000',1343), (820,'2018-04-06 16:16:53',977,'2018-04-06 16:16:53',0x01,1,'9639000000000',1343), (821,'2018-04-06 16:17:53',764,'2018-04-06 16:17:53',0x01,2,'9110000000000',1344), (822,'2018-04-06 16:30:31',450,'2018-04-06 16:30:31',0x01,1,'9220000000000',1345), (823,'2018-04-06 16:30:31',212,'2018-04-06 16:30:31',0x01,1,'9560000000000',1345), (824,'2018-04-06 16:30:58',800,'2018-04-06 16:30:58',0x01,1,'1170000000000',1346), (825,'2018-04-06 16:31:02',800,'2018-04-06 16:31:02',0x01,1,'1170000000000',1347), (826,'2018-04-06 16:34:42',450,'2018-04-06 16:34:42',0x01,1,'9360000000000',1348), (827,'2018-04-06 16:34:42',978,'2018-04-06 16:34:42',0x01,1,'2220000000000',1348); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (828,'2018-04-06 16:34:42',220,'2018-04-06 16:34:42',0x01,1,'9470000000000',1348), (829,'2018-04-06 16:34:42',737,'2018-04-06 16:34:42',0x01,1,'9782000000000',1348), (830,'2018-04-06 16:34:42',786,'2018-04-06 16:34:42',0x01,1,'9638000000000',1348), (831,'2018-04-06 16:34:43',450,'2018-04-06 16:34:43',0x01,1,'9360000000000',1349), (832,'2018-04-06 16:34:43',978,'2018-04-06 16:34:43',0x01,1,'2220000000000',1349), (833,'2018-04-06 16:34:43',220,'2018-04-06 16:34:43',0x01,1,'9470000000000',1349), (834,'2018-04-06 16:34:43',737,'2018-04-06 16:34:43',0x01,1,'9782000000000',1349), (835,'2018-04-06 16:34:43',786,'2018-04-06 16:34:43',0x01,1,'9638000000000',1349), (836,'2018-04-06 16:34:47',75,'2018-04-06 16:34:47',0x00,3,'5560000000000',1350), (837,'2018-04-06 16:36:11',212,'2018-04-06 16:36:11',0x01,1,'9560000000000',1351), (838,'2018-04-06 16:36:23',645,'2018-04-06 16:36:23',0x01,1,'9880000000000',1352), (839,'2018-04-06 16:36:47',220,'2018-04-06 16:36:47',0x01,1,'9470000000000',1353); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (840,'2018-04-06 16:42:24',222,'2018-04-06 16:42:24',0x01,1,'9580000000000',1354), (841,'2018-04-06 16:42:50',450,'2018-04-06 16:42:50',0x01,1,'9360000000000',1355), (842,'2018-04-06 16:42:50',220,'2018-04-06 16:42:50',0x01,1,'9470000000000',1355), (843,'2018-04-06 17:32:01',630,'2018-04-06 17:32:01',0x01,1,'9820000000000',1356), (844,'2018-04-06 17:32:41',630,'2018-04-06 17:32:41',0x01,1,'9820000000000',1357), (845,'2018-04-06 19:30:50',5,'2018-04-06 19:30:50',0x00,1,'95812',1358), (846,'2018-04-06 19:30:50',35,'2018-04-06 19:30:50',0x00,1,'9220000000000',1358), (847,'2018-04-06 19:30:50',41,'2018-04-06 19:30:50',0x00,1,'9780000000000',1358), (848,'2018-04-06 19:30:50',94,'2018-04-06 19:30:50',0x00,1,'2220000000000',1358), (849,'2018-04-06 19:30:52',5,'2018-04-06 19:30:52',0x00,1,'95812',1359), (850,'2018-04-06 19:30:52',35,'2018-04-06 19:30:52',0x00,1,'9220000000000',1359), (851,'2018-04-06 19:30:52',41,'2018-04-06 19:30:52',0x00,1,'9780000000000',1359); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (852,'2018-04-06 19:30:52',94,'2018-04-06 19:30:52',0x00,1,'2220000000000',1359), (853,'2018-04-06 19:34:27',5,'2018-04-06 19:34:27',0x00,1,'95812',1360), (854,'2018-04-06 19:34:27',35,'2018-04-06 19:34:27',0x00,1,'9360000000000',1360), (855,'2018-04-06 19:46:24',666,'2018-04-06 19:46:24',0x01,1,'3620000000000',1361), (856,'2018-04-06 19:46:28',666,'2018-04-06 19:46:28',0x01,1,'3620000000000',1362), (857,'2018-04-06 19:47:19',55,'2018-04-06 19:47:19',0x01,1,'95812',1366), (858,'2018-04-06 22:32:00',300,'2018-04-06 22:32:00',0x01,10000000,'123',1368), (859,'2018-04-07 09:33:14',35,'2018-04-07 09:33:14',0x00,2,'9360000000000',1369), (860,'2018-04-09 09:25:57',540,'2018-04-09 09:25:57',0x01,1,'9788177091878',1370), (861,'2018-04-09 09:25:57',952,'2018-04-09 09:25:57',0x01,1,'9781473647770',1370), (862,'2018-04-09 09:25:57',800,'2018-04-09 09:25:57',0x01,1,'1170000000000',1370), (863,'2018-04-09 09:27:04',374.25,'2018-04-09 09:27:04',0x01,1,'9780141359151',1371); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (864,'2018-04-09 09:27:04',952,'2018-04-09 09:27:04',0x01,1,'9781473647770',1371), (865,'2018-04-09 09:41:55',666,'2018-04-09 09:41:55',0x01,1,'3620000000000',1372), (866,'2018-04-09 09:52:52',123,'2018-04-09 09:52:52',0x01,1,'789456',1373), (867,'2018-04-09 09:52:52',434,'2018-04-09 09:52:52',0x01,5,'5454000000000',1373), (868,'2018-04-09 09:53:57',43,'2018-04-09 09:53:57',0x00,5,'5454000000000',1374), (869,'2018-04-09 09:59:58',666,'2018-04-09 09:59:58',0x01,25,'3620000000000',1375), (870,'2018-04-09 09:59:58',677,'2018-04-09 09:59:58',0x01,11,'9350000000000',1375), (871,'2018-04-09 10:03:36',75,'2018-04-09 10:03:36',0x00,10,'5560000000000',1376), (872,'2018-04-09 10:07:22',63,'2018-04-09 10:07:22',0x00,1,'9350000000000',1377), (873,'2018-04-09 10:17:02',800,'2018-04-09 10:17:02',0x01,1,'1170000000000',1378), (874,'2018-04-09 10:18:04',75,'2018-04-09 10:18:04',0x00,1,'1170000000000',1379), (875,'2018-04-09 10:20:43',120,'2018-04-09 10:20:43',0x00,1,'7777777777777',1380); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (876,'2018-04-09 10:21:06',63,'2018-04-09 10:21:06',0x00,5,'9350000000000',1381), (877,'2018-04-09 10:21:06',120,'2018-04-09 10:21:06',0x00,3,'7777777777777',1381), (878,'2018-04-09 10:21:16',374.25,'2018-04-09 10:21:16',0x01,1,'9780141359151',1382), (879,'2018-04-09 10:34:25',666,'2018-04-09 10:34:25',0x01,1,'3620000000000',1383), (880,'2018-04-09 10:34:40',677,'2018-04-09 10:34:40',0x01,1,'9350000000000',1384), (881,'2018-04-09 10:35:03',677,'2018-04-09 10:35:03',0x01,3,'9350000000000',1385), (882,'2018-04-09 10:36:23',374.25,'2018-04-09 10:36:23',0x01,1,'9780141359151',1386), (883,'2018-04-09 10:36:23',23,'2018-04-09 10:36:23',0x00,2,'9781473647770',1386), (884,'2018-04-09 10:42:08',37.25,'2018-04-09 10:42:08',0x00,1,'9780141359151',1387), (885,'2018-04-09 10:42:08',23,'2018-04-09 10:42:08',0x00,1,'9781473647770',1387), (886,'2018-04-09 10:47:16',120,'2018-04-09 10:47:16',0x00,1,'7777777777777',1388), (887,'2018-04-09 10:53:30',977,'2018-04-09 10:53:30',0x01,1,'9639000000000',1389); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (888,'2018-04-09 10:53:30',220,'2018-04-09 10:53:30',0x01,1,'9470000000000',1389), (889,'2018-04-09 10:53:30',737,'2018-04-09 10:53:30',0x01,1,'9782000000000',1389), (890,'2018-04-09 10:53:30',631,'2018-04-09 10:53:30',0x01,1,'9960000000000',1389), (891,'2018-04-09 10:54:34',666,'2018-04-09 10:54:34',0x01,1,'3620000000000',1390), (892,'2018-04-09 11:02:32',120,'2018-04-09 11:02:32',0x00,1,'7777777777777',1391), (893,'2018-04-09 11:06:57',952,'2018-04-09 11:06:57',0x01,1,'9781473647770',1392), (894,'2018-04-09 11:07:43',666,'2018-04-09 11:07:43',0x01,1,'3620000000000',1393), (895,'2018-04-09 11:12:51',666,'2018-04-09 11:12:51',0x01,1,'3620000000000',1394), (896,'2018-04-09 11:23:10',666,'2018-04-09 11:23:10',0x01,1,'3620000000000',1393), (897,'2018-04-09 11:26:23',666,'2018-04-09 11:26:23',0x01,1,'3620000000000',1396), (898,'2018-04-09 11:38:12',666,'2018-04-09 11:38:12',0x01,1,'3620000000000',1397), (899,'2018-04-09 11:39:24',666,'2018-04-09 11:39:24',0x01,1,'3620000000000',1398); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (900,'2018-04-09 11:45:24',666,'2018-04-09 11:45:24',0x01,1,'3620000000000',1399), (901,'2018-04-09 11:46:16',666,'2018-04-09 11:46:16',0x01,1,'3620000000000',1400), (902,'2018-04-09 11:47:20',666,'2018-04-09 11:47:20',0x01,1,'3620000000000',1401), (903,'2018-04-09 11:48:56',666,'2018-04-09 11:48:56',0x01,1,'3620000000000',1402), (904,'2018-04-09 11:55:39',666,'2018-04-09 11:55:39',0x01,1,'3620000000000',1403), (905,'2018-04-09 11:56:47',666,'2018-04-09 11:56:47',0x01,1,'3620000000000',1404), (906,'2018-04-09 11:58:19',666,'2018-04-09 11:58:19',0x01,1,'3620000000000',1405), (907,'2018-04-09 11:59:59',666,'2018-04-09 11:59:59',0x01,1,'3620000000000',1406), (908,'2018-04-09 12:00:50',666,'2018-04-09 12:00:50',0x01,1,'3620000000000',1407), (909,'2018-04-09 12:01:30',666,'2018-04-09 12:01:30',0x01,1,'3620000000000',1408), (910,'2018-04-09 12:02:28',666,'2018-04-09 12:02:28',0x01,1,'3620000000000',1409), (911,'2018-04-09 12:05:03',666,'2018-04-09 12:05:03',0x01,1,'3620000000000',1410); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (912,'2018-04-09 12:10:03',666,'2018-04-09 12:10:03',0x01,1,'3620000000000',1411), (913,'2018-04-09 12:14:11',666,'2018-04-09 12:14:11',0x01,1,'3620000000000',1412), (914,'2018-04-09 12:15:04',666,'2018-04-09 12:15:04',0x01,1,'3620000000000',1413), (915,'2018-04-09 12:17:22',666,'2018-04-09 12:17:22',0x01,1,'3620000000000',1414), (916,'2018-04-09 12:19:03',666,'2018-04-09 12:19:03',0x01,1,'3620000000000',1415), (917,'2018-04-09 12:25:55',666,'2018-04-09 12:25:55',0x01,1,'3620000000000',1416), (918,'2018-04-09 12:32:02',666,'2018-04-09 12:32:02',0x01,1,'3620000000000',1417), (919,'2018-04-09 12:33:21',666,'2018-04-09 12:33:21',0x01,1,'3620000000000',1418), (920,'2018-04-09 12:34:16',666,'2018-04-09 12:34:16',0x01,1,'3620000000000',1419), (921,'2018-04-09 12:35:04',666,'2018-04-09 12:35:04',0x01,1,'3620000000000',1420), (922,'2018-04-09 12:40:52',666,'2018-04-09 12:40:52',0x01,1,'3620000000000',1421), (923,'2018-04-09 12:43:06',666,'2018-04-09 12:43:06',0x01,1,'3620000000000',1422); INSERT INTO `order_details` (`order_detail_id`,`created_date`,`item_price`,`last_modified_date`,`purchase_type`,`quantity`,`isbn`,`order_id`) VALUES (924,'2018-04-09 12:43:58',666,'2018-04-09 12:43:58',0x01,1,'3620000000000',1423), (925,'2018-04-09 12:43:58',120,'2018-04-09 12:43:58',0x00,1,'7777777777777',1423), (926,'2018-04-09 12:44:30',666,'2018-04-09 12:44:30',0x01,1,'3620000000000',1424), (927,'2018-04-09 12:51:56',37.25,'2018-04-09 12:51:56',0x00,1,'9780141359151',1425), (928,'2018-04-09 13:00:24',22,'2018-04-09 13:00:24',0x00,1,'9820000000000',1426), (929,'2018-04-09 14:07:04',666,'2018-04-09 14:07:04',0x01,1,'3620000000000',1427), (930,'2018-04-09 14:16:53',786,'2018-04-09 14:16:53',0x01,1,'5560000000000',1428), (931,'2018-04-09 14:26:13',374.25,'2018-04-09 14:26:13',0x01,1,'9780141359151',1429), (932,'2018-04-09 14:58:01',677,'2018-04-09 14:58:01',0x01,1,'9350000000000',1430), (933,'2018-04-09 15:20:20',677,'2018-04-09 15:20:20',0x01,1,'9350000000000',1431), (934,'2018-04-09 16:49:19',677,'2018-04-09 16:49:19',0x01,1,'9350000000000',1432), (935,'2018-04-09 16:49:19',9674,'2018-04-09 16:49:19',0x01,1,'3216540000',1432); /*!40000 ALTER TABLE `order_details` ENABLE KEYS */; -- -- Definition of table `shipping_address` -- DROP TABLE IF EXISTS `shipping_address`; CREATE TABLE `shipping_address` ( `shipping_id` bigint(20) NOT NULL AUTO_INCREMENT, `address_line1` varchar(255) DEFAULT NULL, `address_line2` varchar(255) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `mail` varchar(255) DEFAULT NULL, `mobile` varchar(255) DEFAULT NULL, `city_id` bigint(20) DEFAULT NULL, `country_id` bigint(20) DEFAULT NULL, `order_id` bigint(20) DEFAULT NULL, `state_id` bigint(20) DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, `postal_code` varchar(255) DEFAULT NULL, PRIMARY KEY (`shipping_id`), KEY `FKpp40r6fg2o5iucc5r3hsc4wox` (`city_id`), KEY `FKfcs6eqhyd4bp638r6eqxu77sf` (`country_id`), KEY `FKatbgaqk1hhhhkyyuebylpeh7q` (`order_id`), KEY `FK6wb1na0lx53hw79voyhaiophn` (`state_id`), KEY `FKilmh1is3sdv0h8xdsrh0yn5f3` (`user_id`), CONSTRAINT `FK6wb1na0lx53hw79voyhaiophn` FOREIGN KEY (`state_id`) REFERENCES `state` (`state_id`), CONSTRAINT `FKatbgaqk1hhhhkyyuebylpeh7q` FOREIGN KEY (`order_id`) REFERENCES `user_order` (`order_id`), CONSTRAINT `FKfcs6eqhyd4bp638r6eqxu77sf` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`), CONSTRAINT `FKilmh1is3sdv0h8xdsrh0yn5f3` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`), CONSTRAINT `FKpp40r6fg2o5iucc5r3hsc4wox` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=latin1; -- -- Dumping data for table `shipping_address` -- /*!40000 ALTER TABLE `shipping_address` DISABLE KEYS */; INSERT INTO `shipping_address` (`shipping_id`,`address_line1`,`address_line2`,`created_date`,`last_modified_date`,`mail`,`mobile`,`city_id`,`country_id`,`order_id`,`state_id`,`user_id`,`postal_code`) VALUES (1,'54/10, OppositeLocal President House ','Almora, U.K.','2018-02-12 10:20:00','2018-03-21 00:20:10','ssalal@sapient.com','9999999991',7,1,NULL,1,4,'33903'), (2,'23/43, Lokhandwala, Andheri West','Mumbai, Maharashtra','2018-02-15 09:20:00','2018-03-20 11:20:10','sallllubhai@gmail.com','8888888881',14,1,NULL,3,26,'35004'), (3,'Backside of Railway Station','Ratlam, Maharashtra','2018-02-19 09:20:00','2018-03-24 11:20:10','salals@gmail.com','7777777771',25,1,NULL,2,43,'92705'), (4,'aaa','aaa','2018-04-04 11:22:00','2018-04-04 11:22:00','vb@g.co',NULL,99,1,NULL,10,4,'92720'), (5,'aaaa','','2018-04-04 11:23:17','2018-04-04 11:23:17','vb@g.co',NULL,69,1,NULL,7,4,'60134'), (6,'aaaa','','2018-04-04 13:04:19','2018-04-04 13:04:19','vb@g.co',NULL,51,1,NULL,6,4,'72348'), (7,'asdasd','','2018-04-04 13:49:39','2018-04-04 13:49:39','ksharma61@sapient.com',NULL,79,1,NULL,8,4,'95060'), (8,'adfasd','','2018-04-04 13:50:00','2018-04-04 13:50:00','ksharma61@sapient.com',NULL,11,1,NULL,1,4,'90028'); INSERT INTO `shipping_address` (`shipping_id`,`address_line1`,`address_line2`,`created_date`,`last_modified_date`,`mail`,`mobile`,`city_id`,`country_id`,`order_id`,`state_id`,`user_id`,`postal_code`) VALUES (9,'sadas','','2018-04-04 13:52:23','2018-04-04 13:52:23','ksharma61@sapient.com',NULL,18,1,NULL,3,4,'60134'), (10,'sadad','','2018-04-04 13:52:36','2018-04-04 13:52:36','ksharma61@sapient.com',NULL,70,1,NULL,7,4,'36442'), (11,'safolal','garokal','2018-04-04 13:54:48','2018-04-04 13:54:48','ksharma61@sapient.com',NULL,13,1,NULL,1,4,'33063'), (12,'ww','','2018-04-04 13:53:50','2018-04-04 13:53:50','ak@gmail.com',NULL,31,1,NULL,4,87,'77478'), (13,'xx','xscc','2018-04-04 13:55:16','2018-04-04 13:55:16','shreyag932@gmail.com',NULL,53,1,NULL,6,4,'10810'), (14,'wersf','','2018-04-04 13:55:20','2018-04-04 13:55:20','ak@gmail.com',NULL,15,1,NULL,3,4,'78007'), (15,'guyg','ygyg','2018-04-04 13:55:58','2018-04-04 13:55:58','shreyag932@gmail.com',NULL,81,1,NULL,9,4,'36301'), (16,'r','','2018-04-04 13:56:33','2018-04-04 13:56:33','ak@gmail.com',NULL,96,1,NULL,10,4,'94016'), (17,'11111','','2018-04-04 14:00:37','2018-04-04 14:00:37','prachi@kj',NULL,41,1,NULL,5,4,'71010'); INSERT INTO `shipping_address` (`shipping_id`,`address_line1`,`address_line2`,`created_date`,`last_modified_date`,`mail`,`mobile`,`city_id`,`country_id`,`order_id`,`state_id`,`user_id`,`postal_code`) VALUES (18,'asd','','2018-04-04 14:29:05','2018-04-04 14:29:05','hgu@hg.m',NULL,92,1,NULL,10,145,'71013'), (19,'jgyfhj','','2018-04-04 14:53:11','2018-04-04 14:53:11','ksharma61@sapient.com',NULL,54,1,NULL,6,139,'22545'), (20,'DGFHF','','2018-04-04 14:54:53','2018-04-04 14:54:53','hgu@hg.m',NULL,86,1,NULL,9,145,'75002'), (21,'sdfg','','2018-04-04 14:59:10','2018-04-04 14:59:10','pthapliyal@sapient.co',NULL,62,1,NULL,7,153,'90028'), (22,'gehu bell','','2018-04-04 14:59:50','2018-04-04 14:59:50','pthapliyal@sapient.co',NULL,20,1,NULL,3,153,'92007'), (23,'aaaaaaa','hm','2018-04-04 15:02:14','2018-04-04 15:02:14','a@b.com',NULL,15,1,NULL,3,151,'78007'), (24,'qwerty','abc','2018-04-04 15:00:12','2018-04-04 15:00:12','pthapliyal@sapient.co',NULL,14,1,NULL,3,4,'35004'), (25,'abc','','2018-04-04 15:11:50','2018-04-04 15:11:50','a@b.com',NULL,32,1,NULL,4,151,'75013'), (26,'Dehradun','def','2018-04-04 15:17:04','2018-04-04 15:17:04','vb@g.co',NULL,79,1,NULL,8,99,'95060'); INSERT INTO `shipping_address` (`shipping_id`,`address_line1`,`address_line2`,`created_date`,`last_modified_date`,`mail`,`mobile`,`city_id`,`country_id`,`order_id`,`state_id`,`user_id`,`postal_code`) VALUES (27,'Alabama','Hel point','2018-04-04 15:16:22','2018-04-04 15:16:22','vb@g.co',NULL,35,1,NULL,4,99,'75002'), (28,'pop','58','2018-04-04 15:22:56','2018-04-04 15:22:56','vb@g.co',NULL,86,1,NULL,9,99,'75002'), (29,'gurgaon','gurgaon','2018-04-04 15:57:36','2018-04-04 15:57:36','sumathur@sapient.com',NULL,36,1,NULL,4,4,'87935'), (30,'poy','','2018-04-05 10:32:47','2018-04-05 10:32:47','prachithapliyal10@gmail.com',NULL,29,1,NULL,2,4,'94558'), (31,'ppp','','2018-04-05 10:33:02','2018-04-05 10:33:02','prachithapliyal10@gmail.com',NULL,2,1,NULL,1,4,'33825'), (32,'po[','','2018-04-05 10:33:15','2018-04-05 10:33:15','prachithapliyal10@gmail.com',NULL,1,1,NULL,3,5,'90706'), (33,'d','','2018-04-05 10:41:50','2018-04-05 10:41:50','ak@gmail.com',NULL,26,1,NULL,3,87,'96001'), (34,'Dehradun','','2018-04-05 12:15:52','2018-04-05 12:15:52','a@b.com',NULL,14,1,NULL,3,151,'35004'), (35,'jkbhkh','','2018-04-05 12:35:31','2018-04-05 12:35:31','amadaan2@sapient.com',NULL,30,1,NULL,2,4,'36301'); INSERT INTO `shipping_address` (`shipping_id`,`address_line1`,`address_line2`,`created_date`,`last_modified_date`,`mail`,`mobile`,`city_id`,`country_id`,`order_id`,`state_id`,`user_id`,`postal_code`) VALUES (36,'Minnesota','','2018-04-05 13:31:52','2018-04-05 13:31:52','skhanwani@sapient.com',NULL,91,1,NULL,10,4,'79601'), (37,'Dehradun','def','2018-04-05 15:10:26','2018-04-05 15:10:26','amadaan2@sapient.com',NULL,61,1,NULL,7,4,'70053'), (38,'line1','','2018-04-05 17:15:33','2018-04-05 17:15:33','amadaan2@sapient.com',NULL,77,1,NULL,8,137,'96001'), (39,'fddcvf','line2','2018-04-05 17:15:57','2018-04-05 17:15:57','amadaan2@sapient.com',NULL,97,1,NULL,10,4,'94088'), (40,'street 1','','2018-04-06 09:18:47','2018-04-06 09:18:47','adityadobhal.22@gmail.com',NULL,51,1,NULL,6,4,'72348'), (41,'kj','','2018-04-06 09:19:18','2018-04-06 09:19:18','adityadobhal.22@gmail.com',NULL,99,1,NULL,10,4,'92720'), (42,'ewraewre','','2018-04-06 09:20:00','2018-04-06 09:20:00','adityadobhal.22@gmail.com',NULL,36,1,NULL,4,4,'87935'), (43,'bsvsf','','2018-04-06 10:06:15','2018-04-06 10:06:15','prachithapliyal10@gmail.com',NULL,48,1,NULL,5,5,'76530'); INSERT INTO `shipping_address` (`shipping_id`,`address_line1`,`address_line2`,`created_date`,`last_modified_date`,`mail`,`mobile`,`city_id`,`country_id`,`order_id`,`state_id`,`user_id`,`postal_code`) VALUES (44,'ssdsa','','2018-04-06 10:24:02','2018-04-06 10:24:02','adityadobhal.22@gmail.com',NULL,5,1,NULL,1,4,'32301'), (45,'sda','dsa','2018-04-06 10:24:21','2018-04-06 10:24:21','adityadobhal.22@gmail.com',NULL,64,1,NULL,7,4,'33063'), (46,'sda','','2018-04-06 10:24:52','2018-04-06 10:24:52','adityadobhal.22@gmail.com',NULL,91,1,NULL,10,4,'79601'), (47,'zsdfgsdf','dfsdf','2018-04-06 10:30:01','2018-04-06 10:30:01','amadaan2@sapient.com',NULL,68,1,NULL,7,4,'35210'), (48,'as','','2018-04-06 10:30:57','2018-04-06 10:30:57','adityadobhal.22@gmail.com',NULL,86,1,NULL,9,4,'75002'), (49,'sss','','2018-04-06 10:31:16','2018-04-06 10:31:16','adityadobhal.22@gmail.com',NULL,53,1,NULL,6,4,'10810'), (50,'Michonff','','2018-04-06 10:41:40','2018-04-06 10:41:40','aditimadaan0302@gmail.com',NULL,53,1,NULL,6,4,'10810'), (51,'Dehradun','def','2018-04-06 11:12:14','2018-04-06 11:12:14','amadaan2@sapient.com',NULL,59,1,NULL,6,4,'98328'); INSERT INTO `shipping_address` (`shipping_id`,`address_line1`,`address_line2`,`created_date`,`last_modified_date`,`mail`,`mobile`,`city_id`,`country_id`,`order_id`,`state_id`,`user_id`,`postal_code`) VALUES (52,'jhjhghkgghkghk,','jbjm','2018-04-06 11:18:07','2018-04-06 11:18:07','abhan95@gmail.com',NULL,20,1,NULL,3,4,'92007'), (53,'gurgaon','','2018-04-06 16:09:03','2018-04-06 16:09:03','adityadobhal.22@gmail.com',NULL,19,1,NULL,3,4,'36442'), (54,'hjrLK','','2018-04-09 11:52:49','2018-04-09 11:52:49','shreyag932@gmail.com',NULL,68,1,NULL,7,4,'35210'), (55,'House No. 258','','2018-04-09 12:43:49','2018-04-09 12:43:49','pallavi.14bcs1150@abes.ac.in',NULL,35,1,NULL,4,4,'75002'), (56,'Gurgoan','','2018-04-09 13:57:53','2018-04-09 13:57:53','pallavi.14bcs1150@abes.ac.in',NULL,23,1,NULL,2,4,'94088'), (57,'cvbhv','nvbnv','2018-04-09 14:57:57','2018-04-09 14:57:57','amadaan2@sapient.com',NULL,56,1,NULL,6,137,'99763'), (58,'gur.jjnh','','2018-04-09 15:02:52','2018-04-09 15:02:52','pallavi.14bcs1150@abes.ac.in',NULL,11,1,NULL,1,4,'90028'), (59,'Gurgaon','','2018-04-09 16:48:39','2018-04-09 16:48:39','pallavi.14bcs1150@abes.ac.in',NULL,16,1,NULL,3,4,'35094'); /*!40000 ALTER TABLE `shipping_address` ENABLE KEYS */; -- -- Definition of table `state` -- DROP TABLE IF EXISTS `state`; CREATE TABLE `state` ( `state_id` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `state_name` varchar(255) DEFAULT NULL, `country_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`state_id`), KEY `FKghic7mqjt6qb9vq7up7awu0er` (`country_id`), CONSTRAINT `FKghic7mqjt6qb9vq7up7awu0er` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; -- -- Dumping data for table `state` -- /*!40000 ALTER TABLE `state` DISABLE KEYS */; INSERT INTO `state` (`state_id`,`created_date`,`last_modified_date`,`state_name`,`country_id`) VALUES (1,'2018-03-20 16:01:00','2018-03-20 16:01:00','Florida',1), (2,'2018-03-20 16:01:00','2018-03-20 16:01:00','California',1), (3,'2018-03-20 16:01:00','2018-03-20 16:01:00','Alabama',1), (4,'2018-03-20 16:01:00','2018-03-20 16:01:00','Texas',1), (5,'2018-03-20 16:01:00','2018-03-20 16:01:00','New Jersey',1), (6,'2018-03-20 16:01:00','2018-03-20 16:01:00','Alaska',1), (7,'2018-03-20 16:01:00','2018-03-20 16:01:00','Georgia',1), (8,'2018-03-20 16:01:00','2018-03-20 16:01:00','Indiana',1), (9,'2018-03-20 16:01:00','2018-03-20 16:01:00','Ohio',1), (10,'2018-03-20 16:01:00','2018-03-20 16:01:00','Michigan',1); /*!40000 ALTER TABLE `state` ENABLE KEYS */; -- -- Definition of table `subscription` -- DROP TABLE IF EXISTS `subscription`; CREATE TABLE `subscription` ( `subscription_id` bigint(20) NOT NULL AUTO_INCREMENT, `isbn` varchar(255) DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`subscription_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; -- -- Dumping data for table `subscription` -- /*!40000 ALTER TABLE `subscription` DISABLE KEYS */; INSERT INTO `subscription` (`subscription_id`,`isbn`,`user_id`) VALUES (2,'0132335530000',165); /*!40000 ALTER TABLE `subscription` ENABLE KEYS */; -- -- Definition of table `transaction_history` -- DROP TABLE IF EXISTS `transaction_history`; CREATE TABLE `transaction_history` ( `unique_no` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `order_id` bigint(20) DEFAULT NULL, `status` varchar(255) DEFAULT NULL, PRIMARY KEY (`unique_no`) ) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=latin1; -- -- Dumping data for table `transaction_history` -- /*!40000 ALTER TABLE `transaction_history` DISABLE KEYS */; INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (1,'2018-04-06 11:08:58','2018-04-06 11:08:58',1309,'pending'), (2,'2018-04-06 11:09:56','2018-04-06 11:09:56',1309,'dispatched'), (3,'2018-04-06 11:10:15','2018-04-06 11:10:15',1309,'confirmed'), (4,'2018-04-06 11:43:31','2018-04-06 11:43:31',1311,'dispatched'), (5,'2018-04-06 11:43:31','2018-04-06 11:43:31',1310,'dispatched'), (6,'2018-04-06 11:43:31','2018-04-06 11:43:31',1306,'dispatched'), (7,'2018-04-06 11:57:10','2018-04-06 11:57:10',1314,'pending'), (8,'2018-04-06 12:00:09','2018-04-06 12:00:09',1313,'dispatched'), (9,'2018-04-06 12:09:57','2018-04-06 12:09:57',1319,'pending'), (10,'2018-04-06 12:10:29','2018-04-06 12:10:29',1320,'pending'), (11,'2018-04-06 12:11:06','2018-04-06 12:11:06',1320,'dispatched'), (12,'2018-04-06 12:16:16','2018-04-06 12:16:16',1321,'dispatched'), (13,'2018-04-06 12:24:07','2018-04-06 12:24:07',1322,'dispatched'), (14,'2018-04-06 12:34:56','2018-04-06 12:34:56',1323,'dispatched'), (15,'2018-04-06 12:34:59','2018-04-06 12:34:59',1314,'dispatched'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (16,'2018-04-06 12:35:52','2018-04-06 12:35:52',1314,'confirmed'), (17,'2018-04-06 12:41:12','2018-04-06 12:41:12',1324,'dispatched'), (18,'2018-04-06 12:58:48','2018-04-06 12:58:48',1325,'dispatched'), (19,'2018-04-06 13:51:47','2018-04-06 13:51:47',1330,'dispatched'), (20,'2018-04-06 13:53:09','2018-04-06 13:53:09',1329,'dispatched'), (21,'2018-04-06 14:35:04','2018-04-06 14:35:04',1330,'confirmed'), (22,'2018-04-06 14:37:25','2018-04-06 14:37:25',1329,'confirmed'), (23,'2018-04-06 14:38:39','2018-04-06 14:38:39',1315,'confirmed'), (24,'2018-04-06 14:39:13','2018-04-06 14:39:13',1326,'confirmed'), (25,'2018-04-06 14:39:20','2018-04-06 14:39:20',1325,'confirmed'), (26,'2018-04-06 14:40:39','2018-04-06 14:40:39',1310,'confirmed'), (27,'2018-04-06 14:45:18','2018-04-06 14:45:18',1297,'confirmed'), (28,'2018-04-06 14:45:32','2018-04-06 14:45:32',1305,'confirmed'), (29,'2018-04-06 14:49:57','2018-04-06 14:49:57',1331,'dispatched'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (30,'2018-04-06 15:07:35','2018-04-06 15:07:35',1332,'pending'), (31,'2018-04-06 15:08:24','2018-04-06 15:08:24',1317,'confirmed'), (32,'2018-04-06 15:30:32','2018-04-06 15:30:32',1333,'pending'), (33,'2018-04-06 15:31:06','2018-04-06 15:31:06',1334,'pending'), (34,'2018-04-06 15:31:40','2018-04-06 15:31:40',1335,'pending'), (35,'2018-04-06 15:45:45','2018-04-06 15:45:45',1336,'pending'), (36,'2018-04-06 15:47:44','2018-04-06 15:47:44',1337,'pending'), (37,'2018-04-06 16:11:09','2018-04-06 16:11:09',1337,'confirmed'), (38,'2018-04-06 16:11:46','2018-04-06 16:11:46',1336,'dispatched'), (39,'2018-04-06 16:11:56','2018-04-06 16:11:56',1336,'confirmed'), (40,'2018-04-06 16:12:34','2018-04-06 16:12:34',1316,'confirmed'), (41,'2018-04-06 16:13:42','2018-04-06 16:13:42',1335,'dispatched'), (42,'2018-04-06 16:13:57','2018-04-06 16:13:57',1335,'confirmed'), (43,'2018-04-06 16:14:33','2018-04-06 16:14:33',1341,'pending'), (44,'2018-04-06 16:15:52','2018-04-06 16:15:52',1342,'pending'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (45,'2018-04-06 16:16:11','2018-04-06 16:16:11',1342,'dispatched'), (46,'2018-04-06 16:16:21','2018-04-06 16:16:21',1342,'confirmed'), (47,'2018-04-06 16:16:26','2018-04-06 16:16:26',1341,'dispatched'), (48,'2018-04-06 16:16:37','2018-04-06 16:16:37',1341,'confirmed'), (49,'2018-04-06 16:16:56','2018-04-06 16:16:56',1343,'pending'), (50,'2018-04-06 16:17:56','2018-04-06 16:17:56',1344,'pending'), (51,'2018-04-06 16:22:03','2018-04-06 16:22:03',1344,'confirmed'), (52,'2018-04-06 16:22:07','2018-04-06 16:22:07',1340,'dispatched'), (53,'2018-04-06 16:22:20','2018-04-06 16:22:20',1340,'confirmed'), (54,'2018-04-06 16:28:48','2018-04-06 16:28:48',1272,'dispatched'), (55,'2018-04-06 16:28:48','2018-04-06 16:28:48',1271,'dispatched'), (56,'2018-04-06 16:28:48','2018-04-06 16:28:48',1270,'dispatched'), (57,'2018-04-06 16:28:48','2018-04-06 16:28:48',1269,'dispatched'), (58,'2018-04-06 16:28:48','2018-04-06 16:28:48',1268,'dispatched'), (59,'2018-04-06 16:28:48','2018-04-06 16:28:48',1267,'dispatched'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (60,'2018-04-06 16:29:57','2018-04-06 16:29:57',1266,'confirmed'), (61,'2018-04-06 16:29:57','2018-04-06 16:29:57',1265,'confirmed'), (62,'2018-04-06 16:29:57','2018-04-06 16:29:57',1264,'confirmed'), (63,'2018-04-06 16:29:57','2018-04-06 16:29:57',1263,'confirmed'), (64,'2018-04-06 16:29:57','2018-04-06 16:29:57',1262,'confirmed'), (65,'2018-04-06 16:29:57','2018-04-06 16:29:57',1261,'confirmed'), (66,'2018-04-06 16:29:57','2018-04-06 16:29:57',1260,'confirmed'), (67,'2018-04-06 16:29:57','2018-04-06 16:29:57',1259,'confirmed'), (68,'2018-04-06 16:30:28','2018-04-06 16:30:28',1273,'confirmed'), (69,'2018-04-06 16:30:28','2018-04-06 16:30:28',1272,'confirmed'), (70,'2018-04-06 16:30:28','2018-04-06 16:30:28',1271,'confirmed'), (71,'2018-04-06 16:30:28','2018-04-06 16:30:28',1270,'confirmed'), (72,'2018-04-06 16:30:28','2018-04-06 16:30:28',1269,'confirmed'), (73,'2018-04-06 16:30:28','2018-04-06 16:30:28',1268,'confirmed'), (74,'2018-04-06 16:30:28','2018-04-06 16:30:28',1267,'confirmed'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (75,'2018-04-06 16:30:34','2018-04-06 16:30:34',1345,'pending'), (76,'2018-04-06 16:31:02','2018-04-06 16:31:02',1347,'pending'), (77,'2018-04-06 16:31:04','2018-04-06 16:31:04',1347,'pending'), (78,'2018-04-06 16:34:46','2018-04-06 16:34:46',1349,'pending'), (79,'2018-04-06 16:34:49','2018-04-06 16:34:49',1350,'pending'), (80,'2018-04-06 16:35:05','2018-04-06 16:35:05',1349,'pending'), (81,'2018-04-06 16:36:14','2018-04-06 16:36:14',1351,'pending'), (82,'2018-04-06 16:36:26','2018-04-06 16:36:26',1352,'pending'), (83,'2018-04-06 16:36:50','2018-04-06 16:36:50',1353,'pending'), (84,'2018-04-06 16:39:35','2018-04-06 16:39:35',1353,'dispatched'), (85,'2018-04-06 16:39:35','2018-04-06 16:39:35',1343,'dispatched'), (86,'2018-04-06 16:39:36','2018-04-06 16:39:36',1353,'dispatched'), (87,'2018-04-06 16:39:36','2018-04-06 16:39:36',1343,'dispatched'), (88,'2018-04-06 16:42:26','2018-04-06 16:42:26',1354,'pending'), (89,'2018-04-06 16:42:53','2018-04-06 16:42:53',1355,'pending'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (90,'2018-04-06 17:32:04','2018-04-06 17:32:04',1356,'pending'), (91,'2018-04-06 17:32:44','2018-04-06 17:32:44',1357,'pending'), (92,'2018-04-06 17:31:05','2018-04-06 17:31:05',1357,'dispatched'), (93,'2018-04-06 17:53:02','2018-04-06 17:53:02',1356,'dispatched'), (94,'2018-04-06 19:30:53','2018-04-06 19:30:53',1359,'pending'), (95,'2018-04-06 19:30:54','2018-04-06 19:30:54',1359,'pending'), (96,'2018-04-06 19:34:30','2018-04-06 19:34:30',1360,'pending'), (97,'2018-04-06 19:46:28','2018-04-06 19:46:28',1362,'pending'), (98,'2018-04-06 19:46:31','2018-04-06 19:46:31',1363,'pending'), (99,'2018-04-06 19:46:57','2018-04-06 19:46:57',1365,'pending'), (100,'2018-04-06 19:47:22','2018-04-06 19:47:22',1366,'pending'), (101,'2018-04-06 19:47:45','2018-04-06 19:47:45',1367,'pending'), (102,'2018-04-06 19:52:37','2018-04-06 19:52:37',1358,'dispatched'), (103,'2018-04-06 19:53:10','2018-04-06 19:53:10',1358,'confirmed'), (104,'2018-04-06 19:54:12','2018-04-06 19:54:12',1359,'confirmed'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (105,'2018-04-06 22:32:02','2018-04-06 22:32:02',1368,'pending'), (106,'2018-04-07 09:33:17','2018-04-07 09:33:17',1369,'pending'), (107,'2018-04-09 09:26:00','2018-04-09 09:26:00',1370,'pending'), (108,'2018-04-09 09:27:07','2018-04-09 09:27:07',1371,'pending'), (109,'2018-04-09 09:39:51','2018-04-09 09:39:51',1371,'dispatched'), (110,'2018-04-09 09:40:07','2018-04-09 09:40:07',1371,'dispatched'), (111,'2018-04-09 09:40:22','2018-04-09 09:40:22',1370,'dispatched'), (112,'2018-04-09 09:40:34','2018-04-09 09:40:34',1371,'confirmed'), (113,'2018-04-09 09:41:57','2018-04-09 09:41:57',1372,'pending'), (114,'2018-04-09 09:52:55','2018-04-09 09:52:55',1373,'pending'), (115,'2018-04-09 09:53:59','2018-04-09 09:53:59',1374,'pending'), (116,'2018-04-09 09:54:59','2018-04-09 09:54:59',1374,'dispatched'), (117,'2018-04-09 09:55:12','2018-04-09 09:55:12',1374,'confirmed'), (118,'2018-04-09 10:00:02','2018-04-09 10:00:02',1375,'pending'), (119,'2018-04-09 10:03:39','2018-04-09 10:03:39',1376,'pending'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (120,'2018-04-09 10:07:25','2018-04-09 10:07:25',1377,'pending'), (121,'2018-04-09 10:17:05','2018-04-09 10:17:05',1378,'pending'), (122,'2018-04-09 10:18:07','2018-04-09 10:18:07',1379,'pending'), (123,'2018-04-09 10:18:39','2018-04-09 10:18:39',1379,'dispatched'), (124,'2018-04-09 10:20:47','2018-04-09 10:20:47',1380,'pending'), (125,'2018-04-09 10:21:09','2018-04-09 10:21:09',1381,'pending'), (126,'2018-04-09 10:21:20','2018-04-09 10:21:20',1382,'pending'), (127,'2018-04-09 10:24:13','2018-04-09 10:24:13',1381,'dispatched'), (128,'2018-04-09 10:23:14','2018-04-09 10:23:14',1382,'confirmed'), (129,'2018-04-09 10:23:29','2018-04-09 10:23:29',1381,'confirmed'), (130,'2018-04-09 10:23:29','2018-04-09 10:23:29',1257,'confirmed'), (131,'2018-04-09 10:23:47','2018-04-09 10:23:47',1380,'confirmed'), (132,'2018-04-09 10:25:26','2018-04-09 10:25:26',1378,'dispatched'), (133,'2018-04-09 10:25:39','2018-04-09 10:25:39',1378,'confirmed'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (134,'2018-04-09 10:34:29','2018-04-09 10:34:29',1383,'pending'), (135,'2018-04-09 10:34:42','2018-04-09 10:34:42',1384,'pending'), (136,'2018-04-09 10:35:07','2018-04-09 10:35:07',1385,'pending'), (137,'2018-04-09 10:36:26','2018-04-09 10:36:26',1386,'pending'), (138,'2018-04-09 10:39:48','2018-04-09 10:39:48',1377,'dispatched'), (139,'2018-04-09 10:42:11','2018-04-09 10:42:11',1387,'pending'), (140,'2018-04-09 10:42:42','2018-04-09 10:42:42',1387,'dispatched'), (141,'2018-04-09 10:40:49','2018-04-09 10:40:49',1377,'confirmed'), (142,'2018-04-09 10:47:19','2018-04-09 10:47:19',1388,'pending'), (143,'2018-04-09 10:53:33','2018-04-09 10:53:33',1389,'pending'), (144,'2018-04-09 10:54:37','2018-04-09 10:54:37',1390,'pending'), (145,'2018-04-09 11:02:34','2018-04-09 11:02:34',1391,'pending'), (146,'2018-04-09 11:06:01','2018-04-09 11:06:01',1391,'dispatched'), (147,'2018-04-09 11:06:59','2018-04-09 11:06:59',1392,'pending'), (148,'2018-04-09 11:07:45','2018-04-09 11:07:45',1393,'pending'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (149,'2018-04-09 11:12:57','2018-04-09 11:12:57',1394,'pending'), (150,'2018-04-09 11:20:42','2018-04-09 11:20:42',1394,'dispatched'), (151,'2018-04-09 11:20:55','2018-04-09 11:20:55',1385,'confirmed'), (152,'2018-04-09 11:21:11','2018-04-09 11:21:11',1385,'confirmed'), (153,'2018-04-09 11:21:15','2018-04-09 11:21:15',1384,'confirmed'), (154,'2018-04-09 11:21:27','2018-04-09 11:21:27',1394,'confirmed'), (155,'2018-04-09 11:25:10','2018-04-09 11:25:10',1393,'dispatched'), (156,'2018-04-09 11:23:14','2018-04-09 11:23:14',1393,'pending'), (157,'2018-04-09 11:26:26','2018-04-09 11:26:26',1396,'pending'), (158,'2018-04-09 11:26:39','2018-04-09 11:26:39',1395,'dispatched'), (159,'2018-04-09 11:26:40','2018-04-09 11:26:40',1395,'confirmed'), (160,'2018-04-09 11:29:51','2018-04-09 11:29:51',1396,'dispatched'), (161,'2018-04-09 11:30:08','2018-04-09 11:30:08',1392,'confirmed'), (162,'2018-04-09 11:36:38','2018-04-09 11:36:38',1390,'dispatched'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (163,'2018-04-09 11:38:14','2018-04-09 11:38:14',1397,'pending'), (164,'2018-04-09 11:39:27','2018-04-09 11:39:27',1398,'pending'), (165,'2018-04-09 11:43:41','2018-04-09 11:43:41',1398,'confirmed'), (166,'2018-04-09 11:45:27','2018-04-09 11:45:27',1399,'pending'), (167,'2018-04-09 11:45:58','2018-04-09 11:45:58',1397,'confirmed'), (168,'2018-04-09 11:46:20','2018-04-09 11:46:20',1400,'pending'), (169,'2018-04-09 11:47:22','2018-04-09 11:47:22',1401,'pending'), (170,'2018-04-09 11:48:59','2018-04-09 11:48:59',1402,'pending'), (171,'2018-04-09 11:55:42','2018-04-09 11:55:42',1403,'pending'), (172,'2018-04-09 11:56:50','2018-04-09 11:56:50',1404,'pending'), (173,'2018-04-09 11:58:22','2018-04-09 11:58:22',1405,'pending'), (174,'2018-04-09 12:00:02','2018-04-09 12:00:02',1406,'pending'), (175,'2018-04-09 12:00:55','2018-04-09 12:00:55',1407,'pending'), (176,'2018-04-09 12:01:33','2018-04-09 12:01:33',1408,'pending'), (177,'2018-04-09 12:02:31','2018-04-09 12:02:31',1409,'pending'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (178,'2018-04-09 12:05:05','2018-04-09 12:05:05',1410,'pending'), (179,'2018-04-09 12:10:06','2018-04-09 12:10:06',1411,'pending'), (180,'2018-04-09 12:14:15','2018-04-09 12:14:15',1412,'pending'), (181,'2018-04-09 12:15:06','2018-04-09 12:15:06',1413,'pending'), (182,'2018-04-09 12:17:26','2018-04-09 12:17:26',1414,'pending'), (183,'2018-04-09 12:19:07','2018-04-09 12:19:07',1415,'pending'), (184,'2018-04-09 12:25:58','2018-04-09 12:25:58',1416,'pending'), (185,'2018-04-09 12:32:06','2018-04-09 12:32:06',1417,'pending'), (186,'2018-04-09 12:33:25','2018-04-09 12:33:25',1418,'pending'), (187,'2018-04-09 12:34:19','2018-04-09 12:34:19',1419,'pending'), (188,'2018-04-09 12:35:07','2018-04-09 12:35:07',1420,'pending'), (189,'2018-04-09 12:37:31','2018-04-09 12:37:31',1368,'dispatched'), (190,'2018-04-09 12:39:23','2018-04-09 12:39:23',1368,'confirmed'), (191,'2018-04-09 12:40:55','2018-04-09 12:40:55',1421,'pending'), (192,'2018-04-09 12:43:10','2018-04-09 12:43:10',1422,'pending'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (193,'2018-04-09 12:44:01','2018-04-09 12:44:01',1423,'pending'), (194,'2018-04-09 12:44:33','2018-04-09 12:44:33',1424,'pending'), (195,'2018-04-09 12:44:38','2018-04-09 12:44:38',1423,'dispatched'), (196,'2018-04-09 12:45:20','2018-04-09 12:45:20',1423,'confirmed'), (197,'2018-04-09 12:51:59','2018-04-09 12:51:59',1425,'pending'), (198,'2018-04-09 12:59:06','2018-04-09 12:59:06',1425,'dispatched'), (199,'2018-04-09 13:00:26','2018-04-09 13:00:26',1426,'pending'), (200,'2018-04-09 13:01:55','2018-04-09 13:01:55',1426,'dispatched'), (201,'2018-04-09 13:53:53','2018-04-09 13:53:53',1424,'dispatched'), (202,'2018-04-09 13:55:13','2018-04-09 13:55:13',1422,'confirmed'), (203,'2018-04-09 14:07:06','2018-04-09 14:07:06',1427,'pending'), (204,'2018-04-09 14:16:56','2018-04-09 14:16:56',1428,'pending'), (205,'2018-04-09 14:26:16','2018-04-09 14:26:16',1429,'pending'), (206,'2018-04-09 14:28:47','2018-04-09 14:28:47',1429,'dispatched'), (207,'2018-04-09 14:43:55','2018-04-09 14:43:55',1428,'dispatched'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (208,'2018-04-09 14:44:14','2018-04-09 14:44:14',1428,'confirmed'), (209,'2018-04-09 14:50:46','2018-04-09 14:50:46',1427,'dispatched'), (210,'2018-04-09 14:51:19','2018-04-09 14:51:19',1427,'confirmed'), (211,'2018-04-09 14:58:05','2018-04-09 14:58:05',1430,'pending'), (212,'2018-04-09 15:20:23','2018-04-09 15:20:23',1431,'pending'), (213,'2018-04-09 15:34:44','2018-04-09 15:34:44',1429,'confirmed'), (214,'2018-04-09 15:34:51','2018-04-09 15:34:51',1424,'confirmed'), (215,'2018-04-09 15:53:06','2018-04-09 15:53:06',1421,'dispatched'), (216,'2018-04-09 15:54:01','2018-04-09 15:54:01',1426,'confirmed'), (217,'2018-04-09 15:58:36','2018-04-09 15:58:36',1426,'confirmed'), (218,'2018-04-09 15:59:12','2018-04-09 15:59:12',1425,'confirmed'), (219,'2018-04-09 15:59:32','2018-04-09 15:59:32',1425,'confirmed'), (220,'2018-04-09 16:10:37','2018-04-09 16:10:37',1431,'confirmed'), (221,'2018-04-09 16:10:48','2018-04-09 16:10:48',1430,'confirmed'); INSERT INTO `transaction_history` (`unique_no`,`created_date`,`last_modified_date`,`order_id`,`status`) VALUES (222,'2018-04-09 16:46:09','2018-04-09 16:46:09',1420,'confirmed'), (223,'2018-04-09 16:49:22','2018-04-09 16:49:22',1432,'pending'), (224,'2018-04-09 17:08:46','2018-04-09 17:08:46',1421,'confirmed'), (225,'2018-04-09 17:20:19','2018-04-09 17:20:19',1432,'confirmed'); /*!40000 ALTER TABLE `transaction_history` ENABLE KEYS */; -- -- Definition of table `user_cart` -- DROP TABLE IF EXISTS `user_cart`; CREATE TABLE `user_cart` ( `cart_id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`cart_id`), UNIQUE KEY `UK_mk3cp7wbsbrr31nkd19bb63i7` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_cart` -- /*!40000 ALTER TABLE `user_cart` DISABLE KEYS */; INSERT INTO `user_cart` (`cart_id`,`user_id`) VALUES (12,5), (47,10), (8,19), (11,26), (18,31), (1,38), (4,41), (3,42), (37,43), (23,49), (25,51), (16,54), (20,59), (27,62), (5,64), (13,77), (14,83), (40,84), (6,87), (9,92), (2,99), (7,117), (10,119), (17,120), (38,121), (15,123), (19,132), (21,133), (22,135), (24,137), (26,138), (28,139), (29,141), (30,145), (31,147), (32,148), (34,151), (35,152), (33,153), (36,154), (39,155), (41,159), (42,160), (43,161), (44,162), (45,163), (46,164), (48,165), (49,166), (50,167); /*!40000 ALTER TABLE `user_cart` ENABLE KEYS */; -- -- Definition of table `user_order` -- DROP TABLE IF EXISTS `user_order`; CREATE TABLE `user_order` ( `order_id` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `is_active` bit(1) DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `payment_mode` varchar(255) DEFAULT NULL, `price` float DEFAULT NULL, `status` varchar(255) DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, `shipping_address_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`order_id`), KEY `FKbbwlke5ei3gh1ki65yiiojmck` (`user_id`), KEY `FKo2lj94xaujs1se8whlhc37nj7` (`shipping_address_id`), CONSTRAINT `FKbbwlke5ei3gh1ki65yiiojmck` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`), CONSTRAINT `FKo2lj94xaujs1se8whlhc37nj7` FOREIGN KEY (`shipping_address_id`) REFERENCES `shipping_address` (`shipping_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1433 DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_order` -- /*!40000 ALTER TABLE `user_order` DISABLE KEYS */; INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1256,'2018-04-05 15:26:23',0x00,'2018-04-06 09:42:51','COD',114,'confirmed',99,NULL), (1257,'2018-04-05 15:28:23',0x00,'2018-04-09 10:23:29','COD',1382,'confirmed',139,NULL), (1258,'2018-04-05 15:29:10',0x00,'2018-04-05 18:10:57','COD',4250,'confirmed',139,NULL), (1259,'2018-04-05 16:01:06',0x00,'2018-04-06 16:29:57','COD',3996.25,'confirmed',137,NULL), (1260,'2018-04-05 16:03:10',0x00,'2018-04-06 16:29:57','COD',0,'confirmed',137,NULL), (1261,'2018-04-05 16:03:20',0x00,'2018-04-06 16:29:57','COD',0,'confirmed',137,NULL), (1262,'2018-04-05 16:03:52',0x00,'2018-04-06 16:29:57','COD',800,'confirmed',137,NULL), (1263,'2018-04-05 16:06:12',0x00,'2018-04-06 16:29:57','COD',0,'confirmed',137,NULL), (1264,'2018-04-05 16:06:23',0x00,'2018-04-06 16:29:57','COD',1714,'confirmed',137,NULL), (1265,'2018-04-05 16:04:12',0x00,'2018-04-06 16:29:57','COD',800,'confirmed',5,NULL), (1266,'2018-04-05 16:05:50',0x00,'2018-04-06 16:29:57','COD',800,'confirmed',5,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1267,'2018-04-05 16:08:07',0x00,'2018-04-06 16:30:28','COD',1382,'confirmed',137,NULL), (1268,'2018-04-05 16:09:46',0x00,'2018-04-06 16:30:28','COD',645,'confirmed',137,NULL), (1269,'2018-04-05 16:08:20',0x00,'2018-04-06 16:30:28','COD',800,'confirmed',5,NULL), (1270,'2018-04-05 16:09:05',0x00,'2018-04-06 16:30:28','COD',800,'confirmed',5,NULL), (1271,'2018-04-05 16:09:31',0x00,'2018-04-06 16:30:28','COD',800,'confirmed',5,NULL), (1272,'2018-04-05 16:09:54',0x00,'2018-04-06 16:30:28','COD',800,'confirmed',5,NULL), (1273,'2018-04-05 16:10:47',0x00,'2018-04-06 16:30:28','COD',800,'confirmed',5,NULL), (1274,'2018-04-05 16:21:42',0x00,'2018-04-05 16:21:42','COD',2598,'pending',137,NULL), (1275,'2018-04-05 16:19:53',0x00,'2018-04-05 16:19:53','COD',800,'pending',148,NULL), (1276,'2018-04-05 16:20:36',0x00,'2018-04-05 18:08:17','COD',800,'confirmed',148,NULL), (1277,'2018-04-05 16:23:19',0x00,'2018-04-05 18:08:17','COD',800,'confirmed',148,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1278,'2018-04-05 18:21:50',0x00,'2018-04-05 18:22:14','COD',150,'dispatched',137,NULL), (1279,'2018-04-05 18:24:01',0x00,'2018-04-06 09:39:24','COD',110,'confirmed',137,NULL), (1280,'2018-04-06 09:20:55',0x00,'2018-04-06 09:20:55','COD',645,'pending',26,NULL), (1281,'2018-04-06 09:21:25',0x00,'2018-04-06 09:36:35','COD',672,'dispatched',26,NULL), (1282,'2018-04-06 09:42:21',0x00,'2018-04-06 09:42:51','COD',957,'confirmed',99,NULL), (1283,'2018-04-06 09:42:29',0x00,'2018-04-06 09:42:29','COD',786,'pending',19,NULL), (1284,'2018-04-06 09:46:29',0x00,'2018-04-06 09:46:29','COD',3782,'pending',99,NULL), (1285,'2018-04-06 09:44:24',0x00,'2018-04-06 09:57:17','COD',220,'dispatched',5,30), (1286,'2018-04-06 09:45:17',0x00,'2018-04-06 09:45:17','COD',977,'pending',19,NULL), (1287,'2018-04-06 09:45:38',0x00,'2018-04-06 09:45:38','COD',1622,'pending',5,NULL), (1288,'2018-04-06 09:50:18',0x00,'2018-04-06 09:50:18','COD',1327,'pending',99,27); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1289,'2018-04-06 09:52:04',0x00,'2018-04-06 09:52:04','COD',342,'pending',19,NULL), (1290,'2018-04-06 09:52:39',0x00,'2018-04-06 09:52:39','COD',1382,'pending',137,NULL), (1291,'2018-04-06 09:55:38',0x00,'2018-04-06 09:55:38','COD',1020,'pending',137,NULL), (1292,'2018-04-06 09:55:54',0x00,'2018-04-06 09:55:54','COD',1623,'pending',137,NULL), (1293,'2018-04-06 09:56:04',0x00,'2018-04-06 09:56:04','COD',222,'pending',137,NULL), (1294,'2018-04-06 09:56:15',0x00,'2018-04-06 09:56:15','COD',631,'pending',137,NULL), (1295,'2018-04-06 09:56:23',0x00,'2018-04-06 09:56:23','COD',977,'pending',137,NULL), (1296,'2018-04-06 10:01:17',0x00,'2018-04-06 10:01:17','COD',1714,'pending',139,NULL), (1297,'2018-04-06 10:00:14',0x00,'2018-04-06 14:45:18','COD',342,'confirmed',19,NULL), (1298,'2018-04-06 10:05:37',0x00,'2018-04-06 10:05:37','COD',3173,'pending',137,38), (1299,'2018-04-06 10:03:57',0x00,'2018-04-06 10:03:57','COD',1954,'pending',5,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1300,'2018-04-06 10:10:07',0x00,'2018-04-06 10:10:07','COD',450,'pending',19,NULL), (1301,'2018-04-06 10:10:39',0x00,'2018-04-06 10:10:39','COD',222,'pending',19,NULL), (1302,'2018-04-06 10:11:02',0x00,'2018-04-06 10:11:02','COD',800,'pending',19,NULL), (1303,'2018-04-06 10:36:41',0x00,'2018-04-06 11:31:25','COD',1250,'dispatched',121,NULL), (1304,'2018-04-06 10:35:09',0x00,'2018-04-06 10:35:09','COD',1746,'pending',26,NULL), (1305,'2018-04-06 10:36:25',0x00,'2018-04-06 14:45:32','COD',220,'confirmed',26,NULL), (1306,'2018-04-06 10:41:49',0x00,'2018-04-06 11:43:31','COD',1537,'dispatched',121,NULL), (1307,'2018-04-06 10:44:15',0x00,'2018-04-06 10:55:34','COD',800,'dispatched',121,NULL), (1308,'2018-04-06 10:44:18',0x00,'2018-04-06 11:01:00','COD',800,'confirmed',121,NULL), (1309,'2018-04-06 11:08:56',0x00,'2018-04-06 11:10:15','COD',1365,'confirmed',137,NULL), (1310,'2018-04-06 11:15:43',0x00,'2018-04-06 14:40:39','COD',737,'confirmed',148,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1311,'2018-04-06 11:18:13',0x00,'2018-04-06 11:43:31','COD',631,'dispatched',77,NULL), (1312,'2018-04-06 11:18:03',0x00,'2018-04-06 11:23:28','COD',800,'dispatched',148,NULL), (1313,'2018-04-06 11:37:29',0x00,'2018-04-06 12:00:09','COD',418,'dispatched',137,NULL), (1314,'2018-04-06 11:57:07',0x00,'2018-04-06 12:35:52','COD',1427,'confirmed',137,NULL), (1315,'2018-04-06 11:55:45',0x00,'2018-04-06 14:38:39','COD',786,'confirmed',19,NULL), (1316,'2018-04-06 12:01:48',0x00,'2018-04-06 16:12:34','COD',786,'confirmed',19,NULL), (1317,'2018-04-06 12:04:26',0x00,'2018-04-06 15:08:24','COD',786,'confirmed',19,NULL), (1318,'2018-04-06 12:06:06',0x00,'2018-04-06 14:04:05','COD',220,'confirmed',148,NULL), (1319,'2018-04-06 12:09:54',0x00,'2018-04-06 13:54:12','COD',2227,'confirmed',137,NULL), (1320,'2018-04-06 12:10:26',0x00,'2018-04-06 12:11:06','COD',204,'dispatched',137,NULL), (1321,'2018-04-06 12:13:50',0x00,'2018-04-06 12:16:16','COD',127,'dispatched',137,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1322,'2018-04-06 12:21:16',0x00,'2018-04-06 12:24:07','COD',35,'dispatched',137,NULL), (1323,'2018-04-06 12:32:14',0x00,'2018-04-06 12:34:56','COD',64,'dispatched',137,NULL), (1324,'2018-04-06 12:38:10',0x00,'2018-04-06 12:41:12','COD',19,'dispatched',137,NULL), (1325,'2018-04-06 12:55:33',0x00,'2018-04-06 14:39:20','COD',89,'confirmed',137,NULL), (1326,'2018-04-06 13:01:01',0x00,'2018-04-06 14:39:12','COD',222,'confirmed',148,NULL), (1327,'2018-04-06 13:06:58',0x00,'2018-04-06 13:53:56','COD',222,'confirmed',148,NULL), (1328,'2018-04-06 13:07:16',0x00,'2018-04-06 14:01:51','COD',222,'confirmed',148,NULL), (1329,'2018-04-06 13:15:45',0x00,'2018-04-06 14:37:25','COD',222,'confirmed',148,NULL), (1330,'2018-04-06 13:35:38',0x00,'2018-04-06 14:35:04','COD',342,'confirmed',19,NULL), (1331,'2018-04-06 14:47:18',0x00,'2018-04-06 14:49:56','COD',3859,'dispatched',137,NULL), (1332,'2018-04-06 15:07:32',0x00,'2018-04-06 15:07:32','COD',450,'pending',148,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1333,'2018-04-06 15:30:29',0x00,'2018-04-06 15:30:29','COD',222,'pending',148,NULL), (1334,'2018-04-06 15:31:02',0x00,'2018-04-06 15:31:02','COD',645,'pending',148,NULL), (1335,'2018-04-06 15:31:37',0x00,'2018-04-06 16:13:56','COD',222,'confirmed',148,NULL), (1336,'2018-04-06 15:45:41',0x00,'2018-04-06 16:11:56','COD',50,'confirmed',137,NULL), (1337,'2018-04-06 15:47:40',0x00,'2018-04-06 16:11:09','COD',0,'confirmed',137,NULL), (1338,'2018-04-06 16:14:25',0x00,'2018-04-06 16:14:25','COD',764,'pending',26,NULL), (1339,'2018-04-06 16:14:27',0x00,'2018-04-06 16:14:27','COD',764,'pending',26,NULL), (1340,'2018-04-06 16:14:27',0x00,'2018-04-06 16:22:20','COD',764,'confirmed',26,NULL), (1341,'2018-04-06 16:14:30',0x00,'2018-04-06 16:16:37','COD',764,'confirmed',26,NULL), (1342,'2018-04-06 16:15:48',0x00,'2018-04-06 16:16:21','COD',764,'confirmed',26,NULL), (1343,'2018-04-06 16:16:53',0x00,'2018-04-06 16:39:35','COD',1643,'dispatched',5,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1344,'2018-04-06 16:17:53',0x00,'2018-04-06 16:22:03','COD',1528,'confirmed',26,NULL), (1345,'2018-04-06 16:30:31',0x00,'2018-04-06 16:30:31','COD',662,'pending',5,NULL), (1346,'2018-04-06 16:30:58',0x00,'2018-04-06 16:30:58','COD',800,'pending',5,NULL), (1347,'2018-04-06 16:31:02',0x00,'2018-04-06 16:31:02','COD',800,'pending',5,NULL), (1348,'2018-04-06 16:34:42',0x00,'2018-04-06 16:34:42','COD',3171,'pending',19,NULL), (1349,'2018-04-06 16:34:43',0x00,'2018-04-06 16:34:43','COD',3171,'pending',19,NULL), (1350,'2018-04-06 16:34:47',0x00,'2018-04-06 16:34:47','COD',225,'pending',137,38), (1351,'2018-04-06 16:36:11',0x00,'2018-04-06 16:36:11','COD',212,'pending',19,NULL), (1352,'2018-04-06 16:36:23',0x00,'2018-04-06 16:36:23','COD',645,'pending',19,NULL), (1353,'2018-04-06 16:36:47',0x00,'2018-04-06 16:39:35','COD',220,'dispatched',19,NULL), (1354,'2018-04-06 16:42:24',0x00,'2018-04-06 16:42:24','COD',222,'pending',26,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1355,'2018-04-06 16:42:50',0x00,'2018-04-06 16:42:50','COD',670,'pending',26,NULL), (1356,'2018-04-06 17:32:01',0x00,'2018-04-06 17:53:02','COD',630,'dispatched',137,NULL), (1357,'2018-04-06 17:32:41',0x00,'2018-04-06 17:31:05','COD',630,'dispatched',137,NULL), (1358,'2018-04-06 19:30:50',0x00,'2018-04-06 19:53:10','COD',175,'confirmed',139,NULL), (1359,'2018-04-06 19:30:52',0x00,'2018-04-06 19:54:12','COD',175,'confirmed',139,NULL), (1360,'2018-04-06 19:34:27',0x00,'2018-04-06 19:34:27','COD',40,'pending',139,NULL), (1361,'2018-04-06 19:46:24',0x00,'2018-04-06 19:46:24','COD',666,'pending',137,NULL), (1362,'2018-04-06 19:46:28',0x00,'2018-04-06 19:46:28','COD',666,'pending',137,NULL), (1366,'2018-04-06 19:47:19',0x00,'2018-04-06 19:47:19','COD',55,'pending',137,NULL), (1367,'2018-04-06 19:47:43',0x00,'2018-04-06 19:47:43','COD',0,'pending',137,NULL), (1368,'2018-04-06 22:32:00',0x00,'2018-04-09 12:39:23','COD',3000000000,'confirmed',137,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1369,'2018-04-07 09:33:14',0x00,'2018-04-07 09:33:14','COD',70,'pending',5,32), (1370,'2018-04-09 09:25:57',0x00,'2018-04-09 09:40:22','COD',2292,'dispatched',133,NULL), (1371,'2018-04-09 09:27:04',0x00,'2018-04-09 09:40:34','COD',1326.25,'confirmed',133,NULL), (1372,'2018-04-09 09:41:55',0x00,'2018-04-09 09:41:55','COD',666,'pending',148,NULL), (1373,'2018-04-09 09:52:52',0x00,'2018-04-09 09:52:52','COD',2293,'pending',5,32), (1374,'2018-04-09 09:53:57',0x00,'2018-04-09 09:55:12','COD',215,'confirmed',5,43), (1375,'2018-04-09 09:59:58',0x00,'2018-04-09 09:59:58','COD',24097,'pending',137,NULL), (1376,'2018-04-09 10:03:36',0x00,'2018-04-09 10:03:36','COD',750,'pending',5,NULL), (1377,'2018-04-09 10:07:22',0x00,'2018-04-09 10:40:49','COD',63,'confirmed',137,NULL), (1378,'2018-04-09 10:17:02',0x00,'2018-04-09 10:25:39','COD',800,'confirmed',155,NULL), (1379,'2018-04-09 10:18:04',0x00,'2018-04-09 10:18:38','COD',75,'dispatched',155,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1380,'2018-04-09 10:20:43',0x00,'2018-04-09 10:23:47','COD',120,'confirmed',155,NULL), (1381,'2018-04-09 10:21:06',0x00,'2018-04-09 10:23:29','COD',675,'confirmed',137,NULL), (1382,'2018-04-09 10:21:16',0x00,'2018-04-09 10:23:14','COD',374.25,'confirmed',26,NULL), (1383,'2018-04-09 10:34:25',0x00,'2018-04-09 10:34:25','COD',666,'pending',10,NULL), (1384,'2018-04-09 10:34:40',0x00,'2018-04-09 11:21:15','COD',677,'confirmed',10,NULL), (1385,'2018-04-09 10:35:03',0x00,'2018-04-09 11:20:55','COD',2031,'confirmed',10,NULL), (1386,'2018-04-09 10:36:23',0x00,'2018-04-09 10:36:23','COD',420.25,'pending',10,NULL), (1387,'2018-04-09 10:42:08',0x00,'2018-04-09 10:42:42','COD',60.25,'dispatched',155,NULL), (1388,'2018-04-09 10:47:16',0x00,'2018-04-09 10:47:16','COD',120,'pending',19,NULL), (1389,'2018-04-09 10:53:30',0x00,'2018-04-09 10:53:30','COD',2565,'pending',87,NULL), (1390,'2018-04-09 10:54:34',0x00,'2018-04-09 11:36:38','COD',666,'dispatched',148,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1391,'2018-04-09 11:02:32',0x00,'2018-04-09 11:06:01','COD',120,'dispatched',19,NULL), (1392,'2018-04-09 11:06:57',0x00,'2018-04-09 11:30:07','COD',952,'confirmed',10,NULL), (1393,'2018-04-09 11:07:43',0x00,'2018-04-09 11:25:10','COD',666,'dispatched',148,NULL), (1394,'2018-04-09 11:12:51',0x00,'2018-04-09 11:21:27','COD',666,'confirmed',148,NULL), (1395,'2018-04-09 11:23:10',0x00,'2018-04-09 11:26:40','COD',666,'confirmed',148,NULL), (1396,'2018-04-09 11:26:23',0x00,'2018-04-09 11:29:51','COD',666,'dispatched',148,NULL), (1397,'2018-04-09 11:38:12',0x00,'2018-04-09 11:45:58','COD',666,'confirmed',148,NULL), (1398,'2018-04-09 11:39:24',0x00,'2018-04-09 11:43:41','COD',666,'confirmed',148,NULL), (1399,'2018-04-09 11:45:24',0x00,'2018-04-09 11:45:24','COD',666,'pending',148,NULL), (1400,'2018-04-09 11:46:16',0x00,'2018-04-09 11:46:16','COD',666,'pending',148,NULL), (1401,'2018-04-09 11:47:19',0x00,'2018-04-09 11:47:19','COD',666,'pending',148,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1402,'2018-04-09 11:48:56',0x00,'2018-04-09 11:48:56','COD',666,'pending',148,NULL), (1403,'2018-04-09 11:55:39',0x00,'2018-04-09 11:55:39','COD',666,'pending',148,NULL), (1404,'2018-04-09 11:56:47',0x00,'2018-04-09 11:56:47','COD',666,'pending',148,NULL), (1405,'2018-04-09 11:58:19',0x00,'2018-04-09 11:58:19','COD',666,'pending',148,NULL), (1406,'2018-04-09 11:59:59',0x00,'2018-04-09 11:59:59','COD',666,'pending',148,NULL), (1407,'2018-04-09 12:00:50',0x00,'2018-04-09 12:00:50','COD',666,'pending',148,NULL), (1408,'2018-04-09 12:01:30',0x00,'2018-04-09 12:01:30','COD',666,'pending',148,NULL), (1409,'2018-04-09 12:02:28',0x00,'2018-04-09 12:02:28','COD',666,'pending',148,NULL), (1410,'2018-04-09 12:05:03',0x00,'2018-04-09 12:05:03','COD',666,'pending',148,NULL), (1411,'2018-04-09 12:10:03',0x00,'2018-04-09 12:10:03','COD',666,'pending',148,NULL), (1412,'2018-04-09 12:14:11',0x00,'2018-04-09 12:14:11','COD',666,'pending',148,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1413,'2018-04-09 12:15:04',0x00,'2018-04-09 12:15:04','COD',666,'pending',148,NULL), (1414,'2018-04-09 12:17:22',0x00,'2018-04-09 12:17:22','COD',666,'pending',148,NULL), (1415,'2018-04-09 12:19:03',0x00,'2018-04-09 12:19:03','COD',666,'pending',148,NULL), (1416,'2018-04-09 12:25:55',0x00,'2018-04-09 12:25:55','COD',666,'pending',148,NULL), (1417,'2018-04-09 12:32:02',0x00,'2018-04-09 12:32:02','COD',666,'pending',148,NULL), (1418,'2018-04-09 12:33:21',0x00,'2018-04-09 12:33:21','COD',666,'pending',148,NULL), (1419,'2018-04-09 12:34:16',0x00,'2018-04-09 12:34:16','COD',666,'pending',148,NULL), (1420,'2018-04-09 12:35:04',0x00,'2018-04-09 16:46:09','COD',666,'confirmed',148,NULL), (1421,'2018-04-09 12:40:52',0x00,'2018-04-09 17:08:46','COD',666,'confirmed',148,NULL), (1422,'2018-04-09 12:43:06',0x00,'2018-04-09 13:55:13','COD',666,'confirmed',148,NULL), (1423,'2018-04-09 12:43:58',0x00,'2018-04-09 12:45:20','COD',786,'confirmed',165,NULL); INSERT INTO `user_order` (`order_id`,`created_date`,`is_active`,`last_modified_date`,`payment_mode`,`price`,`status`,`user_id`,`shipping_address_id`) VALUES (1424,'2018-04-09 12:44:30',0x00,'2018-04-09 15:34:51','COD',666,'confirmed',148,NULL), (1425,'2018-04-09 12:51:56',0x00,'2018-04-09 15:59:12','COD',37.25,'confirmed',155,NULL), (1426,'2018-04-09 13:00:24',0x00,'2018-04-09 15:54:01','COD',22,'confirmed',155,NULL), (1427,'2018-04-09 14:07:04',0x00,'2018-04-09 14:51:19','COD',666,'confirmed',165,NULL), (1428,'2018-04-09 14:16:53',0x00,'2018-04-09 14:44:14','COD',786,'confirmed',148,NULL), (1429,'2018-04-09 14:26:13',0x00,'2018-04-09 15:34:44','COD',374.25,'confirmed',155,NULL), (1430,'2018-04-09 14:58:01',0x00,'2018-04-09 16:10:48','COD',677,'confirmed',137,57), (1431,'2018-04-09 15:20:20',0x00,'2018-04-09 16:10:37','COD',677,'confirmed',121,NULL), (1432,'2018-04-09 16:49:19',0x00,'2018-04-09 17:20:19','COD',10351,'confirmed',165,NULL); /*!40000 ALTER TABLE `user_order` ENABLE KEYS */; -- -- Definition of table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `user_id` bigint(20) NOT NULL AUTO_INCREMENT, `address_line1` varchar(255) DEFAULT NULL, `address_line2` varchar(255) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `first_name` varchar(255) DEFAULT NULL, `gender` bit(1) DEFAULT NULL, `is_admin` bit(1) DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `last_name` varchar(255) DEFAULT NULL, `mail` varchar(255) DEFAULT NULL, `mobile` varchar(255) DEFAULT NULL, `city_id` bigint(20) DEFAULT NULL, `country_id` bigint(20) DEFAULT NULL, `state_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `UK_jhck7kjdogc7yia7qamc89ypv` (`mail`), KEY `FKkpqrx37esphstf2tqxbt89avn` (`city_id`), KEY `FK5t4yyo3f0ctxayh7voqv51fmg` (`country_id`), KEY `FKrbachxgjwxcvfw47e1425qrgr` (`state_id`), CONSTRAINT `FK5t4yyo3f0ctxayh7voqv51fmg` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`), CONSTRAINT `FKkpqrx37esphstf2tqxbt89avn` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`), CONSTRAINT `FKrbachxgjwxcvfw47e1425qrgr` FOREIGN KEY (`state_id`) REFERENCES `state` (`state_id`) ) ENGINE=InnoDB AUTO_INCREMENT=168 DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (1,'Dehradun','','2018-03-22 13:14:58','vishal',0x01,0x00,'2018-03-22 13:14:58','sanerwal','vishal@gmail.com','8755411742',16,1,3), (2,'Dehradun','','2018-03-22 13:42:34','Vishal',0x01,0x00,'2018-03-27 16:23:15','Sanserwal','vishal24@gmail.com','8755411742',32,1,4), (3,'Sapient Razorfish','Sector 144','2018-03-22 13:43:05','Vishal',0x01,0x00,'2018-03-28 12:25:06','Mujumdar','vmujumdar2@sapient.com','0000000000',19,1,3), (4,'abc','def','2018-03-22 13:57:51','khushi',0x00,0x00,'2018-03-22 14:11:32','sharma','ksha62@sapient.com','9929978406',82,1,7), (5,'abc ','','2018-03-22 17:02:57','Prachi',0x00,0x00,'2018-03-22 17:02:57','Thapliyal','prachithapliyal10@gmail.com','8279586155',22,1,2), (6,'aaa','aa','2018-03-22 17:07:44','a',0x01,0x00,'2018-03-23 14:15:53','a','a','11',8,1,1), (7,'fbfvz','dfbgzdb','2018-03-22 17:18:26','Navneet',0x00,0x00,'2018-03-22 17:18:26','G','navu@gmail.com','4562145878',89,1,9), (8,'ok','hjk','2018-03-23 08:39:55','xx',0x00,0x00,'2018-03-23 08:39:55','xx','gh','90',98,1,10); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (9,'i','i','2018-03-23 09:26:47','j',0x00,0x00,'2018-03-23 09:26:47','j','ol','o',49,1,5), (10,'fsdgd','dsg','2018-03-23 09:30:49','Prachi1',NULL,0x00,'2018-04-09 11:06:44','Thapliyal','pthapliyal@sapient.com','7542',96,1,10), (11,'p','p','2018-03-23 09:33:51','p',NULL,0x00,'2018-03-23 09:33:51','p','p','7542',34,1,4), (14,'qqq','qqqq','2018-03-23 10:30:07','test',0x01,0x00,'2018-03-23 10:30:07','test','test@gmail.com','87554',34,1,4), (15,'abc','xyzx','2018-03-23 10:29:48','sagar',0x01,0x00,'2018-03-23 10:29:48','salal','sagarsalal105@gmail.com','9690344359',15,1,3), (16,'asdas','sadddddd','2018-03-23 10:35:04','ad',0x01,0x00,'2018-03-23 11:15:06','ad','a@gmail.com','8',48,1,4), (18,'7','','2018-03-23 10:36:26','a',0x00,0x00,'2018-03-23 10:36:26','a','e','9',24,1,2), (19,'ghazia','s','2018-03-23 10:38:20','shreya',0x00,0x00,'2018-04-09 10:17:11','garg','shreyag932@gmail.com','8527238720',37,1,4), (21,'6','','2018-03-23 10:44:31','shreya',0x00,0x00,'2018-03-23 10:44:31','garg','2','6',79,1,8); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (22,'a','a','2018-03-23 10:59:22','vishal',0x01,0x00,'2018-03-23 10:59:22','v','a@b.c','11',52,1,6), (23,'l','l','2018-03-23 11:43:14','l',NULL,0x00,'2018-03-23 11:43:14','l','l','4844646944',51,1,6), (24,'hga','jbsdfh','2018-03-23 12:40:17','Vaibhav',0x01,0x00,'2018-03-23 12:40:17','bisht','vb@g.com','989898',22,1,2), (26,'abc abc','assd','2018-03-23 12:55:48','Aditya',0x01,0x00,'2018-04-06 16:37:51','Dobhal','adityadobhal.22@gmail.com','1111111111',71,1,8), (27,'g','g','2018-03-23 13:00:22','Aditya',0x01,0x00,'2018-03-23 13:00:22','Dobhal','gdfgfdg','9799',96,1,10), (28,'dsa','dsf','2018-03-23 13:01:02','ad',0x01,0x00,'2018-03-23 13:01:02','ad','dasada','23232',39,1,4), (30,'aaaa','aaaa','2018-03-23 14:35:06','a',0x01,0x00,'2018-03-23 14:35:06','a','aasas','a',95,1,10), (31,'pl 1','b road','2018-03-23 16:09:34','sakshi',0x00,0x00,'2018-03-23 16:09:34','khanwani','skhanwani@sapient.com','9112233445',57,1,6), (33,'v','v','2018-03-23 16:14:37','a',0x01,0x00,'2018-03-23 16:14:37','a','ab','9',70,1,7); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (34,'1','1','2018-03-23 16:16:06','ab',0x01,0x00,'2018-03-23 16:16:06','a','abc','7',80,1,8), (35,'Line 1','Line 2','2018-03-23 18:30:35','sagar',0x01,0x00,'2018-03-23 18:30:35','salal','sagar@mail.com','1234567890',86,1,9), (37,'sector 6','2','2018-03-23 19:12:17','prateek',0x01,0x00,'2018-03-23 19:12:17','garg','pgar13@sapient.com','9898989898',6,1,1), (38,'line 1','line 2','2018-03-24 17:23:43','sagar',0x01,0x01,'2018-03-28 12:34:06','salal','sagarsalal@gmail.com','9690344359',88,1,9), (39,'paras','','2018-03-24 18:17:55','mehran',0x01,0x00,'2018-03-24 18:17:55','ahmed','mehranahmed@gmail.com','7906005381',65,1,7), (40,'sad','asdas','2018-03-24 18:51:53','sada',0x01,0x00,'2018-03-24 18:51:53','asdasd','ksha621@sapient.com','1234567890',91,1,10), (41,'......','','2018-03-26 09:17:23','Prachi',0x00,0x00,'2018-04-04 13:59:25','Thapliyal','prachi@kj','9778517775',24,1,2), (42,'swarnim vihar','','2018-03-26 09:46:58','RANJAN',0x01,0x00,'2018-03-26 09:46:58','RAJVEER','rkumar205@sapient.com','8084627612',49,1,5); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (43,'fbfvz','','2018-03-26 09:51:45','Tarun',0x01,0x01,'2018-03-26 09:51:45','Garg','garg.tarun939@gmail.com','9803973125',78,1,8), (44,'dczxcv','','2018-03-26 09:55:25','keshav',0x01,0x00,'2018-03-26 09:55:25','ladha','ladhasonucacs@gmail.com','8471830376',99,1,10), (46,'htfhgfhgfhg','','2018-03-26 10:25:49','ad',0x01,0x00,'2018-03-26 10:25:49','ad','hghgfhg@hn','9999999999',14,1,3), (47,'a','a','2018-03-26 10:39:31','a',0x01,0x00,'2018-03-26 10:39:31','a','a@a','9999999999',32,1,4), (48,'a','a','2018-03-26 10:43:00','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',0x01,0x00,'2018-03-26 11:04:10','aaaaaaa','aa@a','9999999999',91,1,10), (49,'dczxcv','','2018-03-26 10:45:21','aaaaa',0x01,0x00,'2018-03-26 10:45:21','sdfa','ladfhfghhasonucacs@gmail.com','8471830376',7,1,1), (50,'Oxygen Business Park','Sector-144, Noida','2018-03-26 10:43:43','Vaibhav',0x01,0x00,'2018-03-28 14:18:03','Bisht','vbisht164@gmail.com','9634974807',10,1,1); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (51,'aaaaa','','2018-03-26 10:43:47','shreya',0x00,0x00,'2018-03-29 10:46:20','garg','shreya@gmail.com','6666666666',4,1,2), (52,'ghj','hhj','2018-03-26 10:44:50','tarun',0x01,0x00,'2018-03-26 10:44:50','sethia','tarun@gmail.com','9999517545',51,1,6), (53,'asdasd','','2018-03-26 10:46:11','ad',0x01,0x00,'2018-03-26 10:46:11','ad','ad@gmail','9999999999',63,1,7), (54,'oo','oo','2018-03-26 10:46:24','Pallavi',0x00,0x01,'2018-03-26 10:46:24','Mandal','pallavimandal11@gmail.com','9654104464',97,1,10), (57,'1 1 1','111111','2018-03-26 11:32:41','vikas',0x01,0x00,'2018-03-28 16:20:22','yadav','vyad@gmail.com','1234567899',61,1,7), (58,'dsadas','sadas','2018-03-26 11:32:53','ad',0x01,0x00,'2018-03-26 11:32:53','ad','sd@g','9999999999',83,1,9), (59,'abc','xyz','2018-03-26 12:10:31','prateek',0x01,0x01,'2018-03-26 12:10:31','garg','asd@asd','1234567892',4,1,2), (60,'dadssad','','2018-03-26 12:35:37','aa',0x01,0x00,'2018-03-26 16:05:27','aa','adi@gmail','1111111111',24,1,2); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (61,'noida','','2018-03-26 14:00:44','Sallu',0x00,0x00,'2018-03-26 14:00:44','Salal','sagarsalal1234512341@gmail.com','9685741235',11,1,1), (62,'hqwkhd','jljhioyhi','2018-03-26 14:22:54','Shivani',0x00,0x00,'2018-03-26 14:22:54','Tanuja','sjhsyu@klyui','9999999999',87,1,9), (63,'Line','','2018-03-26 14:35:19','Mr X',0x01,0x00,'2018-03-26 14:35:19','Mr Y','testyahoo@com','1234567890',7,1,1), (64,'12','12','2018-03-26 15:00:20','a',0x01,0x00,'2018-04-02 15:12:46','a','v@gmail.com','1234567897',63,1,7), (65,'22','2','2018-03-26 15:01:59','v',0x01,0x00,'2018-03-26 15:01:59','v','vv@gmail.com','1234567896',89,1,9), (66,'1','1','2018-03-26 15:03:56','v',0x01,0x00,'2018-03-26 15:03:56','v','vvv@gmail.com','9874563211',24,1,2), (67,'12','12','2018-03-26 15:05:18','v',0x01,0x00,'2018-03-26 15:05:18','v','cc@gmail.com','1234567896',97,1,10), (68,'a','','2018-03-26 16:16:59','a',0x01,0x00,'2018-03-26 20:21:00','a','aa@aa','9999999999',28,1,2); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (69,'wqqe','qwe','2018-03-26 16:54:55','Sapient Digitas',0x01,0x00,'2018-03-26 16:54:55','Razorfish','test$1@yaho.123','9876543210',79,1,8), (70,'Prahallad Pur','','2018-03-26 17:13:58','R',0x01,0x00,'2018-03-26 17:13:58','K','rk@gmail.com','7428453409',48,1,5), (71,'abcdefghijklmnopqrstuvwxyz1','','2018-03-26 19:43:47','a',0x01,0x00,'2018-03-26 19:43:47','a','abcdefghijklmnopqrstuvwxyz1@a','111111111111111',60,1,6), (72,'','','2018-03-26 19:48:35','',0x01,0x00,'2018-03-26 19:48:35','','aa@aaa','1111111111',40,1,4), (77,'patiala','','2018-03-27 11:08:43','abha',0x00,0x00,'2018-04-06 11:06:01','nayyar','abhan95@gmail.com','9779558810',49,1,5), (78,'fdggs','','2018-03-27 12:07:06','a',0x01,0x00,'2018-03-27 12:07:06','A','a@g','9999999999',65,1,7), (79,'pp','','2018-03-27 13:54:05','Prachi',0x00,0x00,'2018-03-27 13:54:05','Thapliyal','prachi@gmail.com','9999999999',22,1,2), (80,'Paghds','','2018-03-27 14:53:05','Prachi',0x00,0x00,'2018-03-29 14:36:50','Thapliyal','prachithapliyal@gmail.com','9191991918',92,1,10); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (81,'praf','','2018-03-27 15:13:55','Prachi',0x00,0x00,'2018-03-27 15:13:55','Thapliyal','prachit@gmail.com','1111111111',51,1,6), (82,'awrfmsdr;gef','','2018-03-27 17:11:23','zsdfvjn',0x01,0x00,'2018-03-27 17:11:23','jcvnskv','kesjh@gma.fgvf','1231231234',22,1,2), (83,'Flat-201, Plot-93, Mauji Colony, Malviya Nagar, Jaipur-302017','','2018-03-28 08:50:24','Khushi',0x00,0x00,'2018-04-03 11:50:46','Sharma','khushisharma.email@gmail.com','9929978406',85,1,9), (84,'Flat-201, Plot-93, Mauji Colony, Malviya Nagar, Jaipur-302017','','2018-03-28 09:06:49','Khushi',0x00,0x00,'2018-03-28 09:06:49','Sharma','khushisharma1.email@gmail.com','9929978406',90,1,9), (85,'123rtnhngb','','2018-03-28 09:21:43','aditi',0x00,0x00,'2018-03-28 09:21:43','madaan','aditi@gmail.com','9874563210',87,1,9), (86,'','','2018-03-28 09:52:46','vikas',0x01,0x00,'2018-03-28 09:52:46','v','v1@gmail.com','9720857857',75,1,8), (87,'dsfds','','2018-03-28 09:57:10','aa',0x01,0x00,'2018-03-29 15:01:14','aa','ak@gmail.com','9999999999',16,1,3); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (88,'1','','2018-03-28 09:58:53','c',0x01,0x00,'2018-03-28 09:58:53','vbn','v@gmail.v kkkkk','9720857857',12,1,1), (89,'noida','','2018-03-28 09:59:58','sunaina',0x00,0x00,'2018-03-28 09:59:58','srivastava','srivastavasunaina8@gmail.com','1234567891',6,1,1), (90,'DCGRBDBN H','','2018-03-28 10:09:16','bhavana',0x00,0x00,'2018-03-28 10:09:16','singh','srivastavasunaina@gmail.com','1234567897',63,1,7), (91,'abc','','2018-03-28 10:12:59','Prachii',0x00,0x00,'2018-03-28 10:12:59','Thapliyal','prachip@gmail.com','9764319764',92,1,10), (92,'fchg','','2018-03-28 10:20:55','Prachi',0x00,0x00,'2018-04-02 15:32:33','thapliyal','prachii@gmail.com','9797979797',70,1,7), (93,'line1','line2','2018-03-28 10:31:37','akshat',0x01,0x00,'2018-03-28 10:31:37','jain','ajain@gmail.com','1234567890',63,1,7), (94,'','','2018-03-28 10:54:35','q',0x01,0x00,'2018-03-28 10:54:35','q','DC1@abc.im .sdoa.dad','9999999999',18,1,3); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (95,'','','2018-03-28 10:55:50','q',0x01,0x00,'2018-03-28 10:55:50','q','ad@gmail.com .fsd.fds.fdsf.','9999999999',3,1,2), (96,'','','2018-03-28 10:57:24','ad',0x01,0x00,'2018-03-28 10:57:24','ad','aa@aaa.com','9999999999',36,1,4), (97,'','','2018-03-28 12:48:59','q',0x00,0x00,'2018-03-28 12:48:59','q','aa@aaaa.d dsalasd.asd.d.s.d.ddasd','9999999999',24,1,2), (98,'line1','line2','2018-03-28 13:24:25','Reema',0x00,0x00,'2018-03-28 13:24:25','Singla','r@gmail.com','1234567890',15,1,3), (99,'dehradun','','2018-03-28 14:21:41','vb',0x01,0x00,'2018-04-06 14:18:23','b','vb@g.co','1111111879',10,1,1), (100,'Dehradun','','2018-03-28 14:32:59','vb',0x01,0x00,'2018-03-28 14:32:59','v','vb@g.c','1148486468',75,1,8), (101,'hdkjsbv','','2018-03-28 15:07:44','prachi',0x00,0x00,'2018-03-28 15:08:15','thapliyal','pra@gmail.com','9764312649',26,1,3), (102,'','','2018-03-28 15:58:43','q',0x01,0x00,'2018-03-28 15:58:43','a','aa@aaa.d dadas.ad.as.da','9999999999',89,1,9); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (103,'','','2018-03-28 15:59:41','ad',0x01,0x00,'2018-03-28 15:59:41','q','ad@gmail.com dshds.fs','9999999999',32,1,4), (104,'','','2018-03-28 16:00:56','aa',0x01,0x00,'2018-03-28 16:00:56','asa','addd@g.com','9999999999',13,1,1), (105,'','','2018-03-28 16:01:53','q',0x01,0x00,'2018-03-28 16:01:53','q','a@gmail.com bashjgas.asdasd','9999999999',31,1,4), (106,'','','2018-03-28 16:02:50','q',0x01,0x00,'2018-03-28 16:02:50','q','addddd@g.com','9999999999',83,1,9), (108,'asdsd','','2018-03-29 10:31:00','q',0x01,0x00,'2018-03-29 10:31:00','q','df@gmail.com','9999999999',92,1,10), (109,'fghtyuyu','','2018-03-29 10:41:50','q',0x01,0x00,'2018-03-29 10:41:50','q','adk@gmail.com','9999999999',72,1,8), (110,'yhyturd','','2018-03-29 10:46:38','q',0x01,0x00,'2018-03-29 10:46:38','q','adddddd@g.com','9999999999',17,1,3), (111,'ddddddddddddddddddddddd','dddddddddd','2018-03-29 12:21:35','ss',0x01,0x00,'2018-03-29 12:27:47','ss','aa@gmail.com','7777777777',44,1,5); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (112,'aassad','','2018-03-29 13:59:11','q',0x01,0x00,'2018-03-29 13:59:11','q','adj@gmail.com','9999999999',94,1,10), (113,'patiala','','2018-03-29 14:47:12','abha',0x00,0x00,'2018-03-29 14:47:12','nayyar','anayyar8@sapient.com','7889240257',29,1,2), (114,'Dehradun','','2018-03-29 22:50:49','CKNCKN',0x00,0x00,'2018-03-29 22:50:49','CDC','a@b.c1','1111111111',91,1,10), (115,'line1','','2018-03-29 23:17:33','prakhar',0x01,0x00,'2018-03-29 23:17:33','aggarwal','xedro@gmail.com','1234567890',66,1,7), (116,'12,salaka','','2018-04-02 14:14:08','sakshi',0x00,0x00,'2018-04-02 14:14:08','khanwani','sakshikhanwani.sk@gmail.com','9780886317',31,1,4), (117,'House no 3 Vikas nagar','USA','2018-04-02 15:19:03','vikas',0x01,0x00,'2018-04-02 15:20:29','yadav','cse.vikasyadav@gmail.com','9720857855',71,1,8), (119,'geu 3','','2018-04-02 16:16:46','Swati',0x00,0x00,'2018-04-02 16:16:46','Thapliyal','swati@gmail.com','9764649764',25,1,2); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (120,'line1','line2','2018-04-03 09:32:28','akshat',0x01,0x00,'2018-04-03 09:32:28','jain','ajain@gmail.coma','1234567890',22,1,2), (121,'Minnesota','','2018-04-03 09:40:39','Aditi',0x00,0x00,'2018-04-03 09:40:39','Madaan','aditimadaan0302@gmail.com','9876055760',99,1,10), (122,'abcde','abcde','2018-04-03 10:48:06','khushi',0x01,0x00,'2018-04-03 10:48:06','sharma','khullar2201@gmail.com','9929978405',100,1,10), (123,'aaaaa','','2018-04-03 15:46:34','ab',0x01,0x00,'2018-04-03 15:46:34','a','a@b.c13','9690344359',11,1,1), (125,'aaaaaa','aaaa','2018-04-03 18:02:21','aa',0x01,0x00,'2018-04-03 18:02:21','aa','1111@gmail.com','9999999999',84,1,9), (126,'sjkdbhwbs','sjkldfhlik','2018-04-03 18:03:50','Tarun',0x01,0x00,'2018-04-03 18:03:50','Garg','tgarg9@sapient.com','9803973125',34,1,4), (132,'dehradun','','2018-04-04 09:36:23','vishal',0x01,0x00,'2018-04-04 09:36:23','sanserwal','vsanserwal@sapient.com','1234567890',55,1,6); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (133,'sector 144','','2018-04-04 09:48:21','keshav',0x01,0x00,'2018-04-04 09:48:21','ladha','kladha@sapient.com','9876543210',85,1,9), (135,'Race Course','','2018-04-04 10:08:52','Ashutosh',0x01,0x01,'2018-04-04 10:08:52','S','ashutosh.18@aol.com','9872491881',4,1,2), (137,'fddcvf','','2018-04-04 10:17:08','Vishal',0x01,0x00,'2018-04-06 13:46:23','sanserwal','amadaan2@sapient.com','9874563210',98,1,10), (138,'gehu bell','','2018-04-04 11:23:24','Prachi',0x00,0x00,'2018-04-04 11:23:24','Thapliyal','prachithapliyal11@gmail.com','9746316497',60,1,6), (139,'Flat-201, Plot-93, Mauji Colony, Malviya Nagar, Jaipur-302017','','2018-04-04 12:40:59','Khushi',0x00,0x00,'2018-04-04 12:40:59','Sharma','ksharma61@sapient.com','9929978406',94,1,10), (140,'','','2018-04-04 13:56:45','a',0x01,0x00,'2018-04-04 13:56:45','a','ass@ads.ads','1111111111',45,1,5), (141,'Sector 21, Gurgaon','','2018-04-04 14:07:21','Tarun',0x01,0x00,'2018-04-04 14:07:21','Sethia','tarunjainsethia@gmail.com','9761912219',35,1,4); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (143,'abc tata','','2018-04-04 14:24:35','q',0x01,0x00,'2018-04-04 14:24:35','q','sidrox061@gmail.com','8587937925',23,1,2), (144,'jh hg','','2018-04-04 14:26:44','q',0x01,0x00,'2018-04-04 14:26:44','q','pallavimandal151@gmail.com','7894561230',47,1,5), (145,'uytgy','','2018-04-04 14:28:27','sid',0x01,0x00,'2018-04-04 14:28:27','das','hgu@hg.m','1239954785',96,1,10), (146,'uas ad','','2018-04-04 14:36:28','q',0x01,0x00,'2018-04-04 14:36:28','q','sid06@gmail.com','7894561230',33,1,4), (147,'Mohan Nagar','','2018-04-04 14:42:56','sid',0x01,0x00,'2018-04-04 14:42:56','sid','sid@gmail.com','8587937925',62,1,7), (148,'aaaaaa','','2018-04-04 14:47:17','Siddhart',0x01,0x00,'2018-04-06 13:25:35','Gupta','sidrox06@gmail.com','8587937925',63,1,7), (149,'jhfgjh','','2018-04-04 14:54:00','v',0x00,0x00,'2018-04-04 14:54:00','q','a@b.co','1234567890',57,1,6), (150,'ABCXH','','2018-04-04 14:56:40','Prachi',0x00,0x00,'2018-04-04 14:56:40','T','prachithapliyal1@gmail.com','9760645645',11,1,1); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (151,'kjgjk','','2018-04-04 15:00:31','vvvvv',0x00,0x00,'2018-04-04 15:00:31','sdfgsdfg dfgdfg','a@b.com','2222222222',59,1,6), (152,'t67utyuhj','','2018-04-04 14:58:18','kladha',0x01,0x00,'2018-04-04 14:58:18','adf','keshav1314057@gmail.com','8989898989',25,1,2), (153,'cvcbcv','','2018-04-04 14:58:40','Prachi',0x00,0x00,'2018-04-04 14:58:40','Thapliyal','pthapliyal@sapient.co','9764326549',91,1,10), (154,'Gurgaon','','2018-04-04 15:43:25','Abhi',0x01,0x00,'2018-04-04 15:43:25','Sharma','sumathur@sapient.com','9997913959',62,1,7), (155,'House no. 156, Gate no. 2, Sector-82','Swarnim Vihar','2018-04-05 11:00:24','Ranjan',0x01,0x00,'2018-04-05 11:00:24','Rajveer','rajranjan267@gmail.com','8084627612',64,1,7), (156,'jhjhg','','2018-04-05 14:38:35','vishal',0x01,0x00,'2018-04-05 14:38:35','san','a@ss.cc','8755411742',34,1,4), (158,'22 jump street','Vibhav','2018-04-05 15:25:19','mehran',0x01,0x00,'2018-04-05 15:25:19','ahmed','mahmed8@sapient.com','8439420375',3,1,2); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (159,'bnbv','','2018-04-06 10:25:46','Prachi',0x00,0x00,'2018-04-06 10:25:46','Thapliyal','pr@gmail.com','9779797999',40,1,4), (160,'gurgoan','','2018-04-06 12:03:25','srishti',0x00,0x00,'2018-04-06 12:03:25','Garg','sgar48@sapient.com','9899092675',14,1,3), (161,'qwerrouhy rnfweuohfounf','','2018-04-06 16:57:47','ashu',0x01,0x00,'2018-04-06 16:57:47','singh','ashu491881@gmail.com','9879879875',16,1,3), (162,'H.No. C-11, Krishna Park','','2018-04-06 16:59:26','Prateek',0x01,0x00,'2018-04-06 16:59:26','Alakh','palakh@sapient.com','9690341607',6,1,1), (163,'123421','ue 2','2018-04-06 17:01:31','Prateek',0x01,0x01,'2018-04-06 17:01:31','Garg','shadyprateek@gmail.com','7788552233',41,1,5), (164,'11323','abc','2018-04-06 17:15:52','Prateek',0x01,0x00,'2018-04-06 17:15:52','Garg','shadyinfi@gmail.com','8877445566',74,1,8), (165,'Gurgoan','','2018-04-09 12:04:24','riya',0x00,0x00,'2018-04-09 12:04:24','sharma','pallavi.14bcs1150@abes.ac.in','8723096757',42,1,5); INSERT INTO `users` (`user_id`,`address_line1`,`address_line2`,`created_date`,`first_name`,`gender`,`is_admin`,`last_modified_date`,`last_name`,`mail`,`mobile`,`city_id`,`country_id`,`state_id`) VALUES (166,'sector 50','','2018-04-09 14:51:20','sagar',0x01,0x00,'2018-04-09 14:51:20','salal','ssalal@sapient.com','9690344359',6,1,1), (167,'abcde','','2018-04-09 14:55:30','Sagar',0x01,0x00,'2018-04-09 14:55:30','Salal','sagar@sapient.com','9690344359',72,1,8); /*!40000 ALTER TABLE `users` ENABLE KEYS */; -- -- Definition of table `wish_items` -- DROP TABLE IF EXISTS `wish_items`; CREATE TABLE `wish_items` ( `wish_item_id` bigint(20) NOT NULL AUTO_INCREMENT, `isbn` varchar(255) DEFAULT NULL, `wish_list_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`wish_item_id`), KEY `FKrs6352a2o6qe1h0gudse3s4go` (`isbn`), KEY `FK7sdq9tkdebpjdwpoq48ok83gu` (`wish_list_id`), CONSTRAINT `FK7sdq9tkdebpjdwpoq48ok83gu` FOREIGN KEY (`wish_list_id`) REFERENCES `wish_list` (`wish_list_id`), CONSTRAINT `FKrs6352a2o6qe1h0gudse3s4go` FOREIGN KEY (`isbn`) REFERENCES `books` (`isbn`) ) ENGINE=InnoDB AUTO_INCREMENT=485 DEFAULT CHARSET=latin1; -- -- Dumping data for table `wish_items` -- /*!40000 ALTER TABLE `wish_items` DISABLE KEYS */; INSERT INTO `wish_items` (`wish_item_id`,`isbn`,`wish_list_id`) VALUES (38,'3620000000000',11), (53,'3620000000000',16), (54,'2220000000000',16), (78,'3620000000000',18), (80,'9110000000000',18), (82,'3620000000000',19), (85,'3620000000000',20), (86,'9110000000000',20), (141,'9782000000000',18), (182,'5560000000000',5), (205,'2220000000000',14), (211,'9470000000000',10), (226,'2220000000000',4), (227,'9110000000000',10), (239,'9220000000000',22), (240,'9220000000000',4), (241,'9220000000000',19), (246,'9630000000000',23), (252,'9639000000000',10), (253,'9880000000000',10), (259,'9150000000000',19), (282,'9360000000000',7), (283,'9360000000000',9), (285,'9782000000000',30), (286,'9780000000000',7), (287,'9470000000000',7), (288,'9782000000000',7), (289,'2220000000000',7), (290,'9880000000000',7), (291,'9639000000000',7), (292,'9220000000000',7), (293,'9560000000000',7), (294,'9580000000000',7), (296,'9960000000000',31), (307,'9470000000000',5), (308,'9880000000000',5), (309,'2220000000000',5); INSERT INTO `wish_items` (`wish_item_id`,`isbn`,`wish_list_id`) VALUES (310,'9960000000000',5), (311,'9638000000000',5), (314,'123',7), (317,'9782000000000',27), (319,'9880000000000',33), (320,'9639000000000',33), (325,'5454000000000',27), (335,'9210000000000',35), (336,'2220000000000',35), (337,'3620000000000',35), (338,'9788177091878',35), (340,'9960000000000',24), (350,'2220000000000',32), (361,'1170000000000',40), (364,'9220000000000',41), (365,'2220000000000',41), (366,'9638000000000',41), (367,'9360000000000',41), (368,'9630000000000',41), (369,'9639000000000',41), (371,'9470000000000',41), (372,'9560000000000',41), (373,'9781473647770',41), (374,'3620000000000',41), (375,'5454000000000',41), (376,'9110000000000',41), (377,'2220000000000',42), (378,'9729000000000',42), (379,'9360000000000',42), (380,'3620000000000',42), (381,'9220000000000',42), (382,'9960000000000',42), (383,'9150000000000',42), (384,'5454000000000',42), (386,'9700000000000',42), (387,'9782000000000',42); INSERT INTO `wish_items` (`wish_item_id`,`isbn`,`wish_list_id`) VALUES (400,'9639000000000',32), (404,'9880000000000',46), (410,'1170000000000',32), (428,'9580000000000',47), (429,'1170000000000',46), (430,'9880000000000',32), (431,'9781473647770',48), (433,'3620000000000',49), (449,'9360000000000',36), (451,'3620000000000',43), (452,'9780000000067',43), (453,'9639000000000',43), (455,'787700000000',43), (456,'9350000000000',32), (457,'5560000000000',43), (464,'3620000000000',50), (470,'3620000000000',51), (471,'9780141359151',32), (472,'3620000000000',44), (474,'9820000000000',52), (475,'9820000000000',22), (476,'7777777777777',38), (477,'9960000000000',38), (478,'9781473647770',38), (482,'3216540000',44), (483,'2220000000000',44), (484,'0132335530000',51); /*!40000 ALTER TABLE `wish_items` ENABLE KEYS */; -- -- Definition of table `wish_list` -- DROP TABLE IF EXISTS `wish_list`; CREATE TABLE `wish_list` ( `wish_list_id` bigint(20) NOT NULL AUTO_INCREMENT, `created_date` datetime DEFAULT NULL, `last_modified_date` datetime DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`wish_list_id`), KEY `FKit8ap20bpapw291y78egje6f3` (`user_id`), CONSTRAINT `FKit8ap20bpapw291y78egje6f3` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=latin1; -- -- Dumping data for table `wish_list` -- /*!40000 ALTER TABLE `wish_list` DISABLE KEYS */; INSERT INTO `wish_list` (`wish_list_id`,`created_date`,`last_modified_date`,`user_id`) VALUES (4,'2018-03-24 13:02:02','2018-03-24 13:02:02',2), (5,'2018-03-24 18:28:07','2018-03-24 18:28:07',38), (6,'2018-03-26 09:19:41','2018-03-26 09:19:41',26), (7,'2018-03-26 09:20:56','2018-03-26 09:20:56',41), (8,'2018-03-26 09:21:29','2018-03-26 09:21:29',19), (9,'2018-03-26 09:53:42','2018-03-26 09:53:42',42), (10,'2018-03-26 11:01:14','2018-03-26 11:01:14',54), (11,'2018-03-26 11:21:54','2018-03-26 11:21:54',48), (12,'2018-03-26 11:23:19','2018-03-26 11:23:19',51), (13,'2018-03-26 11:32:53','2018-03-26 11:32:53',57), (14,'2018-03-26 12:13:26','2018-03-26 12:13:26',59), (15,'2018-03-26 14:13:59','2018-03-26 14:13:59',60), (16,'2018-03-26 14:23:12','2018-03-26 14:23:12',62), (17,'2018-03-26 16:02:35','2018-03-26 16:02:35',64), (18,'2018-03-26 16:17:56','2018-03-26 16:17:56',68), (19,'2018-03-26 16:43:06','2018-03-26 16:43:06',3), (20,'2018-03-26 17:15:46','2018-03-26 17:15:46',70), (21,'2018-03-27 13:10:57','2018-03-27 13:10:57',NULL); INSERT INTO `wish_list` (`wish_list_id`,`created_date`,`last_modified_date`,`user_id`) VALUES (22,'2018-03-27 13:11:01','2018-03-27 13:11:01',1), (23,'2018-03-27 14:23:24','2018-03-27 14:23:24',79), (24,'2018-03-27 14:57:22','2018-03-27 14:57:22',77), (25,'2018-03-28 10:03:28','2018-03-28 10:03:28',89), (26,'2018-03-28 10:11:18','2018-03-28 10:11:18',90), (27,'2018-03-28 10:37:27','2018-03-28 10:37:27',92), (28,'2018-03-28 12:27:20','2018-03-28 12:27:20',50), (29,'2018-03-28 15:05:32','2018-03-28 15:05:32',87), (30,'2018-03-28 16:09:40','2018-03-28 16:09:40',80), (31,'2018-03-29 12:46:52','2018-03-29 12:46:52',111), (32,'2018-03-29 12:57:00','2018-03-29 12:57:00',99), (33,'2018-04-02 15:22:06','2018-04-02 15:22:06',117), (34,'2018-04-03 10:42:27','2018-04-03 10:42:27',120), (35,'2018-04-03 11:49:29','2018-04-03 11:49:29',83), (36,'2018-04-03 17:41:30','2018-04-03 17:41:30',5), (37,'2018-04-04 11:48:42','2018-04-04 11:48:42',49), (38,'2018-04-04 14:49:40','2018-04-04 14:49:40',148), (39,'2018-04-04 15:02:38','2018-04-04 15:02:38',145); INSERT INTO `wish_list` (`wish_list_id`,`created_date`,`last_modified_date`,`user_id`) VALUES (40,'2018-04-05 11:01:45','2018-04-05 11:01:45',155), (41,'2018-04-05 11:30:54','2018-04-05 11:30:54',133), (42,'2018-04-05 13:48:55','2018-04-05 13:48:55',151), (43,'2018-04-05 16:48:32','2018-04-05 16:48:32',137), (44,'2018-04-06 09:53:56','2018-04-06 09:53:56',141), (45,'2018-04-06 10:19:30','2018-04-06 10:19:30',121), (46,'2018-04-06 10:26:21','2018-04-06 10:26:21',159), (47,'2018-04-06 12:09:38','2018-04-06 12:09:38',160), (48,'2018-04-06 16:59:42','2018-04-06 16:59:42',161), (49,'2018-04-06 17:17:24','2018-04-06 17:17:24',162), (50,'2018-04-09 10:32:58','2018-04-09 10:32:58',10), (51,'2018-04-09 12:06:04','2018-04-09 12:06:04',165), (52,'2018-04-09 14:08:36','2018-04-09 14:08:36',149), (53,'2018-04-09 14:08:45','2018-04-09 14:08:45',NULL); /*!40000 ALTER TABLE `wish_list` ENABLE KEYS */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
true
b5c1824ce98b035c137c27e2e74dd632b39946d8
SQL
THE-STUDNET/twic-api
/data/db/251-upt-abo.sql
UTF-8
575
3.546875
4
[ "MIT" ]
permissive
SET foreign_key_checks = 0; truncate subscription; DELETE FROM `contact` WHERE deleted = 0 and accepted = 0 and requested = 0; SET foreign_key_checks = 1; INSERT IGNORE INTO `subscription` (`user_id`, `libelle`,`created_date`) SELECT * FROM (SELECT user_id, CONCAT('PP',page_id) libelle, UTC_TIMESTAMP created_date FROM page_user WHERE state='member' UNION SELECT user_id, CONCAT('PU',contact_id) libelle, UTC_TIMESTAMP created_date FROM contact WHERE accepted_date IS NOT NULL UNION SELECT id user_id, CONCAT('SU',id) libelle, UTC_TIMESTAMP created_date FROM user ) as T;
true
a28077a9c7c8ec648286f125b8e8b1411c40c5e8
SQL
taylorak/Has-Many-Relationships
/joins.sql
UTF-8
2,800
3.578125
4
[]
no_license
-- 1 -- SELECT * -- FROM users; -- 2 -- SELECT * -- FROM posts -- WHERE user_id = 100; -- 3 -- SELECT posts.*, users.first_name, users.last_name -- FROM posts -- JOIN users -- ON posts.user_id = users.id -- WHERE users.id = 200; -- 4 -- SELECT posts.*, users.username -- FROM posts -- JOIN users -- ON posts.user_id = users.id -- WHERE users.first_name = 'Norene' AND users.last_name = 'Schmitt'; -- 5 -- SELECT users.username -- FROM users -- JOIN posts -- ON users.id = posts.user_id -- WHERE posts.created_at > '2015-1-1'; -- 6 -- SELECT posts.title, posts.content, users.username -- FROM posts -- JOIN users -- ON posts.user_id = users.id -- WHERE users.created_at > '2015-1-1'; --7 -- SELECT posts.title AS post_title, comments.* -- FROM comments -- JOIN posts -- ON comments.post_id = posts.id; -- 8 -- SELECT posts.title AS post_title, posts.url AS post_url, comments.body AS comment_body -- FROM posts -- JOIN comments -- ON comments.post_id = posts.id -- WHERE posts.created_at < '2015-1-1'; -- 9 -- SELECT posts.title AS post_title, posts.url AS post_url, comments.body AS comment_body -- FROM posts -- JOIN comments -- ON comments.post_id = posts.id -- WHERE posts.created_at > '2015-1-1'; -- 10 -- SELECT posts.title AS post_title, posts.url AS post_url, comments.body AS comment_body -- FROM posts -- JOIN comments -- ON comments.post_id = posts.id -- WHERE comments.body LIKE '%USB%'; -- 11 -- SELECT posts.title AS post_title, users.first_name, users.last_name, comments.body AS comment_body -- FROM posts -- JOIN users -- ON posts.user_id = users.id -- JOIN comments -- ON comments.post_id = posts.id -- WHERE comments.body LIKE '%matrix%'; -- 12 -- SELECT users.first_name, users.last_name, comments.body AS comment_body -- FROM posts -- JOIN users -- ON posts.user_id = users.id -- JOIN comments -- ON comments.post_id = posts.id -- WHERE comments.body LIKE '%SSL%' AND posts.content LIKE '%dolorum%'; -- 13 -- SELECT users.first_name AS post_author_first_name, users.last_name AS post_author_last_name, posts.title AS post_title, users.username AS comment_author_username, comments.body AS comment_body -- FROM posts -- JOIN users -- ON posts.user_id = users.id -- JOIN comments -- ON comments.post_id = posts.id -- WHERE (comments.body LIKE '%SSL%' OR comments.body LIKE '%firewall%') AND posts.content LIKE '%nemo%'; -- 1 -- SELECT posts.id, posts.title, posts.user_id -- FROM posts -- JOIN comments -- ON comments.post_id = posts.id -- WHERE posts.user_id = comments.user_id; -- 2 -- SELECT COUNT(comments.*) -- FROM posts -- JOIN comments -- ON comments.post_id = posts.id -- WHERE posts.created_at > '2015-7-14'; -- 3 -- SELECT COUNT(users.username) -- FROM users -- JOIN comments -- ON comments.user_id = users.id -- WHERE comments.body LIKE '%programming%';
true
c84d6ddcbf69493861e84bcc77f4e0c401124f06
SQL
KMtheStarter/bit_spring
/board.sql
UTF-8
383
3.046875
3
[]
no_license
create table t_board( no number(5) primary key, title varchar2(200) not null, writer varchar2(100) not null, content varchar2(2000), view_cnt number(5) default 0, reg_date date default sysdate ); create sequence seq_t_board_no nocache; select * from t_board; insert into t_board(no, title, content, writer) values(4, 'aaaaa', 'bbbbb', 'ccccc'); commit;
true
8a63b8c5203c01e32cf3ebd90a18b8a34b585a4a
SQL
skyblue777/Yii-project
/public_html/database/setup.sql
UTF-8
9,977
3.515625
4
[]
no_license
DROP TABLE IF EXISTS `ann_favorites`; CREATE TABLE `ann_favorites` ( `user_id` int(11) NOT NULL, `annonce_id` int(5) NOT NULL, PRIMARY KEY (`user_id`,`annonce_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Table structure for table `annonce` */ DROP TABLE IF EXISTS `annonce`; CREATE TABLE `annonce` ( `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) NOT NULL, `type` char(1) CHARACTER SET utf8 NOT NULL, `title` varchar(150) CHARACTER SET utf8 NOT NULL, `price` int(12) NOT NULL, `opt_price` char(1) CHARACTER SET utf8 NOT NULL, `description` text CHARACTER SET utf8 NOT NULL, `description_notag` text CHARACTER SET utf8, `email` varchar(100) CHARACTER SET utf8 NOT NULL, `area` varchar(200) CHARACTER SET utf8 DEFAULT NULL, `zipcode` varchar(10) COLLATE utf8_bin DEFAULT NULL, `lat` float NOT NULL DEFAULT '0', `lng` float NOT NULL DEFAULT '0', `photos` text COLLATE utf8_bin, `video` text CHARACTER SET utf8, `viewed` int(11) NOT NULL DEFAULT '0', `replied` int(11) NOT NULL DEFAULT '0', `code` varchar(50) CHARACTER SET utf8 DEFAULT NULL, `public` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0', `featured` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0', `feature_status` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0', `feature_days` int(3) NOT NULL DEFAULT '0', `feature_total` float NOT NULL DEFAULT '0', `feature_mdp` varchar(5) CHARACTER SET utf8 NOT NULL, `feature_txn` text CHARACTER SET utf8 NOT NULL, `date` datetime NOT NULL, `evt` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0', `create_time` datetime NOT NULL, `txn_id` text CHARACTER SET utf8 NOT NULL, `update_time` datetime NOT NULL, `send` tinyint(3) unsigned NOT NULL DEFAULT '0', `homepage` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0', `homepage_status` char(1) CHARACTER SET utf8 NOT NULL DEFAULT '0', `homepage_days` int(3) NOT NULL DEFAULT '0', `homepage_total` float NOT NULL DEFAULT '0', `homepage_mdp` varchar(5) CHARACTER SET utf8 NOT NULL, `homepage_txn` text CHARACTER SET utf8 NOT NULL, `for_import` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `type` (`type`,`title`,`price`,`email`), KEY `opt_price` (`opt_price`), KEY `id_cat` (`category_id`), KEY `date` (`date`), KEY `date0` (`create_time`,`update_time`), KEY `evt` (`evt`), FULLTEXT KEY `NewIndex1` (`title`,`description`), FULLTEXT KEY `NewIndex2` (`title`), FULLTEXT KEY `NewIndex3` (`description`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; -- ---------------------------- -- Table structure for `article` -- ---------------------------- DROP TABLE IF EXISTS `article`; CREATE TABLE IF NOT EXISTS `article` ( `id` int(11) NOT NULL AUTO_INCREMENT, `lang` char(5) NOT NULL, `category_id` int(11) DEFAULT NULL, `title` varchar(512) NOT NULL, `alias` varchar(512) NOT NULL, `leading_text` text NOT NULL, `content` text, `photo` varchar(256) DEFAULT NULL, `tags` text, `status` int(11) NOT NULL, `create_time` int(11) DEFAULT NULL, `update_time` int(11) DEFAULT NULL, `author_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `FK_post_author` (`author_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*Table structure for table `article_tag` */ DROP TABLE IF EXISTS `article_tag`; CREATE TABLE `article_tag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `frequency` int(11) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Table structure for table `authitem` */ DROP TABLE IF EXISTS `AuthAssignment`; DROP TABLE IF EXISTS `AuthItemChild`; DROP TABLE IF EXISTS `AuthItem`; CREATE TABLE `AuthItem` ( `name` varchar(64) NOT NULL, `type` int(11) NOT NULL, `description` text, `bizrule` text, `data` text, PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC; /*Table structure for table `authassignment` */ CREATE TABLE `AuthAssignment` ( `itemname` varchar(64) NOT NULL, `userid` int(11) NOT NULL, `bizrule` text, `data` text, PRIMARY KEY (`itemname`,`userid`), CONSTRAINT `FK_authassignment` FOREIGN KEY (`itemname`) REFERENCES `AuthItem` (`name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC; /*Table structure for table `authitemchild` */ CREATE TABLE `AuthItemChild` ( `parent` varchar(64) NOT NULL, `child` varchar(64) NOT NULL, PRIMARY KEY (`parent`,`child`), KEY `FK_authitemchild_1` (`child`), CONSTRAINT `FK_authitemchild` FOREIGN KEY (`parent`) REFERENCES `AuthItem` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `FK_authitemchild_1` FOREIGN KEY (`child`) REFERENCES `AuthItem` (`name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC; /*Table structure for table `banner` */ DROP TABLE IF EXISTS `banner`; CREATE TABLE `banner` ( `id` int(11) NOT NULL AUTO_INCREMENT, `html` text NOT NULL, `category_id` int(11) NOT NULL DEFAULT '0', `position` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `unique_category` (`category_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `cache`; CREATE TABLE `cache` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT '', `expired` datetime DEFAULT NULL, `duration` tinyint(4) DEFAULT '-1', PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*Table structure for table `category` */ DROP TABLE IF EXISTS `category`; CREATE TABLE `category` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `alias` varchar(255) NOT NULL, `description` text, `image` varchar(255) DEFAULT NULL, `parent_id` bigint(20) DEFAULT '0', `is_active` tinyint(1) DEFAULT '1', `ordering` int(11) NOT NULL DEFAULT '0', `warning_page` tinyint(1) NOT NULL DEFAULT '0', `show_ad_counter` tinyint(1) NOT NULL DEFAULT '0', `price_required` tinyint(1) NOT NULL DEFAULT '0', `paid_ad_required` tinyint(1) NOT NULL DEFAULT '0', `show_banner` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `alias_unique` (`alias`,`parent_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Table structure for table `extension` */ DROP TABLE IF EXISTS `extension`; CREATE TABLE `extension` ( `id` int(11) NOT NULL AUTO_INCREMENT, `event` varchar(255) NOT NULL, `class` varchar(64) NOT NULL, `method` varchar(64) NOT NULL, `config` text, `enabled` smallint(6) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Table structure for table `gallery_list` */ DROP TABLE IF EXISTS `gallery_list`; CREATE TABLE `gallery_list` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `folder_path` varchar(255) NOT NULL, `thumb_width` smallint(6) NOT NULL, `thumb_height` smallint(6) NOT NULL, `created_date` datetime DEFAULT NULL, `alias` varchar(255) DEFAULT NULL, `images` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Table structure for table `lookup` */ DROP TABLE IF EXISTS `lookup`; CREATE TABLE `lookup` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `code` varchar(128) NOT NULL, `type` varchar(128) NOT NULL, `position` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Table structure for table `module` */ DROP TABLE IF EXISTS `module`; CREATE TABLE `module` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL, `friendly_name` varchar(255) DEFAULT NULL, `description` text, `version` varchar(64) DEFAULT NULL, `has_back_end` char(1) NOT NULL DEFAULT 'y', `ordering` int(11) DEFAULT NULL, `icon` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Table structure for table `setting` */ DROP TABLE IF EXISTS `setting`; CREATE TABLE `setting` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL, `label` varchar(64) DEFAULT NULL, `value` text NOT NULL, `description` text, `setting_group` varchar(128) DEFAULT NULL, `ordering` int(11) DEFAULT NULL, `visible` smallint(6) DEFAULT NULL, `module` varchar(64) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Table structure for table `language` */ DROP TABLE IF EXISTS `language`; CREATE TABLE `language` ( `id` int(11) NOT NULL AUTO_INCREMENT, `lang` char(10) CHARACTER SET utf8 NOT NULL, `code` varchar(128) CHARACTER SET utf8 NOT NULL, `value` varchar(512) CHARACTER SET utf8 NOT NULL, `group` char(10) NOT NULL, `module` char(64) CHARACTER SET utf8 NOT NULL, `type` char(64) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*Table structure for table `user` */ DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(64) NOT NULL, `password` varchar(32) NOT NULL, `email` varchar(64) DEFAULT NULL, `first_name` varchar(255) DEFAULT NULL, `last_name` varchar(255) DEFAULT NULL, `created_date` date DEFAULT NULL, `last_login` date DEFAULT NULL, `validation_code` varchar(64) DEFAULT NULL, `validation_type` smallint(6) DEFAULT NULL, `validation_expired` datetime DEFAULT NULL, `street` varchar(255) DEFAULT NULL, `zip` varchar(255) DEFAULT NULL, `city` varchar(255) DEFAULT NULL, `status` smallint(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Table structure for table `yii_cache` */ DROP TABLE IF EXISTS `yii_cache`; CREATE TABLE `yii_cache` ( `id` char(128) NOT NULL, `expire` int(11) DEFAULT NULL, `value` longblob, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
true
ee5425e4e53fbe8f9d9bb626e3e4983be4870ba7
SQL
unity-idm/furms
/furms-database-module/src/main/resources/db/migration/V8__community_allocation.sql
UTF-8
463
3.46875
3
[ "BSD-2-Clause" ]
permissive
/* * Copyright (c) 2020 Bixbit s.c. All rights reserved. * See LICENSE file for licensing information. */ CREATE TABLE community_allocation ( id UUID PRIMARY KEY NOT NULL, community_id UUID NOT NULL, resource_credit_id UUID NOT NULL, name VARCHAR(255) UNIQUE NOT NULL, amount DECIMAL NOT NULL, FOREIGN KEY (community_id) REFERENCES community(id), FOREIGN KEY (resource_credit_id) REFERENCES resource_credit(id) ON DELETE RESTRICT );
true
2e460e22d2d60384ac9901b109d4b061eb5fadf1
SQL
akheron/sqltyper
/tests/integration/cte-update.sql
UTF-8
633
3.421875
3
[]
no_license
--- setup ----------------------------------------------------------------- CREATE TABLE person ( id serial PRIMARY KEY, name varchar(255) NOT NULL, age integer ); --- query ----------------------------------------------------------------- WITH youngsters AS ( SELECT * FROM person WHERE age < ${maximumAge} ) UPDATE person SET name = y.name FROM youngsters y --- expected row count ---------------------------------------------------- zero --- expected column types ---------------------------------------------------- --- expected param types -------------------------------------------------- maximumAge: number
true
a6076b184af3ecb3713ba07f6c9ea58c8e495c8c
SQL
vk-hollay/JavaWeb
/EMS201824113330/web/db/EquipmentStorage.sql
UTF-8
997
3.484375
3
[]
no_license
CREATE DATABASE EquipmentStorage DEFAULT CHARSET utf8mb4; CREATE TABLE IF NOT EXISTS employee ( `id` CHAR(10) PRIMARY KEY, `password` VARCHAR(32) NOT NULL, `name` VARCHAR(50), `phone` CHAR(13), `usertype` CHAR(8), `department` VARCHAR(20) ) CREATE TABLE IF NOT EXISTS department ( `id` VARCHAR(20) PRIMARY KEY, `name` VARCHAR(50) NOT NULL, `manager` CHAR(10), FOREIGN KEY(`manager`) REFERENCES employee(`id`) ) ALTER TABLE employee ADD FOREIGN KEY(department) REFERENCES department(`id`); CREATE TABLE IF NOT EXISTS equipment ( `id` VARCHAR(30) PRIMARY KEY, `name` VARCHAR(50), `specification` VARCHAR(120), `price` DECIMAL(11, 2), `buydate` DATE, `position` VARCHAR(120), `img_path` VARCHAR(200), `manager` CHAR(10), FOREIGN KEY(`manager`) REFERENCES employee(`id`) ) SHOW COLUMNS FROM employee; SHOW COLUMNS FROM department; SHOW COLUMNS FROM equipment; SHOW CREATE TABLE employee; INSERT INTO department(`id`,`name`,`manager`) VALUES("101","财务部","152336");
true
ed0ba4f47d82934e7182b5eeb371f0f167763e2e
SQL
sarthak0415/mongo-routing
/psql_sample_queries.sql
UTF-8
353
2.578125
3
[]
no_license
#Postgres start server brew services start postgresql #Login psql <database_name> #create new db and connect CREATE DATABASE routing1; \connect routing1 #create extensions create extension postgis; create extension pgrouting; CREATE EXTENSION hstore; osm2pgrouting --f iiit_map.osm --conf mapconfig.xml --dbname routing --username sarthak --clean
true
cd64fd0531576ba9e84b33235a0625e054e85d26
SQL
xixi51/web
/docs/数据库脚本/文章增加类别字段.sql
UTF-8
246
2.59375
3
[]
no_license
alter table blog_details add column blog_category INT; alter table code_library add column code_category INT; --初始化为0,默认分类所有文章 UPDATE blog_details SET blog_category = 0; UPDATE code_library SET code_category = 0;
true
bfaa0642a53fdb82caba56b0ae8a0be33b2516a0
SQL
lukasklisevicius/egzaminas
/U2_Lukas_Kliševičius/egzamino_db.sql
UTF-8
28,485
3.078125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jun 22, 2021 at 09:12 AM -- Server version: 10.4.19-MariaDB -- PHP Version: 8.0.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `egzamino_db` -- -- -------------------------------------------------------- -- -- Table structure for table `komentarai` -- CREATE TABLE `komentarai` ( `id` int(11) NOT NULL, `kurso_id` int(11) NOT NULL, `komentaras` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `komentarai` -- INSERT INTO `komentarai` (`id`, `kurso_id`, `komentaras`) VALUES (1, 1, 'White Rabbit read out, at the top of her or of anything else. CHAPTER V. Advice from a bottle marked \'poison,\' so Alice soon came to the beginning again?\' Alice ventured to say. \'What is it?\' The.'), (2, 2, 'Mock Turtle recovered his voice, and, with tears again as quickly as she was near enough to look at the Mouse\'s tail; \'but why do you know about this business?\' the King had said that day. \'That.'), (3, 3, 'While the Owl had the dish as its share of the garden: the roses growing on it in a trembling voice:-- \'I passed by his face only, she would manage it. \'They must go by the way, was the cat.) \'I.'), (4, 4, 'The master was an immense length of neck, which seemed to be lost: away went Alice after it, never once considering how in the middle, nursing a baby; the cook was busily stirring the soup, and.'), (5, 5, 'Alice, \'they\'re sure to make out who was trembling down to them, and then they both cried. \'Wake up, Dormouse!\' And they pinched it on both sides at once. \'Give your evidence,\' the King.'), (6, 1, 'I grow up, I\'ll write one--but I\'m grown up now,\' she said, as politely as she could, and soon found an opportunity of saying to herself, and nibbled a little ledge of rock, and, as she spoke. \'I.'), (7, 2, 'Footman went on at last, with a T!\' said the Caterpillar. Alice said nothing: she had quite forgotten the little door was shut again, and made a snatch in the direction it pointed to, without trying.'), (8, 3, 'Between yourself and me.\' \'That\'s the reason they\'re called lessons,\' the Gryphon answered, very nearly carried it off. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \'What a pity it.'), (9, 4, 'Gryphon. \'It all came different!\' Alice replied very solemnly. Alice was more hopeless than ever: she sat down in a very little use without my shoulders. Oh, how I wish I hadn\'t drunk quite so.'), (10, 5, 'Queen never left off when they passed too close, and waving their forepaws to mark the time, while the rest waited in silence. Alice was rather doubtful whether she ought to go through next walking.'), (11, 1, 'YOU like cats if you could keep it to be found: all she could even make out exactly what they WILL do next! If they had a wink of sleep these three little sisters,\' the Dormouse crossed the court,.'), (12, 2, 'Lizard in head downwards, and the soldiers had to pinch it to make out who was reading the list of the wood--(she considered him to you, Though they were all talking at once, while all the rats.'), (13, 3, 'Alice, \'it would have made a dreadfully ugly child: but it did not like to be two people. \'But it\'s no use going back to yesterday, because I was thinking I should be raving mad--at least not so mad.'), (14, 4, 'She went on all the first sentence in her life before, and he wasn\'t going to be, from one end to the conclusion that it seemed quite dull and stupid for life to go nearer till she shook the house,.'), (15, 5, 'Queen\'s shrill cries to the beginning again?\' Alice ventured to ask. \'Suppose we change the subject of conversation. \'Are you--are you fond--of--of dogs?\' The Mouse did not dare to laugh; and, as.'), (16, 1, 'I can\'t tell you what year it is?\' \'Of course you know I\'m mad?\' said Alice. \'Why, you don\'t know one,\' said Alice. \'Oh, don\'t talk about her pet: \'Dinah\'s our cat. And she\'s such a curious plan!\'.'), (17, 2, 'White Rabbit as he spoke. \'UNimportant, of course, Alice could think of any good reason, and as it went, as if she were looking over his shoulder with some curiosity. \'What a number of.'), (18, 3, 'As she said these words her foot as far as they were all crowded round her once more, while the Dodo solemnly, rising to its feet, \'I move that the meeting adjourn, for the rest waited in silence..'), (19, 4, 'Alice asked. \'We called him a fish)--and rapped loudly at the Cat\'s head with great curiosity, and this Alice thought she had put the Dormouse went on, \'--likely to win, that it\'s hardly worth while.'), (20, 5, 'Majesty,\' the Hatter were having tea at it: a Dormouse was sitting next to no toys to play croquet with the bread-and-butter getting so thin--and the twinkling of the moment he was going to leave.'), (21, 1, 'Dormouse again, so that by the soldiers, who of course was, how to speak good English); \'now I\'m opening out like the wind, and the words did not answer, so Alice went on to himself in an offended.'), (22, 2, 'There was a dispute going on within--a constant howling and sneezing, and every now and then, \'we went to work very carefully, nibbling first at one end of the lefthand bit of the song. \'What trial.'), (23, 3, 'I\'m Mabel, I\'ll stay down here! It\'ll be no chance of her head on her hand, and a Dodo, a Lory and an old conger-eel, that used to say \'Drink me,\' but the great question is, what did the archbishop.'), (24, 4, 'In a minute or two sobs choked his voice. \'Same as if she were saying lessons, and began picking them up again as she was coming to, but it said nothing. \'This here young lady,\' said the Hatter: \'as.'), (25, 5, 'I\'m never sure what I\'m going to turn round on its axis--\' \'Talking of axes,\' said the King, with an air of great relief. \'Now at OURS they had been looking at Alice the moment how large she had to.'), (26, 1, 'Suddenly she came upon a Gryphon, lying fast asleep in the pool, and the executioner went off like an honest man.\' There was a queer-shaped little creature, and held it out to her great delight it.'), (27, 2, 'Allow me to him: She gave me a pair of gloves and a Long Tale They were just beginning to get in?\' she repeated, aloud. \'I must be the best way to hear it say, as it spoke (it was Bill, the Lizard).'), (28, 3, 'Mock Turtle had just begun \'Well, of all this time, and was going to dive in among the trees upon her face. \'Wake up, Dormouse!\' And they pinched it on both sides of it; then Alice, thinking it was.'), (29, 4, 'Alice, \'to speak to this mouse? Everything is so out-of-the-way down here, and I\'m sure I have done that?\' she thought. \'I must be removed,\' said the Dodo. Then they all quarrel so dreadfully one.'), (30, 5, 'When she got up, and there stood the Queen of Hearts, he stole those tarts, And took them quite away!\' \'Consider your verdict,\' he said in a wondering tone. \'Why, what are they made of?\' Alice asked.'), (31, 1, 'Gryphon. \'It\'s all about for them, and considered a little different. But if I\'m Mabel, I\'ll stay down here! It\'ll be no sort of a good many little girls in my life!\' Just as she ran. \'How surprised.'), (32, 2, 'It was so much surprised, that for the accident of the bread-and-butter. Just at this moment the door with his nose Trims his belt and his friends shared their never-ending meal, and the arm that.'), (33, 3, 'Dodo suddenly called out in a mournful tone, \'he won\'t do a thing before, and he hurried off. Alice thought she might find another key on it, for she had never seen such a subject! Our family always.'), (34, 4, 'RABBIT\' engraved upon it. She felt that this could not be denied, so she helped herself to about two feet high: even then she walked down the chimney?--Nay, I shan\'t! YOU do it!--That I won\'t,.'), (35, 5, 'WHAT are you?\' said Alice, very much confused, \'I don\'t think--\' \'Then you keep moving round, I suppose?\' said Alice. \'Why, there they lay on the same as the large birds complained that they would.'), (36, 1, 'However, on the end of your flamingo. Shall I try the experiment?\' \'HE might bite,\' Alice cautiously replied, not feeling at all fairly,\' Alice began, in a deep, hollow tone: \'sit down, both of you,.'), (37, 2, 'Then it got down off the mushroom, and her eyes filled with cupboards and book-shelves; here and there. There was a child,\' said the Mock Turtle, \'but if they do, why then they\'re a kind of rule,.'), (38, 3, 'Alice. \'Then you keep moving round, I suppose?\' \'Yes,\' said Alice, as she could not tell whether they were gardeners, or soldiers, or courtiers, or three times over to the door, and the choking of.'), (39, 4, 'I was going on between the executioner, the King, \'unless it was certainly too much pepper in that case I can listen all day to such stuff? Be off, or I\'ll have you executed.\' The miserable Hatter.'), (40, 5, 'I should be like then?\' And she began fancying the sort of chance of her head to keep herself from being broken. She hastily put down yet, before the officer could get away without speaking, but at.'), (41, 1, 'Duchess was VERY ugly; and secondly, because she was to find herself still in existence; \'and now for the Dormouse,\' thought Alice; \'I can\'t explain it,\' said the Queen, who was gently brushing away.'), (42, 2, 'I begin, please your Majesty,\' said the Mock Turtle. \'She can\'t explain MYSELF, I\'m afraid, but you might like to try the thing at all. \'But perhaps he can\'t help it,\' said the Caterpillar. Alice.'), (43, 3, 'The rabbit-hole went straight on like a stalk out of the jury wrote it down \'important,\' and some of YOUR business, Two!\' said Seven. \'Yes, it IS his business!\' said Five, \'and I\'ll tell him--it was.'), (44, 4, 'Alice could only hear whispers now and then, \'we went to him,\' the Mock Turtle in a piteous tone. And the executioner myself,\' said the Dormouse, and repeated her question. \'Why did they draw?\' said.'), (45, 5, 'Alice hastily; \'but I\'m not myself, you see.\' \'I don\'t think--\' \'Then you keep moving round, I suppose?\' \'Yes,\' said Alice hastily; \'but I\'m not used to read fairy-tales, I fancied that kind of.'), (46, 1, 'I think--\' (she was rather glad there WAS no one to listen to me! I\'LL soon make you grow shorter.\' \'One side of the house, quite forgetting in the court!\' and the executioner myself,\' said the.'), (47, 2, 'The Queen smiled and passed on. \'Who ARE you talking to?\' said the King. (The jury all brightened up again.) \'Please your Majesty,\' he began, \'for bringing these in: but I THINK I can find out the.'), (48, 3, 'For some minutes it puffed away without speaking, but at last turned sulky, and would only say, \'I am older than I am very tired of being upset, and their slates and pencils had been to her, \'if we.'), (49, 4, 'I!\' said the Pigeon. \'I can see you\'re trying to put it more clearly,\' Alice replied in a more subdued tone, and everybody else. \'Leave off that!\' screamed the Queen. An invitation from the change:.'), (50, 5, 'Alice heard it before,\' said the Mouse. \'Of course,\' the Mock Turtle; \'but it doesn\'t understand English,\' thought Alice; but she did not at all the way down one side and then keep tight hold of its.'), (51, 1, 'King. \'Then it ought to have been a holiday?\' \'Of course it is,\' said the King. \'Shan\'t,\' said the King, the Queen, who was trembling down to nine inches high. CHAPTER VI. Pig and Pepper For a.'), (52, 2, 'Alice thought to herself. \'Shy, they seem to encourage the witness at all: he kept shifting from one end of the tail, and ending with the bread-and-butter getting so thin--and the twinkling of the.'), (53, 3, 'At last the Mouse, frowning, but very politely: \'Did you say \"What a pity!\"?\' the Rabbit whispered in a long, low hall, which was sitting on the top of her skirt, upsetting all the way the people.'), (54, 4, 'NO mistake about it: it was certainly English. \'I don\'t much care where--\' said Alice. \'Why, SHE,\' said the Cat. \'Do you know about this business?\' the King triumphantly, pointing to the general.'), (55, 5, 'Alice. \'You must be,\' said the Gryphon replied very readily: \'but that\'s because it stays the same year for such a simple question,\' added the March Hare and his friends shared their never-ending.'), (56, 1, 'Alice ventured to ask. \'Suppose we change the subject,\' the March Hare moved into the garden, called out \'The Queen! The Queen!\' and the blades of grass, but she stopped hastily, for the Duchess.'), (57, 2, 'I never knew so much at first, the two creatures, who had got its neck nicely straightened out, and was going on within--a constant howling and sneezing, and every now and then said, \'It was much.'), (58, 3, 'I wonder?\' And here Alice began to feel very uneasy: to be a comfort, one way--never to be patted on the ground as she heard one of them say, \'Look out now, Five! Don\'t go splashing paint over me.'), (59, 4, 'I hadn\'t drunk quite so much!\' Alas! it was YOUR table,\' said Alice; \'all I know all sorts of things, and she, oh! she knows such a thing before, but she stopped hastily, for the White Rabbit. She.'), (60, 5, 'Mock Turtle. So she called softly after it, \'Mouse dear! Do come back in a shrill, passionate voice. \'Would YOU like cats if you like!\' the Duchess was sitting on the top of his head. But at any.'), (61, 1, 'If I or she should push the matter worse. You MUST have meant some mischief, or else you\'d have signed your name like an honest man.\' There was a dead silence. \'It\'s a friend of mine--a Cheshire.'), (62, 2, 'I know who I am! But I\'d better take him his fan and the baby at her side. She was walking hand in hand, in couples: they were nowhere to be nothing but out-of-the-way things had happened lately,.'), (63, 3, 'Queen furiously, throwing an inkstand at the Queen, \'Really, my dear, I think?\' he said to the Duchess: \'flamingoes and mustard both bite. And the Gryphon repeated impatiently: \'it begins \"I passed.'), (64, 4, 'March Hare said in an offended tone, \'Hm! No accounting for tastes! Sing her \"Turtle Soup,\" will you, won\'t you, will you, old fellow?\' The Mock Turtle in a low, hurried tone. He looked at the.'), (65, 5, 'Alice could speak again. The Mock Turtle said: \'no wise fish would go round a deal too flustered to tell you--all I know all the first to break the silence. \'What day of the Mock Turtle, and to.'), (66, 1, 'Alice soon came to ME, and told me he was speaking, so that her flamingo was gone across to the jury, who instantly made a rush at Alice as she could, for her to begin.\' For, you see, as they lay on.'), (67, 2, 'White Rabbit, trotting slowly back to yesterday, because I was thinking I should frighten them out with his head!\' or \'Off with his whiskers!\' For some minutes it seemed quite natural); but when the.'), (68, 3, 'Gryphon in an offended tone. And she began thinking over other children she knew, who might do something better with the glass table and the Queen, and Alice was rather doubtful whether she ought.'), (69, 4, 'Turtle.\' These words were followed by a very difficult game indeed. The players all played at once and put it right; \'not that it was certainly English. \'I don\'t even know what a delightful thing a.'), (70, 5, 'THAT like?\' said Alice. \'It goes on, you know,\' Alice gently remarked; \'they\'d have been ill.\' \'So they were,\' said the Hatter: \'let\'s all move one place on.\' He moved on as he spoke, and then keep.'), (71, 1, 'I meant,\' the King repeated angrily, \'or I\'ll have you executed.\' The miserable Hatter dropped his teacup instead of onions.\' Seven flung down his face, as long as I was thinking I should think it.'), (72, 2, 'The chief difficulty Alice found at first was moderate. But the snail replied \"Too far, too far!\" and gave a sudden leap out of the jurors were all writing very busily on slates. \'What are you.'), (73, 3, 'No, there were a Duck and a sad tale!\' said the sage, as he spoke, and the Hatter with a sudden leap out of court! Suppress him! Pinch him! Off with his whiskers!\' For some minutes it seemed quite.'), (74, 4, 'Footman went on in the act of crawling away: besides all this, there was room for this, and she sat down in an offended tone, \'so I should say what you would have appeared to them to sell,\' the.'), (75, 5, 'English. \'I don\'t think they play at all a proper way of keeping up the chimney, and said anxiously to herself, as she listened, or seemed to have been ill.\' \'So they were,\' said the Lory. Alice.'), (76, 1, 'Rabbit\'s voice; and the roof bear?--Mind that loose slate--Oh, it\'s coming down! Heads below!\' (a loud crash)--\'Now, who did that?--It was Bill, the Lizard) could not even room for YOU, and no room.'), (77, 2, 'Alice. \'Now we shall get on better.\' \'I\'d rather not,\' the Cat in a melancholy tone: \'it doesn\'t seem to put his shoes off. \'Give your evidence,\' said the King, and the fan, and skurried away into.'), (78, 3, 'I said \"What for?\"\' \'She boxed the Queen\'s absence, and were quite silent, and looked at them with the bones and the Mock Turtle, suddenly dropping his voice; and Alice was not much surprised at.'), (79, 4, 'She said the Mock Turtle to sing you a couple?\' \'You are not the smallest notice of her age knew the meaning of half an hour or so, and were quite silent, and looked at Alice. \'I\'M not a regular.'), (80, 5, 'Alice aloud, addressing nobody in particular. \'She\'d soon fetch it here, lad!--Here, put \'em up at the sudden change, but she had felt quite strange at first; but she was quite pale (with passion,.'), (81, 1, 'White Rabbit, who was trembling down to look through into the wood for fear of their hearing her; and when Alice had learnt several things of this ointment--one shilling the box-- Allow me to sell.'), (82, 2, 'However, she got back to yesterday, because I was thinking I should think very likely it can talk: at any rate he might answer questions.--How am I to get in?\' asked Alice again, in a melancholy.'), (83, 3, 'Alice as it settled down again, the Dodo had paused as if it wasn\'t trouble enough hatching the eggs,\' said the Gryphon: and Alice was very like a candle. I wonder who will put on your head-- Do you.'), (84, 4, 'WHAT?\' thought Alice; \'I daresay it\'s a very poor speaker,\' said the King, \'that only makes the matter with it. There was a dispute going on shrinking rapidly: she soon found herself in a very.'), (85, 5, 'Edgar Atheling to meet William and offer him the crown. William\'s conduct at first was in the distance, sitting sad and lonely on a branch of a procession,\' thought she, \'what would become of it;.'), (86, 1, 'It means much the most interesting, and perhaps as this is May it won\'t be raving mad after all! I almost wish I\'d gone to see if she had nothing yet,\' Alice replied very readily: \'but that\'s.'), (87, 2, 'Queen, \'and he shall tell you just now what the moral of that is--\"Be what you would have appeared to them she heard a little house in it a bit, if you only kept on good terms with him, he\'d do.'), (88, 3, 'They all sat down with one foot. \'Get up!\' said the Mock Turtle. \'Seals, turtles, salmon, and so on; then, when you\'ve cleared all the right words,\' said poor Alice, that she looked at the end.\' \'If.'), (89, 4, 'Alice, rather doubtfully, as she had expected: before she made out that she had grown in the prisoner\'s handwriting?\' asked another of the day; and this was her dream:-- First, she tried her best to.'), (90, 5, 'Seaography: then Drawling--the Drawling-master was an old Crab took the hookah out of that is--\"Be what you had been broken to pieces. \'Please, then,\' said Alice, whose thoughts were still running.'), (91, 1, 'What happened to you? Tell us all about as it spoke. \'As wet as ever,\' said Alice angrily. \'It wasn\'t very civil of you to learn?\' \'Well, there was enough of it altogether; but after a few minutes.'), (92, 2, 'There was exactly the right way of settling all difficulties, great or small. \'Off with her face like the largest telescope that ever was! Good-bye, feet!\' (for when she next peeped out the words:.'), (93, 3, 'Alice put down the chimney?--Nay, I shan\'t! YOU do it!--That I won\'t, then!--Bill\'s to go among mad people,\' Alice remarked. \'Oh, you foolish Alice!\' she answered herself. \'How can you learn lessons.'), (94, 4, 'SOMETHING interesting is sure to do it! Oh dear! I shall never get to the jury, of course--\"I GAVE HER ONE, THEY GAVE HIM TWO--\" why, that must be growing small again.\' She got up in her hands, and.'), (95, 5, 'Then she went on for some time with one eye, How the Owl and the blades of grass, but she had a pencil that squeaked. This of course, I meant,\' the King sharply. \'Do you take me for a long silence.'), (96, 1, 'I know who I WAS when I got up in great fear lest she should chance to be no sort of meaning in it,\' but none of YOUR adventures.\' \'I could tell you my adventures--beginning from this morning,\' said.'), (97, 2, 'Hatter: \'it\'s very interesting. I never understood what it might end, you know,\' said the Queen, who were lying on the breeze that followed them, the melancholy words:-- \'Soo--oop of the table..'), (98, 3, 'She generally gave herself very good advice, (though she very good-naturedly began hunting about for it, while the Mock Turtle, \'Drive on, old fellow! Don\'t be all day to day.\' This was quite a.'), (99, 4, 'RABBIT\' engraved upon it. She went in without knocking, and hurried upstairs, in great fear lest she should push the matter with it. There could be no chance of getting up and walking off to trouble.'), (100, 5, 'Queen\'s shrill cries to the waving of the Mock Turtle. So she tucked it away under her arm, that it signifies much,\' she said to the Caterpillar, just as usual. I wonder what you\'re at!\" You know.'); -- -------------------------------------------------------- -- -- Table structure for table `kursas` -- CREATE TABLE `kursas` ( `id` int(11) NOT NULL, `autorius` varchar(225) COLLATE utf8mb4_unicode_ci NOT NULL, `data` date NOT NULL, `pavadinimas` varchar(225) COLLATE utf8mb4_unicode_ci NOT NULL, `trumpas_aprasymas` varchar(225) COLLATE utf8mb4_unicode_ci NOT NULL, `ilgas_aprasymas` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL, `photo` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL, `kaina` decimal(10,0) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `kursas` -- INSERT INTO `kursas` (`id`, `autorius`, `data`, `pavadinimas`, `trumpas_aprasymas`, `ilgas_aprasymas`, `photo`, `kaina`) VALUES (1, 'Prof. German Herzog Sr.', '1991-08-28', 'Animi tenetur voluptate placeat quod non voluptas sint.', 'Autem expedita ut assumenda et sit. Quos velit ut in quas ratione sit ut. Dolorem tempore quae et omnis et cum nemo est. Sunt voluptas cupiditate doloremque alias. Doloribus sit provident ut molestiae animi doloribus.', 'Quos voluptate voluptatibus nam rerum iste. Et eos dolorum est facilis nulla optio. Ut consequatur quidem aut et.', 'default.png', '54'), (2, 'Dr. Alec Crona', '1978-04-10', 'Exercitationem rerum voluptas sit officia dolor.', 'Consequatur ipsam consequuntur eum impedit hic. Accusamus qui alias et labore. Earum ullam sapiente ipsa omnis. Molestias delectus nostrum molestiae dolores. Quos accusantium nisi sed delectus ipsum delectus sequi.', 'Fugit facere expedita quam. Fugit magni mollitia maxime. Aut quia tenetur nemo nostrum est aut. Dolores quo impedit error aliquam ipsam officiis et. Aspernatur eaque vero excepturi dolor.', 'default.png', '81'), (3, 'Remington Adams I', '1992-12-25', 'Facilis voluptas minima sed exercitationem accusamus aliquid repellendus.', 'Asperiores rerum id sit aut ut esse unde. Minus eum dolores excepturi ducimus dolores rerum facilis. Voluptatem enim et mollitia fugit aliquid est. Est sequi aspernatur quam iusto hic eveniet. Odit natus omnis hic unde.', 'Ab animi soluta at. Dolore est omnis eos quasi officiis amet ut. Omnis aut ratione voluptatum eum consequatur.', 'default.png', '13'), (4, 'Linwood Emmerich', '2004-05-24', 'Rem nemo placeat aperiam.', 'Quos id rerum qui ullam molestias delectus. Nisi et velit autem accusamus non harum. Est sint quod sapiente culpa dolor praesentium. Officiis asperiores numquam et et quae et.', 'Omnis velit aut voluptatem aspernatur et. Inventore expedita ut blanditiis cupiditate aut quisquam odio nulla. Illum voluptates quis aut a. Mollitia quis totam nam pariatur voluptatibus ut.', 'default.png', '87'), (5, 'Emily Fadel', '2020-04-05', 'Omnis est animi laborum rerum sequi.', 'Atque quia sint unde. Temporibus nobis sit officia quos amet assumenda voluptatibus. Animi ipsa voluptates sit repellendus doloribus et vel.', 'Sint velit quod nam nostrum sapiente. Nihil aperiam aut occaecati sunt tenetur. Sed dolorem provident harum ipsam ducimus laboriosam.', 'default.png', '95'); -- -------------------------------------------------------- -- -- Table structure for table `populiarumas` -- CREATE TABLE `populiarumas` ( `id` int(11) NOT NULL, `kurso_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `populiarumas` -- INSERT INTO `populiarumas` (`id`, `kurso_id`) VALUES (1, 1), (6, 1), (11, 1), (16, 1), (21, 1), (26, 1), (31, 1), (36, 1), (41, 1), (46, 1), (51, 1), (56, 1), (2, 2), (7, 2), (12, 2), (17, 2), (22, 2), (27, 2), (32, 2), (37, 2), (42, 2), (47, 2), (52, 2), (3, 3), (8, 3), (13, 3), (18, 3), (23, 3), (28, 3), (33, 3), (38, 3), (43, 3), (48, 3), (53, 3), (4, 4), (9, 4), (14, 4), (19, 4), (24, 4), (29, 4), (34, 4), (39, 4), (44, 4), (49, 4), (54, 4), (5, 5), (10, 5), (15, 5), (20, 5), (25, 5), (30, 5), (35, 5), (40, 5), (45, 5), (50, 5), (55, 5); -- -------------------------------------------------------- -- -- Table structure for table `reitingas` -- CREATE TABLE `reitingas` ( `id` int(11) NOT NULL, `kurso_id` int(11) NOT NULL, `reitingas` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `reitingas` -- INSERT INTO `reitingas` (`id`, `kurso_id`, `reitingas`) VALUES (1, 1, 3), (2, 2, 3), (3, 3, 5), (4, 4, 4), (5, 5, 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `komentarai` -- ALTER TABLE `komentarai` ADD PRIMARY KEY (`id`), ADD KEY `komentarai_fk0` (`kurso_id`); -- -- Indexes for table `kursas` -- ALTER TABLE `kursas` ADD PRIMARY KEY (`id`); -- -- Indexes for table `populiarumas` -- ALTER TABLE `populiarumas` ADD PRIMARY KEY (`id`), ADD KEY `populiarumas_fk0` (`kurso_id`); -- -- Indexes for table `reitingas` -- ALTER TABLE `reitingas` ADD PRIMARY KEY (`id`), ADD KEY `reitingas_fk0` (`kurso_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `komentarai` -- ALTER TABLE `komentarai` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101; -- -- AUTO_INCREMENT for table `kursas` -- ALTER TABLE `kursas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `populiarumas` -- ALTER TABLE `populiarumas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57; -- -- AUTO_INCREMENT for table `reitingas` -- ALTER TABLE `reitingas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- Constraints for dumped tables -- -- -- Constraints for table `komentarai` -- ALTER TABLE `komentarai` ADD CONSTRAINT `komentarai_fk0` FOREIGN KEY (`kurso_id`) REFERENCES `kursas` (`id`); -- -- Constraints for table `populiarumas` -- ALTER TABLE `populiarumas` ADD CONSTRAINT `populiarumas_fk0` FOREIGN KEY (`kurso_id`) REFERENCES `kursas` (`id`); -- -- Constraints for table `reitingas` -- ALTER TABLE `reitingas` ADD CONSTRAINT `reitingas_fk0` FOREIGN KEY (`kurso_id`) REFERENCES `kursas` (`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
fa260971bbfebc1849a8e8e37a008e8fcbd65593
SQL
NeotomaDB/Neotoma_SQL
/function/ti/getanalysisunit.sql
UTF-8
646
3
3
[ "MIT" ]
permissive
CREATE OR REPLACE FUNCTION ti.getanalysisunit(_collectionunitid integer, _analunitname character varying DEFAULT NULL::character varying, _depth double precision DEFAULT NULL::double precision, _thickness double precision DEFAULT NULL::double precision) RETURNS TABLE(analysisunitid integer) LANGUAGE sql AS $function$ SELECT analysisunits.analysisunitid FROM ndb.analysisunits WHERE (collectionunitid = _collectionunitid) AND (_analunitname IS NULL) OR (analysisunitname = _analunitname) AND (_depth IS NULL) OR (depth = _depth) AND (_thickness IS NULL) OR (thickness = _thickness); $function$
true
16ce058afa213d6757a40653c56c2673bcea9e65
SQL
Henrytran13/sql_challenge
/Part-1-SQL-Drills/02-Alter_Update/SOLVED.sql
UTF-8
1,413
4.0625
4
[]
no_license
/*PART 1 Difference Between ALTER and UPDATE Command in SQL alter-vs-updateALTER and UPDATE are the two modifying commands of SQL. ALTER is used to modify the structure of the relations (Tables) in the database. UPDATE Command is used to modify the data stored in a relation of the database. The basic difference between ALTER and UPDATE Command is that ALTER command is a Data Definition Language command whereas the UPDATE command is a Data Manipulation Language command. Comparison Chart BASIS FOR COMPARISON ALTER UPDATE Basic ALTER command is a Data Definition Language Command. UPDATE command is a Data Manipulation Language Command. Purpose ALTER Command add, delete, modify the attributes of the relations (tables) in the database. UPDATE Command modifies one or more records in the relations. Syntax ALTER TABLE table_name ADD column_name datatype; UPDATE table_name SET column_name1 = value, column_name2 = value, ... Values ALTER Command by default initializes values of all the tuple as NULL. UPDATE Command sets specified values in the command to the tuples. Specification ALTER Command operates on the attribute of a relation. Update Command operates on the attribute value of a specific tuple in a relation. */ --PART 2 --- Rename column, table name is employees ALTER TABLE employees RENAME COLUMN department_id TO dept_id; --- Add a column ALTER TABLE employees ADD COLUMN annual_salary INT;
true
3c6ce9c51fca2d417778dcbdf25f134a84ee0d34
SQL
ldcduc/leetcode-training
/department-highest-salary.sql
UTF-8
479
3.515625
4
[]
no_license
/* Problem url: https://leetcode.com/problems/department-highest-salary * Code by: ldcduc * */ /* Begin of Solution */ # Write your MySQL query statement below select D.Name as Department, E.Name as Employee, E.Salary from Employee E join Department D on E.DepartmentId = D.Id where not exists ( select * from Employee E2 where E.salary < E2.salary and E.DepartmentID = E2.DepartmentID ) /* End of Solution */ /* * Comment by ldcduc * Suggested tags: * * */
true
c32628b8193a8dde5758e09289cb20c991d59794
SQL
silence-do-good/stress-test-Postgres-and-MySQL
/dump/high/day22/select1024.sql
UTF-8
178
2.671875
3
[]
no_license
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o WHERE timestamp>'2017-11-21T10:24:00Z' AND timestamp<'2017-11-22T10:24:00Z' AND temperature>=28 AND temperature<=38
true
c9f558c76933a3a40d45a90437ce795696c58d04
SQL
dilleepk/faadu
/resources/db/movies.sql
UTF-8
971
2.953125
3
[]
no_license
DROP TABLE IF EXISTS `movie`; CREATE TABLE `movie` ( `id` int(11) NOT NULL, `title` varchar(100) DEFAULT NULL, `language` varchar(45) DEFAULT NULL, `release_date` datetime DEFAULT NULL, `playtime` int(11) DEFAULT NULL, `media_id` int(11) DEFAULT NULL, `cast_crew` varchar(200) DEFAULT NULL, `brief` varchar(45) DEFAULT NULL, `view_count` varchar(45) DEFAULT NULL, `audio_rating` int(11) DEFAULT NULL, `review_rating` int(11) DEFAULT NULL, `user_review_rating` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `movie_cast`; CREATE TABLE `movie_cast` ( `id` int(11) NOT NULL, `people_id` varchar(45) DEFAULT NULL, `movie_id` varchar(45) DEFAULT NULL, `character_name` varchar(45) DEFAULT NULL, `people_name` varchar(45) DEFAULT NULL, `brief_description` varchar(45) DEFAULT NULL, `media_id` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
true
b8186bd23ea1347410a9b575aad6b9ccdab83431
SQL
j7ng/CLFY_SA
/SA/Views/TABLE_RULE_CONDS.sql
UTF-8
1,225
3.390625
3
[]
no_license
CREATE OR REPLACE FORCE VIEW sa.table_rule_conds (cond_objid,rule_objid,"TYPE","OPERATOR",operand1,op1_type,operand2,op2_type) AS select table_rule_cond.objid, table_rule_cond.parentrule2com_tmplte, table_rule_cond.type, table_rule_cond.operator, table_rule_cond.operand1, table_rule_cond.op1_type, table_rule_cond.operand2, table_rule_cond.op2_type from table_rule_cond where table_rule_cond.parentrule2com_tmplte IS NOT NULL ; COMMENT ON TABLE sa.table_rule_conds IS 'Template for the rule condition'; COMMENT ON COLUMN sa.table_rule_conds.cond_objid IS 'Rule cond internal record number'; COMMENT ON COLUMN sa.table_rule_conds.rule_objid IS 'Com_tmplte internal record number'; COMMENT ON COLUMN sa.table_rule_conds."TYPE" IS 'Internal designation of type of rule condition'; COMMENT ON COLUMN sa.table_rule_conds."OPERATOR" IS 'Relational operator of rule condition'; COMMENT ON COLUMN sa.table_rule_conds.operand1 IS 'First operand of the rule condition'; COMMENT ON COLUMN sa.table_rule_conds.op1_type IS 'Type of the first operand'; COMMENT ON COLUMN sa.table_rule_conds.operand2 IS 'Second operand of the rule condition'; COMMENT ON COLUMN sa.table_rule_conds.op2_type IS 'Type of the second operand';
true