sql
stringlengths
6
1.05M
CREATE PROCEDURE [employer_financial].[CreateAccount] @id BIGINT, @name NVARCHAR(100) AS INSERT INTO [employer_financial].[Account] (Id, [Name]) VALUES (@id, @name)
CREATE TABLE IF NOT EXISTS `object_token` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', `effective` int(11) NOT NULL DEFAULT 0, `secret_key` varchar(255) NOT NULL, `upload` boolean NOT NULL DEFAULT TRUE, `download` boolean NOT NULL DEFAULT TRUE, `delete` boolean NOT NULL DEFAULT TRUE, `list` boolean NOT NULL DEFAULT TRUE, `created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'create time', `updated_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'update time', PRIMARY KEY (`id`), UNIQUE KEY `secret_key` (`secret_key`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
<gh_stars>10-100 -- file:rules.sql ln:470 expect:true insert into rtest_view3 select * from rtest_vview3
<filename>ufabc_planner-backend/prisma/migrations/20220423173516_academic_year_cascade_delete/migration.sql -- DropForeignKey ALTER TABLE "quarters" DROP CONSTRAINT "quarters_academy_year_id_fkey"; -- AddForeignKey ALTER TABLE "quarters" ADD CONSTRAINT "quarters_academy_year_id_fkey" FOREIGN KEY ("academy_year_id") REFERENCES "academic_years"("id") ON DELETE CASCADE ON UPDATE CASCADE;
CREATE OR REPLACE PACKAGE dz_testdata_util AUTHID CURRENT_USER AS ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION gz_split( p_str IN VARCHAR2 ,p_regex IN VARCHAR2 ,p_match IN VARCHAR2 DEFAULT NULL ,p_end IN NUMBER DEFAULT 0 ,p_trim IN VARCHAR2 DEFAULT 'FALSE' ) RETURN MDSYS.SDO_STRING2_ARRAY DETERMINISTIC; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- PROCEDURE drop_table_quietly ( p_owner IN VARCHAR2 DEFAULT NULL ,p_table_name IN VARCHAR2 ); ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION geodetic_XY_diminfo RETURN MDSYS.SDO_DIM_ARRAY; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION geodetic_XYM_diminfo( p_m_lower_bound NUMBER DEFAULT 0 ,p_m_upper_bound NUMBER DEFAULT 100 ,p_m_tolerance NUMBER DEFAULT 0.00001 ) RETURN MDSYS.SDO_DIM_ARRAY; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION fast_point( p_x IN NUMBER ,p_y IN NUMBER ,p_z IN NUMBER DEFAULT NULL ,p_m IN NUMBER DEFAULT NULL ,p_srid IN NUMBER DEFAULT 8265 ) RETURN MDSYS.SDO_GEOMETRY; ---------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION true_point( p_input IN MDSYS.SDO_GEOMETRY ) RETURN MDSYS.SDO_GEOMETRY; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION get_start_point( p_input IN MDSYS.SDO_GEOMETRY ) RETURN MDSYS.SDO_GEOMETRY; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION get_end_point( p_input IN MDSYS.SDO_GEOMETRY ) RETURN MDSYS.SDO_GEOMETRY; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION downsize_2d( p_input IN MDSYS.SDO_GEOMETRY ) RETURN MDSYS.SDO_GEOMETRY; END dz_testdata_util; / GRANT EXECUTE ON dz_testdata_util TO public;
<reponame>mstemen0010/anti-freeze<gh_stars>0 INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('11', '', 'ADVANCED', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('12', '', 'ALLIED SALES', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('13', '', 'AUTOZONE', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('14', '', 'BG', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('15', '', 'LKQ', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('16', '', 'MAIN AUTO', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('17', '', 'MIGHTY', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('18', '', 'MYERS', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('19', '', 'OREILLY', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('20', '', '<NAME>', 'False', 'False', '0', ''); INSERT INTO [Vendor] ([VenID], [ShortDesc], [LongDesc], [AcctsRec], [CurrentList], [Rank], [Group]) VALUES('21', '', 'HEWLETT', 'False', 'False', '0', '');
<gh_stars>1-10 --clear data TRUNCATE TABLE core.identifier_source CASCADE ; ALTER SEQUENCE core.identifier_source_id_seq RESTART WITH 2; insert into core.identifier_source(id,identifier,description,identifier_validator_algorithm,base_character_set, first_identifier_base,prefix,suffix,min_length,max_length,regex_format) values (1, 'Test Identifier', 'Test', 'LUHN_CHECK_DIGIT_ALGORITHM', 'AB12', 'B12A','1','A','5','10','');
TRUNCATE TABLE #inclusionRules; DROP TABLE #inclusionRules;
<gh_stars>100-1000 SELECT * FROM GROUPS ORDER BY INSERT_DATETIME %s LIMIT ? OFFSET ?;
<gh_stars>100-1000 SET check_function_bodies = false; INSERT INTO public."UserType" (value, comment) VALUES ('free', 'Free user'); INSERT INTO public."UserType" (value, comment) VALUES ('pro', 'Paid user'); INSERT INTO public."UserType" (value, comment) VALUES ('admin', 'Site administrator'); INSERT INTO public."UserType" (value, comment) VALUES ('anonymous', 'Anonymous widget vsisitor');
/************************************************************** * DROP TRIGGERS **************************************************************/ DROP TRIGGER entity_added; DROP TRIGGER entity_updated; DROP TRIGGER entity_removed; /************************************************************** * DROP FUNCTIONS **************************************************************/ DROP FUNCTION notify_entity_added; DROP FUNCTION notify_entity_updated; DROP FUNCTION notify_entity_removed;
<filename>t/sql/create_tracklist.sql SET client_min_messages TO WARNING;
CREATE DEFINER=`root`@`localhost` FUNCTION `f_getNextID`(cur_id int) RETURNS int(11) begin declare next_id int; if(cur_id >= all (select so_pm from Phieu_mua_ts)) then set next_id = -1; else set next_id = cur_id + 1; going_next: WHILE next_id not in (select so_pm from Phieu_mua_ts) DO SET next_id = next_id + 1; END WHILE going_next; end if; RETURN next_id; END CREATE DEFINER=`root`@`localhost` FUNCTION `f_getPrevID`(cur_id int) RETURNS int(11) begin declare prev_id int; if(cur_id <= all (select so_pm from Phieu_mua_ts)) then set prev_id = -1; else set prev_id = cur_id - 1; going_next: WHILE next_id not in (select so_pm from Phieu_mua_ts) DO SET prev_id = prev_id - 1; END WHILE going_next; end if; RETURN prev_id; END CREATE DEFINER=`root`@`localhost` FUNCTION `f_getNewSmallestID`() RETURNS int(11) BEGIN declare id int; set id = 1; going_next: WHILE id in (select so_pm from Phieu_mua_ts) DO SET id = id + 1; END WHILE going_next; return id; END
<gh_stars>10-100 -- This script provides an example of how to extend the SQLite version of the ChEMBL database -- to include a table of RDKit molecule instances, and two support RD-tree index tables that -- can be used to speed-up substructure and similarity queries. -- -- The script can be loaded and executed directly inside the SQLite shell: -- -- $ sqlite3 ./chembl_28.db -- sqlite> .read path/to/this_file.sql -- -- This script was tested with ChEMBL 28, ChemicaLite 2021.05.2, RDKit 2021.03.1 -- (it may not work with any later releases) -- Load the ChemicaLite extension -- you may need to adjust this line (e.g. replace the extension name with the path -- to the module file) if chemicalite is not installed under the dynamic loader -- search path. .load chemicalite BEGIN; -- Create a table of RDKit molecules CREATE TABLE rdkit_molecules(id INTEGER PRIMARY KEY, molregno BIGINT NOT NULL, mol MOL); INSERT INTO rdkit_molecules(molregno, mol) SELECT molregno, mol_from_smiles(canonical_smiles) FROM compound_structures; -- Create an index for substructure queries CREATE VIRTUAL TABLE rdkit_structure_index USING rdtree(id, s bits(2048)); INSERT INTO rdkit_structure_index (id, s) SELECT id, mol_pattern_bfp(mol, 2048) FROM rdkit_molecules WHERE mol IS NOT NULL; -- Create an index for similarity queries CREATE VIRTUAL TABLE rdkit_similarity_index USING rdtree(id, s bits(2048)); INSERT INTO rdkit_similarity_index (id, s) SELECT id, mol_morgan_bfp(mol, 2, 2048) FROM rdkit_molecules WHERE mol IS NOT NULL; COMMIT; -- Give SQLite the opportunity to optimize the database (e.g. run ANALYZE) if needed PRAGMA optimize; -- Exit the SQLite shell .quit
<gh_stars>0 use [TOKEN_GVA_SIT] go --TokenDateTime CREATE INDEX TD_INDEX ON [vault].[TokenDateTime] (RepeatableFlag) CREATE INDEX TI_INDEX ON [vault].[TokenInteger] (RepeatableFlag) CREATE INDEX TS_INDEX ON [vault].[TokenString] (RepeatableFlag)
<gh_stars>0 CREATE TABLE `Users` ( `UserID` varchar(32) NOT NULL, `Email` varchar(80) NOT NULL, `Username` varchar(30) NOT NULL, `DOB` date DEFAULT NULL, `FirstName` varchar(40) DEFAULT NULL, `LastName` varchar(40) DEFAULT NULL, `CreatedDate` datetime DEFAULT NULL, PRIMARY KEY (`UserID`), UNIQUE KEY `Email` (`Email`), UNIQUE KEY `Username` (`Username`) );
<filename>SQL Scripts/19-import_2015_passenger_numbers.sql -- DROP TABLE IF ALREADY EXISTS DROP TABLE IF EXISTS passenger_numbers; -- CREATE TABLE CREATE TABLE passenger_numbers ( nlc_code NUMERIC, station_name TEXT, station_borough TEXT, note TEXT, weekday_entry NUMERIC, weekday_entry_weight NUMERIC, saturday_entry NUMERIC, saturday_entry_weight NUMERIC, sunday_entry NUMERIC, sunday_entry_weight NUMERIC, weekday_exit NUMERIC, weekday_exit_weight NUMERIC, saturday_exit NUMERIC, saturday_exit_weight NUMERIC, sunday_exit NUMERIC, sunday_exit_weight NUMERIC, line_if_present TEXT ); -- IMPORT DATA FROM CSV COPY passenger_numbers FROM '/home/james/mounts/James/PhD/10 - Tube Monitoring Chapter/Passgenger Number Data/2015_entry_exit_by_station.csv' DELIMITERS ',' HEADER CSV; -- Data seperates out Hammersmith station to two stations. District, Hammersmith & City. Should be four. Piccadilly and Circle are missing. Think they use the same gates. -- So going to halve current numbers and make two new entries. UPDATE passenger_numbers SET weekday_entry = weekday_entry/2, saturday_entry = saturday_entry/2, sunday_entry = sunday_entry/2, weekday_exit = weekday_exit/2, saturday_exit = saturday_exit/2, sunday_exit = sunday_exit/2 WHERE line_if_present = 'District' AND station_name = 'Hammersmith'; UPDATE passenger_numbers SET weekday_entry = weekday_entry/2, saturday_entry = saturday_entry/2, sunday_entry = sunday_entry/2, weekday_exit = weekday_exit/2, saturday_exit = saturday_exit/2, sunday_exit = sunday_exit/2 WHERE line_if_present = 'Hammersmith & City' AND station_name = 'Hammersmith'; INSERT INTO passenger_numbers ( SELECT nlc_code, station_name, station_borough, note, weekday_entry, weekday_entry_weight, saturday_entry, saturday_entry_weight, sunday_entry, sunday_entry_weight, weekday_exit, weekday_exit_weight, saturday_exit, saturday_exit_weight, sunday_exit, sunday_exit_weight, 'Piccadilly' FROM passenger_numbers WHERE line_if_present = 'District' AND station_name = 'Hammersmith'); INSERT INTO passenger_numbers ( SELECT nlc_code, station_name, station_borough, note, weekday_entry, weekday_entry_weight, saturday_entry, saturday_entry_weight, sunday_entry, sunday_entry_weight, weekday_exit, weekday_exit_weight, saturday_exit, saturday_exit_weight, sunday_exit, sunday_exit_weight, 'Circle' FROM passenger_numbers WHERE line_if_present = 'Hammersmith & City' AND station_name = 'Hammersmith'); -- The passenger number data groups Monument and Bank. But my AQ data gives them seperately. So going to split the passenger numbers in half for each UPDATE passenger_numbers SET weekday_entry = weekday_entry/2, saturday_entry = saturday_entry/2, sunday_entry = sunday_entry/2, weekday_exit = weekday_exit/2, saturday_exit = saturday_exit/2, sunday_exit = sunday_exit/2, station_name = 'Bank' WHERE station_name = 'Bank & Monument'; INSERT INTO passenger_numbers ( SELECT nlc_code, 'Monument', station_borough, note, weekday_entry, weekday_entry_weight, saturday_entry, saturday_entry_weight, sunday_entry, sunday_entry_weight, weekday_exit, weekday_exit_weight, saturday_exit, saturday_exit_weight, sunday_exit, sunday_exit_weight, '' FROM passenger_numbers WHERE station_name = 'Bank');
/* Replace with your SQL commands */ CREATE TABLE t_users ( id UUID PRIMARY KEY, name TEXT, session_id UUID REFERENCES t_sessions (id) ON DELETE CASCADE, is_ready BOOLEAN DEFAULT false, UNIQUE (name, session_id) );
<filename>db/schema.sql DROP DATABASE IF EXISTS burgers_db; CREATE DATABASE burgers_db; USE burgers_db; CREATE TABLE burger ( id INT(10) AUTO_INCREMENT, burger_name VARCHAR(50) NOT NULL, devoured BOOLEAN DEFAULT FALSE, PRIMARY KEY(id) );
<gh_stars>0 DELETE FROM agi_oereb_app.egrid_parcel; INSERT INTO agi_oereb_app.egrid_parcel ( geometrie, egrid, "number", identdn ) SELECT l.geometrie AS geometrie, CASE WHEN g.egris_egrid IS NULL THEN 'CH-DUMMY' ELSE g.egris_egrid END AS egrid, g.nummer AS "number", g.nbident AS identdn FROM av_avdpool_ng.liegenschaften_grundstueck AS g RIGHT JOIN av_avdpool_ng.liegenschaften_liegenschaft AS l ON g.t_id = l.liegenschaft_von UNION ALL SELECT s.geometrie AS geometrie, CASE WHEN g.egris_egrid IS NULL THEN 'CH-DUMMY' ELSE g.egris_egrid END AS egrid, g.nummer AS "number", g.nbident AS identdn FROM av_avdpool_ng.liegenschaften_grundstueck AS g RIGHT JOIN av_avdpool_ng.liegenschaften_selbstrecht AS s ON g.t_id = s.selbstrecht_von ; DELETE FROM agi_oereb_app.egrid_address; -- Liegenschaften INSERT INTO agi_oereb_app.egrid_address ( postalcode, localisation, housing_number, egrid, "number", identdn ) SELECT plz.plz, lokname.atext AS localisation, gebein.hausnummer AS housing_number, parcels.egrid, parcels."number" AS "number", parcels.identdn FROM ( SELECT t_id, gebaeudeeingang_von, hausnummer, lage FROM av_avdpool_ng.gebaeudeadressen_gebaeudeeingang WHERE hausnummer IS NOT NULL AND istoffiziellebezeichnung = 'ja' ) AS gebein LEFT JOIN av_avdpool_ng.gebaeudeadressen_lokalisation AS lok ON gebein.gebaeudeeingang_von = lok.t_id LEFT JOIN av_avdpool_ng.gebaeudeadressen_lokalisationsname AS lokname ON lokname.benannte = lok.t_id INNER JOIN ( SELECT l.t_id AS t_id, CASE WHEN g.egris_egrid IS NULL THEN 'CH-DUMMY' ELSE g.egris_egrid END AS egrid, g.nummer AS "number", g.nbident AS identdn, 'RealEstate' AS "type", 'SO' AS canton, l.t_datasetname::int AS fosnr, l.geometrie AS geometrie FROM av_avdpool_ng.liegenschaften_grundstueck AS g RIGHT JOIN av_avdpool_ng.liegenschaften_liegenschaft AS l ON g.t_id = l.liegenschaft_von ) AS parcels ON ST_Intersects(gebein.lage, parcels.geometrie) LEFT JOIN av_plzortschaft.plzortschaft_plz6 AS plz ON ST_Intersects(gebein.lage, plz.flaeche) WHERE lokname.atext IS NOT NULL -- Due to errors (?) in the data. ; -- SelbstRecht INSERT INTO agi_oereb_app.egrid_address ( postalcode, localisation, housing_number, egrid, "number", identdn ) SELECT plz.plz, lokname.atext AS localisation, gebein.hausnummer AS housing_number, parcels.egrid, parcels."number" AS "number", parcels.identdn FROM ( SELECT t_id, gebaeudeeingang_von, hausnummer, lage FROM av_avdpool_ng.gebaeudeadressen_gebaeudeeingang WHERE hausnummer IS NOT NULL AND istoffiziellebezeichnung = 'ja' ) AS gebein LEFT JOIN av_avdpool_ng.gebaeudeadressen_lokalisation AS lok ON gebein.gebaeudeeingang_von = lok.t_id LEFT JOIN av_avdpool_ng.gebaeudeadressen_lokalisationsname AS lokname ON lokname.benannte = lok.t_id INNER JOIN ( SELECT s.t_id AS t_id, CASE WHEN g.egris_egrid IS NULL THEN 'CH-DUMMY' ELSE g.egris_egrid END AS egrid, g.nummer AS "number", g.nbident AS identdn, 'Distinct_and_permanent_rights.BuildingRight' AS "type", 'SO' AS canton, s.t_datasetname::int AS fosnr, s.geometrie AS geometrie FROM av_avdpool_ng.liegenschaften_grundstueck AS g RIGHT JOIN av_avdpool_ng.liegenschaften_selbstrecht AS s ON g.t_id = s.selbstrecht_von ) AS parcels ON ST_Intersects(gebein.lage, parcels.geometrie) LEFT JOIN av_plzortschaft.plzortschaft_plz6 AS plz ON ST_Intersects(gebein.lage, plz.flaeche) WHERE lokname.atext IS NOT NULL -- Due to errors (?) in the data. ;
CREATE TABLE "admin" ( "id" SERIAL PRIMARY KEY, "first_name" VARCHAR (40), "last_name" VARCHAR (40), "email" VARCHAR (60), "password" VARCHAR (120) ); CREATE TABLE "categories" ( "id" SERIAL PRIMARY KEY, "category_name" VARCHAR (80) ); CREATE TABLE "gentleman" (     "id" SERIAL PRIMARY KEY,     "first_name" VARCHAR (80) NOT NULL, "last_name" VARCHAR (80) NOT NULL, "zip" VARCHAR (6) NOT NULL, "phone" VARCHAR (20) NOT NULL, "email" VARCHAR (60), "height_feet" INT, "height_inches" INT, "weight" INT, "waist" INT, "need" VARCHAR (40), "appointment_type" VARCHAR (20), "appointment_date" DATE, "appointment_time" TIME ); CREATE TABLE "resources" ( "id" SERIAL PRIMARY KEY, "title" VARCHAR (80), "description" VARCHAR (1000), "link" VARCHAR (1000) ); CREATE TABLE "resources_categories" ( "id" SERIAL PRIMARY KEY, "resources_id" INT REFERENCES "resources", "categories_id" INT REFERENCES "categories" ); INSERT INTO "categories" ("id", "category_name") VALUES ('1', 'job'), ('2', 'funeral'), ('3', 'court'),('4', 'other'); INSERT INTO "resources" ("id", "title" , "description" , "link") VALUES ('1', 'StartLand', 'Job Boards', 'https://www.startlandnews.com/jobs/'); INSERT INTO "resources" ("id", "title", "description", "link") VALUES ('2', 'KCJOBS.com', 'Job Boards', 'https://www.kcjobs.com/'); INSERT INTO "resources" ("id", "title", "description", "link") VALUES ('3', 'Full Employment Council', 'Job Services', 'https://www.feckc.org/'); INSERT INTO "resources" ("id", "title", "description", "link") VALUES ('4', 'Kansas City Job Seekers', 'Job Services', 'https://www.kansascityjobseekers.com/'); INSERT INTO "resources" ("id", "title", "description", "link") VALUES ('5', 'Indeed Career Guide', 'Resume Resources', 'https://www.indeed.com/career-advice/resumes-cover-letters/10-resume-writing-tips'); INSERT INTO "resources" ("id", "title", "description", "link") VALUES ('6', 'The Muse', 'Resume Resources', 'https://www.themuse.com/advice/43-resume-tips-that-will-help-you-get-hired'); INSERT INTO "resources_categories" ("id", "resources_id", "categories_id") VALUES ('1', '1', '1'), ('2', '2', '1'), ('3', '3', '1'), ('4', '4', '1'), ('5', '5', '1'), ('6', '6', '1');
<filename>migrations/struct/20140709103346-user-nullable.sql ALTER TABLE "users" ALTER COLUMN "name" DROP NOT NULL, ALTER COLUMN "family_name" DROP NOT NULL, ALTER COLUMN "nominative" DROP NOT NULL, ALTER COLUMN "vocative" DROP NOT NULL, ALTER COLUMN "gender" DROP NOT NULL;
DEFINE RECORD CDD$TOP.PR.PR_REG_TAXWH DESCRIPTION IS /*Payroll Tax Register*/. PR_REG_TAXWH_CDD STRUCTURE. /* Element = Description = Employee number */ EMPNUM DATATYPE IS TEXT SIZE IS 10. /* Element = Description = FW, FI, SW, SX, CW, DW, EX */ TTYPE DATATYPE IS TEXT SIZE IS 2. /* Element = Description = Used if type = SW,SX,CW,DW,EX */ CODE DATATYPE IS TEXT SIZE IS 2. /* Element = Description = Quarterly wages */ QTRWAG ARRAY 0:3 DATATYPE IS G_FLOATING. /* Element = Description = Quarterly taxes witheld */ QTRTAX ARRAY 0:3 DATATYPE IS G_FLOATING. /* Element = Description = Weeks worked during quarter */ WKWRK ARRAY 0:3 DATATYPE IS SIGNED WORD. /* Element = Description = Batch number from update */ UPDATE_COUNTER DATATYPE IS SIGNED WORD. END PR_REG_TAXWH_CDD STRUCTURE. END PR_REG_TAXWH.
SELECT * FROM practice.client; SELECT * FROM practice.invoice; SELECT * FROM practice.product; INSERT INTO practice.product (product_id, product_name, cost, weight_kg, dimensions) VALUES (4, 'ruby', 99999, 1, '10x10'); INSERT INTO practice."order"(order_id, status, order_date, order_client_id) VALUES (4, 'cancelled', '02.2.2021', 3); INSERT INTO practice.client(client_id, client_full_name, adress, telphone_number) VALUES (4, '<NAME>', 'Poselok gorodskogo tipa', 54321); DELETE FROM practice.client WHERE client_full_name='<NAME>'; DELETE FROM practice.product WHERE product_id=4; DELETE FROM practice."order" WHERE order_id=4;
REVOKE SELECT ON bloomreader.NumTitles FROM bloomreaderuser; DROP VIEW bloomreader.NumTitles CASCADE; CREATE VIEW bloomreader.NumTitles AS SELECT COUNT(*), a.title, row_number() OVER (ORDER BY a.timestamp), a.timestamp, a.Country FROM ( SELECT COUNT(*), d.title, row_number() OVER (ORDER BY d.timestamp), d.timestamp, (SELECT i.country_name from public.ip2loc_sm_tab AS i WHERE public.ip2int(d.context_ip) = i.context_ip GROUP BY i.country_name) AS Country, RANK() OVER (partition by d.title ORDER BY d.timestamp ASC) AS RANK FROM (SELECT * FROM bloomreader.pages_read UNION ALL SELECT * FROM bloomreaderbeta.pages_read) AS d GROUP BY d.title, d.timestamp, d.country_name, d.context_ip ) AS a WHERE rank = 1 GROUP BY a.title, a.timestamp, a.Country; GRANT SELECT ON bloomreader.NumTitles TO bloomreaderuser; select * FROM bloomreader.NumTitles;
<reponame>eventEmitter/ee-orm-localization DROP SCHEMA IF EXISTS related_localization_test CASCADE; CREATE SCHEMA related_localization_test; CREATE TABLE related_localization_test.venue ( id serial NOT NULL , CONSTRAINT "pk_venue" PRIMARY KEY (id) ); CREATE TABLE related_localization_test.event ( id serial NOT NULL , id_venue integer NOT NULL , title integer , CONSTRAINT "pk_event" PRIMARY KEY (id) , CONSTRAINT "fk_event_language" FOREIGN KEY (id_venue) REFERENCES related_localization_test.venue (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT ); CREATE TABLE related_localization_test.language ( id serial NOT NULL , code varchar(2) , CONSTRAINT "pk_language" PRIMARY KEY (id) ); CREATE TABLE related_localization_test."languageLocale" ( id_language integer NOT NULL , id_languageLocale integer NOT NULL , name text , CONSTRAINT "pk_languageLocale" PRIMARY KEY (id_languageLocale, id_language) , CONSTRAINT "fk_languageLocale_languageLocale" FOREIGN KEY (id_languageLocale) REFERENCES related_localization_test.language (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT , CONSTRAINT "fk_languageLocale_language" FOREIGN KEY (id_language) REFERENCES related_localization_test.language (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT ); CREATE TABLE related_localization_test."eventLocale" ( id_event integer NOT NULL , id_language integer NOT NULL , description text , title text , CONSTRAINT "pk_eventLocale" PRIMARY KEY (id_event, id_language) , CONSTRAINT "fk_eventLocale_event" FOREIGN KEY (id_event) REFERENCES related_localization_test.event (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE , CONSTRAINT "fk_eventLocale_language" FOREIGN KEY (id_language) REFERENCES related_localization_test.language (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT ); CREATE TABLE related_localization_test."venueLocale" ( id_venue integer NOT NULL , id_language integer NOT NULL , description text , title text , CONSTRAINT "pk_venueLocale" PRIMARY KEY (id_venue, id_language) , CONSTRAINT "fk_venueLocale_venue" FOREIGN KEY (id_venue) REFERENCES related_localization_test.venue (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE , CONSTRAINT "fk_venueLocale_language" FOREIGN KEY (id_language) REFERENCES related_localization_test.language (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT );
<filename>migrations/0052_default_gateway_config_tables.sql<gh_stars>1-10 -- +migrate Up CREATE TABLE default_gateway_config ( id bigserial, model varchar(32) not null default '', region varchar(32) not null default '', created_at timestamp with time zone not null, updated_at timestamp with time zone not null, default_config text not null default '', PRIMARY KEY (id) ); alter table network_server add column version varchar(32) not null default ''; alter table network_server add column region varchar(32) not null default ''; -- +migrate Down
<filename>src/main/resources/db/migration/V16__city_region_index.sql UPDATE city SET city = 'Krzanowice (miasto)' WHERE id = 31866; UPDATE city SET city = 'Lipno (miasto)' WHERE id = 2482; UPDATE city SET city = 'Stronie Śląskie (miasto)' WHERE id = 513; UPDATE city SET city = 'Poniatowa (miasto)' WHERE id = 7296; UPDATE city SET city = 'Żukowo (miasto)' WHERE id = 30225; UPDATE city SET city = 'Małachów (miasto)' WHERE id = 34365; UPDATE city SET city = 'Rakoniewice (miasto)' WHERE id = 41321; DELETE FROM city WHERE id = 3350; CREATE UNIQUE INDEX idx_city_region_city ON city (UPPER(city || ', ' || region));
<filename>benchmarks/tpcds/schemas/s64da_native_enhanced_partitioned_id_hashed/indexes.sql --create index idx_customer_demographics_1 on customer_demographics (cd_marital_status, cd_education_status); --create index idx_customer_address_1 on customer_address (ca_state, ca_country); --create index idx_store_sales_1 on store_sales (ss_sales_price, ss_net_profit); --create index idx_store_sales_2 on store_sales (ss_quantity, ss_ext_sales_price, ss_net_profit); --create index idx_store_sales_quantity_1 on store_sales (ss_quantity); --create index idx_store_sales_quantity_2 on store_sales (ss_quantity, ss_list_price, ss_coupon_amt, ss_wholesale_cost); --create index idx_item_1 on item(i_category); --create index idx_item_2 on item(i_category, i_current_price); create index idx_ss_sold_date_sk on store_sales (ss_sold_date_sk); create index idx_ss_sold_time_sk on store_sales (ss_sold_time_sk); create index idx_ss_item_sk on store_sales (ss_item_sk); create index idx_ss_customer_sk on store_sales (ss_customer_sk); create index idx_ss_cdemo_sk on store_sales (ss_cdemo_sk); create index idx_ss_hdemo_sk on store_sales (ss_hdemo_sk); create index idx_ss_addr_sk on store_sales (ss_addr_sk); create index idx_ss_store_sk on store_sales (ss_store_sk); create index idx_ss_promo_sk on store_sales (ss_promo_sk); create index idx_ss_ticket_number on store_sales (ss_ticket_number); create index idx_sr_returned_date_sk on store_returns (sr_returned_date_sk); create index idx_sr_return_time_sk on store_returns (sr_return_time_sk); create index idx_sr_item_sk on store_returns (sr_item_sk); create index idx_sr_customer_sk on store_returns (sr_customer_sk); create index idx_sr_cdemo_sk on store_returns (sr_cdemo_sk); create index idx_sr_hdemo_sk on store_returns (sr_hdemo_sk); create index idx_sr_addr_sk on store_returns (sr_addr_sk); create index idx_sr_store_sk on store_returns (sr_store_sk); create index idx_sr_reason_sk on store_returns (sr_reason_sk); create index idx_sr_ticket_number on store_returns (sr_ticket_number); create index idx_cs_sold_date_sk on catalog_sales (cs_sold_date_sk); create index idx_cs_sold_time_sk on catalog_sales (cs_sold_time_sk); create index idx_cs_ship_date_sk on catalog_sales (cs_ship_date_sk); create index idx_cs_bill_customer_sk on catalog_sales (cs_bill_customer_sk); create index idx_cs_bill_cdemo_sk on catalog_sales (cs_bill_cdemo_sk); create index idx_cs_bill_hdemo_sk on catalog_sales (cs_bill_hdemo_sk); create index idx_cs_bill_addr_sk on catalog_sales (cs_bill_addr_sk); create index idx_cs_ship_customer_sk on catalog_sales (cs_ship_customer_sk); create index idx_cs_ship_cdemo_sk on catalog_sales (cs_ship_cdemo_sk); create index idx_cs_ship_hdemo_sk on catalog_sales (cs_ship_hdemo_sk); create index idx_cs_ship_addr_sk on catalog_sales (cs_ship_addr_sk); create index idx_cs_call_center_sk on catalog_sales (cs_call_center_sk); create index idx_cs_catalog_page_sk on catalog_sales (cs_catalog_page_sk); create index idx_cs_ship_mode_sk on catalog_sales (cs_ship_mode_sk); create index idx_cs_warehouse_sk on catalog_sales (cs_warehouse_sk); create index idx_cs_item_sk on catalog_sales (cs_item_sk); create index idx_cs_promo_sk on catalog_sales (cs_promo_sk); create index idx_cs_order_number on catalog_sales (cs_order_number); create index idx_cr_returned_date_sk on catalog_returns (cr_returned_date_sk); create index idx_cr_returned_time_sk on catalog_returns (cr_returned_time_sk); create index idx_cr_item_sk on catalog_returns (cr_item_sk); create index idx_cr_refunded_customer_sk on catalog_returns (cr_refunded_customer_sk); create index idx_cr_refunded_cdemo_sk on catalog_returns (cr_refunded_cdemo_sk); create index idx_cr_refunded_hdemo_sk on catalog_returns (cr_refunded_hdemo_sk); create index idx_cr_refunded_addr_sk on catalog_returns (cr_refunded_addr_sk); create index idx_cr_returning_customer_sk on catalog_returns (cr_returning_customer_sk); create index idx_cr_returning_cdemo_sk on catalog_returns (cr_returning_cdemo_sk); create index idx_cr_returning_hdemo_sk on catalog_returns (cr_returning_hdemo_sk); create index idx_cr_returning_addr_sk on catalog_returns (cr_returning_addr_sk); create index idx_cr_call_center_sk on catalog_returns (cr_call_center_sk); create index idx_cr_catalog_page_sk on catalog_returns (cr_catalog_page_sk); create index idx_cr_ship_mode_sk on catalog_returns (cr_ship_mode_sk); create index idx_cr_warehouse_sk on catalog_returns (cr_warehouse_sk); create index idx_cr_reason_sk on catalog_returns (cr_reason_sk); create index idx_cr_order_number on catalog_returns (cr_order_number); create index idx_ws_sold_date_sk on web_sales (ws_sold_date_sk); create index idx_ws_sold_time_sk on web_sales (ws_sold_time_sk); create index idx_ws_ship_date_sk on web_sales (ws_ship_date_sk); create index idx_ws_item_sk on web_sales (ws_item_sk); create index idx_ws_bill_customer_sk on web_sales (ws_bill_customer_sk); create index idx_ws_bill_cdemo_sk on web_sales (ws_bill_cdemo_sk); create index idx_ws_bill_hdemo_sk on web_sales (ws_bill_hdemo_sk); create index idx_ws_bill_addr_sk on web_sales (ws_bill_addr_sk); create index idx_ws_ship_customer_sk on web_sales (ws_ship_customer_sk); create index idx_ws_ship_cdemo_sk on web_sales (ws_ship_cdemo_sk); create index idx_ws_ship_hdemo_sk on web_sales (ws_ship_hdemo_sk); create index idx_ws_ship_addr_sk on web_sales (ws_ship_addr_sk); create index idx_ws_web_page_sk on web_sales (ws_web_page_sk); create index idx_ws_web_site_sk on web_sales (ws_web_site_sk); create index idx_ws_ship_mode_sk on web_sales (ws_ship_mode_sk); create index idx_ws_warehouse_sk on web_sales (ws_warehouse_sk); create index idx_ws_promo_sk on web_sales (ws_promo_sk); create index idx_ws_order_number on web_sales (ws_order_number); create index idx_wr_returned_date_sk on web_returns (wr_returned_date_sk); create index idx_wr_returned_time_sk on web_returns (wr_returned_time_sk); create index idx_wr_item_sk on web_returns (wr_item_sk); create index idx_wr_refunded_customer_sk on web_returns (wr_refunded_customer_sk); create index idx_wr_refunded_cdemo_sk on web_returns (wr_refunded_cdemo_sk); create index idx_wr_refunded_hdemo_sk on web_returns (wr_refunded_hdemo_sk); create index idx_wr_refunded_addr_sk on web_returns (wr_refunded_addr_sk); create index idx_wr_returning_customer_sk on web_returns (wr_returning_customer_sk); create index idx_wr_returning_cdemo_sk on web_returns (wr_returning_cdemo_sk); create index idx_wr_returning_hdemo_sk on web_returns (wr_returning_hdemo_sk); create index idx_wr_returning_addr_sk on web_returns (wr_returning_addr_sk); create index idx_wr_web_page_sk on web_returns (wr_web_page_sk); create index idx_wr_reason_sk on web_returns (wr_reason_sk); create index idx_wr_order_number on web_returns (wr_order_number); create index idx_inv_date_sk on inventory (inv_date_sk); create index idx_inv_item_sk on inventory (inv_item_sk); create index idx_inv_warehouse_sk on inventory (inv_warehouse_sk); create index idx_s_store_id on store (s_store_id); create index idx_s_rec_start_date on store (s_rec_start_date); create index idx_s_rec_end_date on store (s_rec_end_date); create index idx_s_closed_date_sk on store (s_closed_date_sk); create index idx_cc_rec_start_date on call_center (cc_rec_start_date); create index idx_cc_call_center_id on call_center (cc_call_center_id); create index idx_cc_rec_end_date on call_center (cc_rec_end_date); create index idx_cc_closed_date_sk on call_center (cc_closed_date_sk); create index idx_cc_open_date_sk on call_center (cc_open_date_sk); create index idx_cp_catalog_page_id on catalog_page (cp_catalog_page_id); create index idx_cp_start_date_sk on catalog_page (cp_start_date_sk); create index idx_cp_end_date_sk on catalog_page (cp_end_date_sk); create index idx_web_site_id on web_site (web_site_id); create index idx_web_rec_start_date on web_site (web_rec_start_date); create index idx_web_rec_end_date on web_site (web_rec_end_date); create index idx_web_open_date_sk on web_site (web_open_date_sk); create index idx_web_close_date_sk on web_site (web_close_date_sk); create index idx_wp_web_page_id on web_page (wp_web_page_id); create index idx_wp_rec_start_date on web_page (wp_rec_start_date); create index idx_wp_rec_end_date on web_page (wp_rec_end_date); create index idx_wp_creation_date_sk on web_page (wp_creation_date_sk); create index idx_wp_access_date_sk on web_page (wp_access_date_sk); create index idx_wp_customer_sk on web_page (wp_customer_sk); create index idx_w_warehouse_id on warehouse (w_warehouse_id); create index idx_c_customer_id on customer (c_customer_id); create index idx_c_current_cdemo_sk on customer (c_current_cdemo_sk); create index idx_c_current_hdemo_sk on customer (c_current_hdemo_sk); create index idx_c_current_addr_sk on customer (c_current_addr_sk); create index idx_c_first_shipto_date_sk on customer (c_first_shipto_date_sk); create index idx_c_first_sales_date_sk on customer (c_first_sales_date_sk); create index idx_c_last_review_date_sk on customer (c_last_review_date_sk); create index idx_ca_address_id on customer_address (ca_address_id); create index idx_d_date_id on date_dim (d_date_id); create index idx_d_date on date_dim (d_date); create index idx_hd_income_band_sk on household_demographics (hd_income_band_sk); create index idx_i_item_id on item (i_item_id); create index idx_i_rec_start_date on item (i_rec_start_date); create index idx_i_rec_end_date on item (i_rec_end_date); create index idx_p_promo_id on promotion (p_promo_id); create index idx_p_start_date_sk on promotion (p_start_date_sk); create index idx_p_end_date_sk on promotion (p_end_date_sk); create index idx_p_item_sk on promotion (p_item_sk); create index idx_r_reason_id on reason (r_reason_id); create index idx_sm_ship_mode_id on ship_mode (sm_ship_mode_id); create index idx_t_time_id on time_dim (t_time_id);
<gh_stars>100-1000 CREATE TABLE [dbo].[ProjectStats]( [TeamProjectName] [varchar](200) NOT NULL, [TeamProjectCountWorkItemCreated] [smallint] NOT NULL, [TeamProjectCountWorkItemCompleted] [smallint] NOT NULL, [TeamProjectCountCommitsPushed] [smallint] NOT NULL, [TeamProjectCountPRsCreated] [smallint] NOT NULL, [TeamProjectCountPRsCompleted] [smallint] NOT NULL, [TeamProjectCountBuilds] [smallint] NOT NULL, [TeamProjectCountReleases] [smallint] NOT NULL ) GO
<reponame>JmPotato/dbgen<filename>tests/data/headers-sql/a.1.sql INSERT INTO a (col1, col2, `col3`, `col``4`, "col5", "col""6", [col7], [col "8"], , ) VALUES (1, 1, 1, 1, 1, 1, 1, 1, 1, 1), (2, 2, 2, 2, 2, 2, 2, 2, 2, 2); INSERT INTO a (col1, col2, `col3`, `col``4`, "col5", "col""6", [col7], [col "8"], , ) VALUES (3, 3, 3, 3, 3, 3, 3, 3, 3, 3), (4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
<gh_stars>100-1000 DROP VIEW IF EXISTS vw_es_award_search CASCADE; CREATE VIEW vw_es_award_search AS ( SELECT * FROM mv_contract_award_search UNION ALL SELECT * FROM mv_directpayment_award_search UNION ALL SELECT * FROM mv_grant_award_search UNION ALL SELECT * FROM mv_idv_award_search UNION ALL SELECT * FROM mv_loan_award_search UNION ALL SELECT * FROM mv_other_award_search ); GRANT SELECT ON vw_es_award_search TO readonly;
-- ----------------------------- -- HeilPHP -- Date : 2018-02-10 06:36 -- ----------------------------- SET FOREIGN_KEY_CHECKS = 0; -- ----------------------------- -- Table structure for `heilphp_config` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_config`; CREATE TABLE `heilphp_config` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '配置ID', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '配置名称', `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '配置类型', `title` varchar(50) NOT NULL DEFAULT '' COMMENT '配置说明', `group` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '配置分组', `extra` varchar(255) NOT NULL DEFAULT '' COMMENT '配置值', `remark` varchar(100) NOT NULL DEFAULT '' COMMENT '配置说明', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态', `value` text NULL COMMENT '配置值', `sort` smallint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序', PRIMARY KEY (`id`), UNIQUE KEY `uk_name` (`name`), KEY `type` (`type`), KEY `group` (`group`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- ----------------------------- -- Records of `heilphp_config` -- ----------------------------- INSERT INTO `heilphp_config` VALUES ('1', 'WEB_SITE_TITLE', '1', '网站标题', '1', '', '网站标题前台显示标题', '1518215910', '1518215910', '1', 'HeilPHP内容管理框架', '0'); INSERT INTO `heilphp_config` VALUES ('2', 'WEB_SITE_DESCRIPTION', '2', '网站描述', '1', '', '网站搜索引擎描述', '1518215910', '1518215910', '1', 'HeilPHP内容管理框架', '1'); INSERT INTO `heilphp_config` VALUES ('3', 'WEB_SITE_KEYWORD', '2', '网站关键字', '1', '', '网站搜索引擎关键字', '1518215910', '1518215910', '1', 'ThinkPHP,HeilPHP', '8'); INSERT INTO `heilphp_config` VALUES ('4', 'WEB_SITE_CLOSE', '4', '关闭站点', '1', '0:关闭,1:开启', '站点关闭后其他用户不能访问,管理员可以正常访问', '1518215910', '1518215910', '1', '1', '1'); INSERT INTO `heilphp_config` VALUES ('9', 'WEB_SITE_ICP', '1', '网站备案号', '1', '', '设置在网站底部显示的备案号,如“琼ICP备16001170号-2“', '1518215910', '1518215910', '1', '', '9'); INSERT INTO `heilphp_config` VALUES ('10', 'CONFIG_TYPE_LIST', '3', '配置类型列表', '4', '', '主要用于数据解析和页面表单的生成', '1378898976', '1379235348', '1', '0:数字\r\n1:字符\r\n2:文本\r\n3:数组\r\n4:枚举', '2'); INSERT INTO `heilphp_config` VALUES ('11', 'DOCUMENT_POSITION', '3', '文档推荐位', '2', '', '文档推荐位,推荐到多个位置KEY值相加即可', '1379053380', '1379235329', '1', '1:列表推荐\r\n2:频道推荐\r\n4:首页推荐', '3'); INSERT INTO `heilphp_config` VALUES ('12', 'DOCUMENT_DISPLAY', '3', '文档可见性', '2', '', '文章可见性仅影响前台显示,后台不收影响', '1379056370', '1379235322', '1', '0:所有人可见\r\n1:仅注册会员可见\r\n2:仅管理员可见', '4'); INSERT INTO `heilphp_config` VALUES ('20', 'CONFIG_GROUP_LIST', '3', '配置分组', '4', '', '配置分组', '1379228036', '1384418383', '1', '1:基本\r\n2:内容\r\n3:用户\r\n4:系统', '4'); INSERT INTO `heilphp_config` VALUES ('21', 'HOOKS_TYPE', '3', '钩子的类型', '4', '', '类型 1-用于扩展显示内容,2-用于扩展业务处理', '1379313397', '1379313407', '1', '1:视图\r\n2:控制器', '6'); INSERT INTO `heilphp_config` VALUES ('23', 'OPEN_DRAFTBOX', '4', '是否开启草稿功能', '2', '0:关闭草稿功能\r\n1:开启草稿功能\r\n', '新增文章时的草稿功能配置', '1379484332', '1379484591', '1', '1', '1'); INSERT INTO `heilphp_config` VALUES ('24', 'DRAFT_AOTOSAVE_INTERVAL', '0', '自动保存草稿时间', '2', '', '自动保存草稿的时间间隔,单位:秒', '1379484574', '1386143323', '1', '60', '2'); INSERT INTO `heilphp_config` VALUES ('25', 'LIST_ROWS', '0', '后台每页记录数', '2', '', '后台数据每页显示记录数', '1379503896', '1380427745', '1', '10', '10'); INSERT INTO `heilphp_config` VALUES ('26', 'USER_ALLOW_REGISTER', '4', '是否允许用户注册', '3', '0:关闭注册\r\n1:允许注册', '是否开放用户注册', '1379504487', '1379504580', '1', '1', '3'); INSERT INTO `heilphp_config` VALUES ('27', 'CODEMIRROR_THEME', '4', '预览插件的CodeMirror主题', '4', '3024-day:3024 day\r\n3024-night:3024 night\r\nambiance:ambiance\r\nbase16-dark:base16 dark\r\nbase16-light:base16 light\r\nblackboard:blackboard\r\ncobalt:cobalt\r\neclipse:eclipse\r\nelegant:elegant\r\nerlang-dark:erlang-dark\r\nlesser-dark:lesser-dark\r\nmidnight:midnight', '详情见CodeMirror官网', '1379814385', '1384740813', '1', 'ambiance', '3'); INSERT INTO `heilphp_config` VALUES ('28', 'DATA_BACKUP_PATH', '1', '数据库备份根路径', '4', '', '路径必须以 / 结尾', '1381482411', '1381482411', '1', './Data/', '5'); INSERT INTO `heilphp_config` VALUES ('29', 'DATA_BACKUP_PART_SIZE', '0', '数据库备份卷大小', '4', '', '该值用于限制压缩后的分卷最大长度。单位:B;建议设置20M', '1381482488', '1381729564', '1', '20971520', '7'); INSERT INTO `heilphp_config` VALUES ('30', 'DATA_BACKUP_COMPRESS', '4', '数据库备份文件是否启用压缩', '4', '0:不压缩\r\n1:启用压缩', '压缩备份文件需要PHP环境支持gzopen,gzwrite函数', '1381713345', '1381729544', '1', '1', '9'); INSERT INTO `heilphp_config` VALUES ('31', 'DATA_BACKUP_COMPRESS_LEVEL', '4', '数据库备份文件压缩级别', '4', '1:普通\r\n4:一般\r\n9:最高', '数据库备份文件的压缩级别,该配置在开启压缩时生效', '1381713408', '1381713408', '1', '9', '10'); INSERT INTO `heilphp_config` VALUES ('32', 'DEVELOP_MODE', '4', '开启开发者模式', '4', '0:关闭\r\n1:开启', '是否开启开发者模式', '1383105995', '1383291877', '1', '1', '11'); INSERT INTO `heilphp_config` VALUES ('33', 'ALLOW_VISIT', '3', '不受限控制器方法', '0', '', '', '1386644047', '1386644741', '1', '0:article/draftbox\r\n1:article/mydocument\r\n2:Category/tree\r\n3:Index/verify\r\n4:file/upload\r\n5:file/download\r\n6:user/updatePassword\r\n7:user/updateNickname\r\n8:user/submitPassword\r\n9:user/submitNickname\r\n10:file/uploadpicture', '0'); INSERT INTO `heilphp_config` VALUES ('34', 'DENY_VISIT', '3', '超管专限控制器方法', '0', '', '仅超级管理员可访问的控制器方法', '1386644141', '1386644659', '1', '0:Addons/addhook\r\n1:Addons/edithook\r\n2:Addons/delhook\r\n3:Addons/updateHook\r\n4:Admin/getMenus\r\n5:Admin/recordList\r\n6:Authmanager/updateRules\r\n7:Authmanager/tree', '0'); INSERT INTO `heilphp_config` VALUES ('36', 'ADMIN_ALLOW_IP', '2', '后台允许访问IP', '4', '', '多个用逗号分隔,如果不配置表示不限制IP访问', '1387165454', '1387165553', '1', '', '12'); -- ----------------------------- -- Table structure for `heilphp_member` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_member`; CREATE TABLE `heilphp_member` ( `uid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', `nickname` char(30) NOT NULL DEFAULT '' COMMENT '昵称', `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别(0:未知/保密 1:男 2:女)', `birthday` date NOT NULL DEFAULT '1000-01-01' COMMENT '生日', `qq` char(15) NOT NULL DEFAULT '' COMMENT 'qq号', `score` mediumint(8) NOT NULL DEFAULT '0' COMMENT '用户积分', `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数', `reg_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册时间', `reg_ip` bigint(20) NOT NULL DEFAULT '0' COMMENT '注册IP', `last_login_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间', `last_login_ip` bigint(20) NOT NULL DEFAULT '0' COMMENT '最后登录IP', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '会员状态', `delete_time` bigint(10) unsigned DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`uid`), KEY `status` (`status`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='会员表'; -- ----------------------------- -- Table structure for `heilphp_auth_extend` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_auth_extend`; CREATE TABLE `heilphp_auth_extend` ( `group_id` mediumint(8) unsigned NOT NULL COMMENT '用户组id', `extend_id` mediumint(8) unsigned NOT NULL COMMENT '扩展表中数据的id', `type` tinyint(1) unsigned NOT NULL COMMENT '扩展类型标识 1:栏目分类权限;2:模型权限', UNIQUE KEY `group_extend_type` (`group_id`,`extend_id`,`type`), KEY `uid` (`group_id`), KEY `group_id` (`extend_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户组与分类的对应关系表'; -- ----------------------------- -- Table structure for `heilphp_auth_group` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_auth_group`; CREATE TABLE `heilphp_auth_group` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户组id,自增主键', `module` varchar(30) NOT NULL DEFAULT '' COMMENT '用户组所属模块', `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '组类型', `title` char(30) NOT NULL DEFAULT '' COMMENT '用户组中文名称', `description` varchar(80) NOT NULL DEFAULT '' COMMENT '描述信息', `rules` text COMMENT '用户组拥有的规则id,多个规则 , 隔开', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '用户组状态 0:禁用 1:可用', `delete_time` bigint(10) unsigned DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ----------------------------- -- Records of `heilphp_auth_group` -- ----------------------------- INSERT INTO `heilphp_auth_group` VALUES ('1', 'admin', '1', '默认用户组', '','','1',null); INSERT INTO `heilphp_auth_group` VALUES ('2', 'admin', '1', '测试用户', '测试用户', '','1',null); -- ----------------------------- -- Table structure for `heilphp_auth_group_access` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_auth_group_access`; CREATE TABLE `heilphp_auth_group_access` ( `uid` int(10) unsigned NOT NULL COMMENT '用户id', `group_id` mediumint(8) unsigned NOT NULL COMMENT '用户组id', UNIQUE KEY `uid_group_id` (`uid`,`group_id`), KEY `uid` (`uid`), KEY `group_id` (`group_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- ----------------------------- -- Table structure for `heilphp_auth_rule` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_auth_rule`; CREATE TABLE `heilphp_auth_rule` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '规则id,自增主键', `module` varchar(20) NOT NULL COMMENT '规则所属module', `type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1-url;2-主菜单', `name` char(80) NOT NULL DEFAULT '' COMMENT '规则唯一英文标识', `title` char(30) NOT NULL DEFAULT '' COMMENT '规则中文描述', `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '规则状态 第2位(0:未删除 1:已删除) 第1位(0:禁用 1:可用)', `condition` varchar(300) NOT NULL DEFAULT '' COMMENT '规则附加条件', PRIMARY KEY (`id`), KEY `module` (`module`,`status`,`type`) ) ENGINE=MyISAM AUTO_INCREMENT=217 DEFAULT CHARSET=utf8; -- ----------------------------- -- Table structure for `heilphp_menu` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_menu`; CREATE TABLE `heilphp_menu` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '菜单ID', `title` varchar(50) NOT NULL DEFAULT '' COMMENT '标题', `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID', `sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序(同级有效)', `url` varchar(255) NOT NULL DEFAULT '' COMMENT '链接地址', `hide` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否隐藏 0:否 1:是', `tip` varchar(255) NOT NULL DEFAULT '' COMMENT '提示', `group` varchar(50) DEFAULT '' COMMENT '分组', `is_dev` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否仅开发者模式可见', `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态', PRIMARY KEY (`id`), KEY `pid` (`pid`), KEY `status` (`status`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- ----------------------------- -- Records of `heilphp_menu` -- ----------------------------- INSERT INTO `heilphp_menu` VALUES ('1', '首页', '0', '1', 'Index/index', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('2', '内容', '0', '2', 'Article/index', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('3', '文档列表', '2', '0', 'article/index', '1', '', '内容', '0','1'); INSERT INTO `heilphp_menu` VALUES ('4', '新增', '3', '0', 'article/add', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('5', '编辑', '3', '0', 'article/edit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('6', '改变状态', '3', '0', 'article/setStatus', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('7', '保存', '3', '0', 'article/update', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('8', '保存草稿', '3', '0', 'article/autoSave', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('9', '移动', '3', '0', 'article/move', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10', '复制', '3', '0', 'article/copy', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('11', '粘贴', '3', '0', 'article/paste', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('12', '导入', '3', '0', 'article/batchOperate', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('13', '回收站', '2', '0', 'article/recycle', '1', '', '内容', '0','1'); INSERT INTO `heilphp_menu` VALUES ('14', '还原', '13', '0', 'article/permit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('15', '清空', '13', '0', 'article/clear', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('16', '用户', '0', '3', 'User/index', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('17', '用户信息', '16', '0', 'User/index', '0', '', '用户管理', '0','1'); INSERT INTO `heilphp_menu` VALUES ('18', '新增用户', '17', '0', 'User/add', '0', '添加新用户', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('19', '用户行为', '16', '0', 'User/action', '0', '', '行为管理', '0','1'); INSERT INTO `heilphp_menu` VALUES ('20', '新增用户行为', '19', '0', 'User/addaction', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('21', '编辑用户行为', '19', '0', 'User/editaction', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('22', '保存用户行为', '19', '0', 'User/saveAction', '0', '\"用户->用户行为\"保存编辑和新增的用户行为', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('23', '变更行为状态', '19', '0', 'User/setStatus', '0', '\"用户->用户行为\"中的启用,禁用和删除权限', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('24', '禁用会员', '17', '0', 'User/changeStatus?method=forbidUser', '0', '\"用户->用户信息\"中的禁用', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('25', '启用会员', '17', '0', 'User/changeStatus?method=resumeUser', '0', '\"用户->用户信息\"中的启用', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('26', '删除会员', '17', '0', 'User/changeStatus?method=deleteUser', '0', '\"用户->用户信息\"中的删除', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('27', '权限管理', '16', '0', 'Authmanage/index', '0', '', '用户管理', '0','1'); INSERT INTO `heilphp_menu` VALUES ('28', '删除', '27', '0', 'Authmanage/changeStatus?method=deleteGroup', '0', '删除用户组', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('29', '禁用', '27', '0', 'Authmanage/changeStatus?method=forbidGroup', '0', '禁用用户组', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('30', '恢复', '27', '0', 'Authmanage/changeStatus?method=resumeGroup', '0', '恢复已禁用的用户组', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('31', '新增', '27', '0', 'Authmanage/createGroup', '0', '创建新的用户组', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('32', '编辑', '27', '0', 'Authmanage/editGroup', '0', '编辑用户组名称和描述', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('33', '保存用户组', '27', '0', 'Authmanage/writeGroup', '0', '新增和编辑用户组的\"保存\"按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('34', '授权', '27', '0', 'Authmanage/group', '0', '\"后台 \\ 用户 \\ 用户信息\"列表页的\"授权\"操作按钮,用于设置用户所属用户组', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('35', '访问授权', '27', '0', 'Authmanage/access', '0', '\"后台 \\ 用户 \\ 权限管理\"列表页的\"访问授权\"操作按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('36', '成员授权', '27', '0', 'Authmanage/user', '0', '\"后台 \\ 用户 \\ 权限管理\"列表页的\"成员授权\"操作按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('37', '解除授权', '27', '0', 'Authmanage/removeFromGroup', '0', '\"成员授权\"列表页内的解除授权操作按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('38', '保存成员授权', '27', '0', 'Authmanage/addToGroup', '0', '\"用户信息\"列表页\"授权\"时的\"保存\"按钮和\"成员授权\"里右上角的\"添加\"按钮)', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('39', '分类授权', '27', '0', 'Authmanage/category', '0', '\"后台 \\ 用户 \\ 权限管理\"列表页的\"分类授权\"操作按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('40', '保存分类授权', '27', '0', 'Authmanage/addToCategory', '0', '\"分类授权\"页面的\"保存\"按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('41', '模型授权', '27', '0', 'Authmanage/modelauth', '0', '\"后台 \\ 用户 \\ 权限管理\"列表页的\"模型授权\"操作按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('42', '保存模型授权', '27', '0', 'Authmanage/addToModel', '0', '\"分类授权\"页面的\"保存\"按钮', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('43', '扩展', '0', '7', 'Addons/index', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('44', '插件管理', '43', '1', 'Addons/index', '0', '', '扩展', '0','1'); INSERT INTO `heilphp_menu` VALUES ('45', '创建', '44', '0', 'Addons/create', '0', '服务器上创建插件结构向导', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('46', '检测创建', '44', '0', 'Addons/checkForm', '0', '检测插件是否可以创建', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('47', '预览', '44', '0', 'Addons/preview', '0', '预览插件定义类文件', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('48', '快速生成插件', '44', '0', 'Addons/build', '0', '开始生成插件结构', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('49', '设置', '44', '0', 'Addons/config', '0', '设置插件配置', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('50', '禁用', '44', '0', 'Addons/disable', '0', '禁用插件', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('51', '启用', '44', '0', 'Addons/enable', '0', '启用插件', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('52', '安装', '44', '0', 'Addons/install', '0', '安装插件', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('53', '卸载', '44', '0', 'Addons/uninstall', '0', '卸载插件', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('54', '更新配置', '44', '0', 'Addons/saveconfig', '0', '更新插件配置处理', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('55', '插件后台列表', '44', '0', 'Addons/adminList', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('56', 'URL方式访问插件', '44', '0', 'Addons/execute', '0', '控制是否有权限通过url访问插件控制器方法', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('57', '钩子管理', '43', '2', 'Addons/hooks', '0', '', '扩展', '0','1'); INSERT INTO `heilphp_menu` VALUES ('58', '模型管理', '68', '3', 'modelmanage/index', '0', '', '系统设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('59', '新增', '58', '0', 'modelmanage/add', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('60', '编辑', '58', '0', 'modelmanage/edit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('61', '改变状态', '58', '0', 'modelmanage/setStatus', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('62', '保存数据', '58', '0', 'modelmanage/update', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('63', '属性管理', '68', '0', 'Attribute/index', '1', '网站属性配置。', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('64', '新增', '63', '0', 'Attribute/add', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('65', '编辑', '63', '0', 'Attribute/edit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('66', '改变状态', '63', '0', 'Attribute/setStatus', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('67', '保存数据', '63', '0', 'Attribute/update', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('68', '系统', '0', '4', 'Config/group', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('69', '网站设置', '68', '1', 'Config/group', '0', '', '系统设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('70', '配置管理', '68', '4', 'Config/index', '0', '', '系统设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('71', '编辑', '70', '0', 'Config/edit', '0', '新增编辑和保存配置', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('72', '删除', '70', '0', 'Config/del', '0', '删除配置', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('73', '新增', '70', '0', 'Config/add', '0', '新增配置', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('74', '保存', '70', '0', 'Config/save', '0', '保存配置', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('75', '菜单管理', '68', '5', 'Menu/index', '0', '', '系统设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('76', '导航管理', '68', '6', 'Channel/index', '0', '', '系统设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('77', '新增', '76', '0', 'Channel/add', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('78', '编辑', '76', '0', 'Channel/edit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('79', '删除', '76', '0', 'Channel/del', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('80', '分类管理', '68', '2', 'Category/index', '0', '', '系统设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('81', '编辑', '80', '0', 'Category/edit', '0', '编辑和保存栏目分类', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('82', '新增', '80', '0', 'Category/add', '0', '新增栏目分类', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('83', '删除', '80', '0', 'Category/remove', '0', '删除栏目分类', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('84', '移动', '80', '0', 'Category/operate/type/move', '0', '移动栏目分类', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('85', '合并', '80', '0', 'Category/operate/type/merge', '0', '合并栏目分类', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('86', '备份数据库', '68', '0', 'Datamanage/index?type=export', '0', '', '数据备份', '0','1'); INSERT INTO `heilphp_menu` VALUES ('87', '备份', '86', '0', 'Datamanage/export', '0', '备份数据库', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('88', '优化表', '86', '0', 'Datamanage/optimize', '0', '优化数据表', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('89', '修复表', '86', '0', 'Datamanage/repair', '0', '修复数据表', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('90', '还原数据库', '68', '0', 'Datamanage/index?type=import', '0', '', '数据备份', '0','1'); INSERT INTO `heilphp_menu` VALUES ('91', '恢复', '90', '0', 'Datamanage/import', '0', '数据库恢复', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('92', '删除', '90', '0', 'Datamanage/del', '0', '删除备份文件', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('93', '其他', '0', '5', 'other', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('96', '新增', '75', '0', 'Menu/add', '0', '', '系统设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('98', '编辑', '75', '0', 'Menu/edit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('106', '行为日志', '16', '0', 'Action/log', '0', '', '行为管理', '0','1'); INSERT INTO `heilphp_menu` VALUES ('108', '修改密码', '16', '0', 'User/editPassword', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('109', '修改昵称', '16', '0', 'User/editNickname', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('110', '查看行为日志', '106', '0', 'action/detail', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('111', '删除行为日志', '106', '0', 'action/remove', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('112', '新增数据', '58', '0', 'think/add', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('113', '编辑数据', '58', '0', 'think/edit', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('114', '导入', '75', '0', 'Menu/import', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('115', '生成', '58', '0', 'modelmanage/generate', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('116', '新增钩子', '57', '0', 'Addons/addHook', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('117', '编辑钩子', '57', '0', 'Addons/edithook', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('118', '文档排序', '3', '0', 'Article/sort', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('119', '排序', '70', '0', 'Config/sort', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('120', '排序', '75', '0', 'Menu/sort', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('121', '排序', '76', '0', 'Channel/sort', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('122', '数据列表', '58', '0', 'think/lists', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('123', '审核列表', '3', '0', 'Article/examine', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10000', '站点', '0', '7', 'seo/index', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10001', 'SEO设置', '10000', '0', 'seo/index', '0', '', '通用设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10002', '新增', '10001', '0', 'seo/add', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10003', '编辑', '10001', '0', 'seo/edit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10004', '启用', '10001', '0', 'seo/changeStatus?method=resume', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10005', '禁用', '10001', '0', 'seo/changeStatus?method=forbid', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10006', '删除', '10001', '0', 'seo/changeStatus?method=delete', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10007', '排序', '10001', '0', 'seo/sort', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10101', '广告位', '10000', '0', 'ad_position/index', '0', '', '通用设置', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10102', '新增', '10101', '0', 'adPosition/add', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10103', '编辑', '10101', '0', 'adPosition/edit', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10104', '启用', '10101', '0', 'adPosition/changeStatus?method=resume', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10105', '禁用', '10101', '0', 'adPosition/changeStatus?method=forbid', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10106', '删除', '10101', '0', 'adPosition/changeStatus?method=delete', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10107', '排序', '10101', '0', 'adPosition/sort', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10201', '广告', '10000', '0', 'ad/index', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10202', '新增', '10201', '0', 'ad/add', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10203', '编辑', '10201', '0', 'ad/edit', '0', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10204', '启用', '10201', '0', 'ad/changeStatus?method=resume', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10205', '禁用', '10201', '0', 'ad/changeStatus?method=forbid', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10206', '删除', '10201', '0', 'ad/changeStatus?method=delete', '1', '', '', '0','1'); INSERT INTO `heilphp_menu` VALUES ('10207', '排序', '10201', '0', 'ad/sort', '1', '', '', '0','1'); -- ----------------------------- -- Table structure for `heilphp_addons` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_addons`; CREATE TABLE `heilphp_addons` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(40) NOT NULL COMMENT '插件名或标识', `title` varchar(20) NOT NULL DEFAULT '' COMMENT '中文名', `description` text COMMENT '插件描述', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态', `config` text COMMENT '配置', `author` varchar(40) DEFAULT '' COMMENT '作者', `version` varchar(20) DEFAULT '' COMMENT '版本号', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '安装时间', `has_adminlist` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否有后台列表', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='插件表'; -- ----------------------------- -- Records of `heilphp_addons` -- ----------------------------- INSERT INTO `heilphp_addons` VALUES ('2', 'SiteStat', '站点统计信息', '统计站点的基础信息', '1', '{\"title\":\"\\u7cfb\\u7edf\\u4fe1\\u606f\",\"width\":\"1\",\"display\":\"1\",\"status\":\"0\"}', 'thinkphp', '0.1', '1379512015', '0'); INSERT INTO `heilphp_addons` VALUES ('3', 'DevTeam', '开发团队信息', '开发团队成员信息', '1', '{\"title\":\"OneThink\\u5f00\\u53d1\\u56e2\\u961f\",\"width\":\"2\",\"display\":\"1\"}', 'thinkphp', '0.1', '1379512022', '0'); INSERT INTO `heilphp_addons` VALUES ('4', 'SystemInfo', '系统环境信息', '用于显示一些服务器的信息', '1', '{\"title\":\"\\u7cfb\\u7edf\\u4fe1\\u606f\",\"width\":\"2\",\"display\":\"1\"}', 'thinkphp', '0.1', '1379512036', '0'); INSERT INTO `heilphp_addons` VALUES ('15', 'EditorForAdmin', '后台编辑器', '用于增强整站长文本的输入和显示', '1', '{\"editor_type\":\"2\",\"editor_wysiwyg\":\"1\",\"editor_height\":\"500px\",\"editor_resize_type\":\"1\"}', 'thinkphp', '0.1', '1383126253', '0'); INSERT INTO `heilphp_addons` VALUES ('16', 'Uploader', '文件上传工具', '用于文件上传', '1', '', 'HeilPHP', '0.1', '1536277835', '0'); INSERT INTO `heilphp_addons` VALUES ('17', 'MapBuilder', '地图构建器', '用于构建第三方地图', '1', '', 'HeilPHP', '0.1', '1536752372', '0'); -- ----------------------------- -- Table structure for `heilphp_hooks` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_hooks`; CREATE TABLE `heilphp_hooks` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(40) NOT NULL DEFAULT '' COMMENT '钩子名称', `description` text NULL COMMENT '描述', `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '类型', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `addons` varchar(255) NOT NULL DEFAULT '' COMMENT '钩子挂载的插件 '',''分割', `status` tinyint(1) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; -- ----------------------------- -- Records of `heilphp_hooks` -- ----------------------------- INSERT INTO `heilphp_hooks` VALUES ('1', 'pageHeader', '页面header钩子,一般用于加载插件CSS文件和代码', '1', '0', '', '1'); INSERT INTO `heilphp_hooks` VALUES ('2', 'pageFooter', '页面footer钩子,一般用于加载插件JS文件和JS代码', '1', '0', 'ReturnTop', '1'); INSERT INTO `heilphp_hooks` VALUES ('3', 'documentEditForm', '添加编辑表单的 扩展内容钩子', '1', '0', 'Attachment', '1'); INSERT INTO `heilphp_hooks` VALUES ('4', 'documentDetailAfter', '文档末尾显示', '1', '0', 'Attachment,SocialComment', '1'); INSERT INTO `heilphp_hooks` VALUES ('5', 'documentDetailBefore', '页面内容前显示用钩子', '1', '0', '', '1'); INSERT INTO `heilphp_hooks` VALUES ('6', 'documentSaveComplete', '保存文档数据后的扩展钩子', '2', '0', 'Attachment', '1'); INSERT INTO `heilphp_hooks` VALUES ('7', 'documentEditFormContent', '添加编辑表单的内容显示钩子', '1', '0', 'Editor', '1'); INSERT INTO `heilphp_hooks` VALUES ('8', 'adminArticleEdit', '后台内容编辑页编辑器', '1', '1378982734', 'EditorForAdmin', '1'); INSERT INTO `heilphp_hooks` VALUES ('13', 'adminIndex', '首页小格子个性化显示', '1', '1382596073', 'SiteStat,SystemInfo,DevTeam', '1'); INSERT INTO `heilphp_hooks` VALUES ('14', 'topicComment', '评论提交方式扩展钩子。', '1', '1380163518', 'Editor', '1'); INSERT INTO `heilphp_hooks` VALUES ('16', 'app_begin', '应用开始', '2', '1384481614', '', '1'); INSERT INTO `heilphp_hooks` VALUES ('17', 'fileUploader', '文件上传工具初始化钩子', '1', '1384481614','Uploader', '1'); INSERT INTO `heilphp_hooks` VALUES ('18', 'getCoordinate', '获取地理位置坐标钩子', '1', '1536752443','MapBuilder', '1'); -- ----------------------------- -- Table structure for `heilphp_action` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_action`; CREATE TABLE `heilphp_action` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '行为唯一标识', `title` varchar(80) NOT NULL DEFAULT '' COMMENT '行为说明', `remark` varchar(140) NOT NULL DEFAULT '' COMMENT '行为描述', `rule` text NULL COMMENT '行为规则', `log` text NULL COMMENT '日志规则', `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '类型', `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', `delete_time` bigint(10) unsigned DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='系统行为表'; -- ----------------------------- -- Records of `heilphp_action` -- ----------------------------- INSERT INTO `heilphp_action` VALUES ('1', 'user_login', '用户登录', '积分+10,每天一次', 'table:member|field:score|condition:uid={$self} AND status>-1|rule:score+10|cycle:24|max:1;', '[user|get_nickname]在[time|time_format]登录了后台', '1', '1', '1387181220',null); INSERT INTO `heilphp_action` VALUES ('2', 'add_article', '发布文章', '积分+5,每天上限5次', 'table:member|field:score|condition:uid={$self}|rule:score+5|cycle:24|max:5', '', '2', '0', '1380173180',null); INSERT INTO `heilphp_action` VALUES ('3', 'review', '评论', '评论积分+1,无限制', 'table:member|field:score|condition:uid={$self}|rule:score+1', '', '2', '1', '1383285646',null); INSERT INTO `heilphp_action` VALUES ('4', 'add_document', '发表文档', '积分+10,每天上限5次', 'table:member|field:score|condition:uid={$self}|rule:score+10|cycle:24|max:5', '[user|get_nickname]在[time|time_format]发表了一篇文章。\r\n表[model],记录编号[record]。', '2', '0', '1386139726',null); INSERT INTO `heilphp_action` VALUES ('5', 'add_document_topic', '发表讨论', '积分+5,每天上限10次', 'table:member|field:score|condition:uid={$self}|rule:score+5|cycle:24|max:10', '', '2', '0', '1383285551',null); INSERT INTO `heilphp_action` VALUES ('6', 'update_config', '更新配置', '新增或修改或删除配置', '', '', '1', '1', '1383294988',null); INSERT INTO `heilphp_action` VALUES ('7', 'update_model', '更新模型', '新增或修改模型', '', '', '1', '1', '1383295057',null); INSERT INTO `heilphp_action` VALUES ('8', 'update_attribute', '更新属性', '新增或更新或删除属性', '', '', '1', '1', '1383295963',null); INSERT INTO `heilphp_action` VALUES ('9', 'update_channel', '更新导航', '新增或修改或删除导航', '', '', '1', '1', '1383296301',null); INSERT INTO `heilphp_action` VALUES ('10', 'update_menu', '更新菜单', '新增或修改或删除菜单', '', '', '1', '1', '1383296392',null); INSERT INTO `heilphp_action` VALUES ('11', 'update_category', '更新分类', '新增或修改或删除分类', '', '', '1', '1', '1383296765',null); -- ----------------------------- -- Table structure for `heilphp_action_log` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_action_log`; CREATE TABLE `heilphp_action_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `action_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '行为id', `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '执行用户id', `action_ip` bigint(20) NOT NULL COMMENT '执行行为者ip', `model` varchar(50) NOT NULL DEFAULT '' COMMENT '触发行为的表', `record_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '触发行为的数据id', `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '日志备注', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '执行行为的时间', PRIMARY KEY (`id`), KEY `action_ip_ix` (`action_ip`), KEY `action_id_ix` (`action_id`), KEY `user_id_ix` (`user_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='行为日志表'; -- ----------------------------- -- Table structure for `heilphp_model` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_model`; CREATE TABLE `heilphp_model` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '模型ID', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '模型标识', `title` varchar(30) NOT NULL DEFAULT '' COMMENT '模型名称', `extend` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '继承的模型', `relation` varchar(30) NOT NULL DEFAULT '' COMMENT '继承与被继承模型的关联字段', `need_pk` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '新建表时是否需要主键字段', `field_sort` text NULL COMMENT '表单字段排序', `field_group` varchar(255) NOT NULL DEFAULT '1:基础' COMMENT '字段分组', `attribute_list` text NULL COMMENT '属性列表(表的字段)', `attribute_alias` varchar(255) NOT NULL DEFAULT '' COMMENT '属性别名定义', `template_list` varchar(100) NOT NULL DEFAULT '' COMMENT '列表模板', `template_add` varchar(100) NOT NULL DEFAULT '' COMMENT '新增模板', `template_edit` varchar(100) NOT NULL DEFAULT '' COMMENT '编辑模板', `list_grid` text NULL COMMENT '列表定义', `list_row` smallint(2) unsigned NOT NULL DEFAULT '10' COMMENT '列表数据长度', `search_key` varchar(50) NOT NULL DEFAULT '' COMMENT '默认搜索字段', `search_list` varchar(255) NOT NULL DEFAULT '' COMMENT '高级搜索的字段', `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态', `engine_type` varchar(25) NOT NULL DEFAULT 'MyISAM' COMMENT '数据库引擎', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='文档模型表'; -- ----------------------------- -- Records of `heilphp_model` -- ----------------------------- INSERT INTO `heilphp_model` VALUES ('1', 'document', '基础文档', '0', '', '1', '{\"1\":[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\",\"20\",\"21\",\"22\"]}', '1:基础', '', '','', '', '', 'id:编号\r\ntitle:标题:[EDIT]\r\ntype:类型\r\nupdate_time:最后更新\r\nstatus:状态\r\nview:浏览\r\nid:操作:[EDIT]|编辑,[DELETE]|删除', '0', '', '', '1383891233', '1384507827', '1', 'MyISAM'); INSERT INTO `heilphp_model` VALUES ('2', 'article', '文章', '1', '', '1', '{\"1\":[\"3\",\"24\",\"2\",\"5\"],\"2\":[\"9\",\"13\",\"19\",\"10\",\"12\",\"16\",\"17\",\"26\",\"20\",\"14\",\"11\",\"25\"]}', '1:基础,2:扩展', '','', '', '', '', '', '0', '', '', '1383891243', '1387260622', '1', 'MyISAM'); INSERT INTO `heilphp_model` VALUES ('3', 'download', '下载', '1', '', '1', '{\"1\":[\"3\",\"28\",\"30\",\"32\",\"2\",\"5\",\"31\"],\"2\":[\"13\",\"10\",\"27\",\"9\",\"12\",\"16\",\"17\",\"19\",\"11\",\"20\",\"14\",\"29\"]}', '1:基础,2:扩展', '', '','', '', '', '', '0', '', '', '1383891252', '1387260449', '1', 'MyISAM'); -- ----------------------------- -- Table structure for `heilphp_attribute` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_attribute`; CREATE TABLE `heilphp_attribute` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL DEFAULT '' COMMENT '字段名', `title` varchar(100) NOT NULL DEFAULT '' COMMENT '字段注释', `field` varchar(100) NOT NULL DEFAULT '' COMMENT '字段定义', `type` varchar(20) NOT NULL DEFAULT '' COMMENT '数据类型', `value` varchar(100) NOT NULL DEFAULT '' COMMENT '字段默认值', `remark` varchar(100) NOT NULL DEFAULT '' COMMENT '备注', `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示', `extra` varchar(255) NOT NULL DEFAULT '' COMMENT '参数', `model_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '模型id', `is_must` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否必填', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `validate_rule` varchar(255) NOT NULL DEFAULT '', `validate_time` tinyint(1) unsigned NOT NULL DEFAULT '0', `error_info` varchar(100) NOT NULL DEFAULT '', `validate_type` varchar(25) NOT NULL DEFAULT '', `auto_rule` varchar(100) NOT NULL DEFAULT '', `auto_time` tinyint(1) unsigned NOT NULL DEFAULT '0', `auto_type` varchar(25) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `model_id` (`model_id`) ) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='模型属性表'; -- ----------------------------- -- Records of `heilphp_attribute` -- ----------------------------- INSERT INTO `heilphp_attribute` VALUES ('1', 'uid', '用户ID', 'int(10) unsigned NOT NULL ', 'num', '0', '', '0', '', '1', '0', '1', '1383891233', '1384508362','', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('2', 'name', '标识', 'char(40) NOT NULL ', 'string', '', '同一根节点下标识不重复', '1', '', '1', '0', '1', '1383891233', '1383894743', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('3', 'title', '标题', 'char(80) NOT NULL ', 'string', '', '文档标题', '1', '', '1', '0', '1', '1383891233', '1383894778', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('4', 'category_id', '所属分类', 'int(10) unsigned NOT NULL ', 'string', '', '', '0', '', '1', '0', '1', '1383891233', '1384508336', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('5', 'description', '描述', 'char(140) NOT NULL ', 'textarea', '', '', '1', '', '1', '0', '1', '1383891233', '1383894927', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('6', 'root', '根节点', 'int(10) unsigned NOT NULL ', 'num', '0', '该文档的顶级文档编号', '0', '', '1', '0', '1', '1383891233', '1384508323', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('7', 'pid', '所属ID', 'int(10) unsigned NOT NULL ', 'num', '0', '父文档编号', '0', '', '1', '0', '1', '1383891233', '1384508543', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('8', 'model_id', '内容模型ID', 'tinyint(3) unsigned NOT NULL ', 'num', '0', '该文档所对应的模型', '0', '', '1', '0', '1', '1383891233', '1384508350', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('9', 'type', '内容类型', 'tinyint(3) unsigned NOT NULL ', 'select', '2', '', '1', '1:目录\r\n2:主题\r\n3:段落', '1', '0', '1', '1383891233', '1384511157', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('10', 'position', '推荐位', 'smallint(5) unsigned NOT NULL ', 'checkbox', '0', '多个推荐则将其推荐值相加', '1', '[DOCUMENT_POSITION]', '1', '0', '1', '1383891233', '1383895640', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('11', 'link_id', '外链', 'int(10) unsigned NOT NULL ', 'num', '0', '0-非外链,大于0-外链ID,需要函数进行链接与编号的转换', '1', '', '1', '0', '1', '1383891233', '1383895757', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('12', 'cover_id', '封面', 'int(10) unsigned NOT NULL ', 'picture', '0', '0-无封面,大于0-封面图片ID,需要函数处理', '1', '', '1', '0', '1', '1383891233', '1384147827', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('13', 'display', '可见性', 'tinyint(3) unsigned NOT NULL ', 'radio', '1', '', '1', '0:不可见\r\n1:所有人可见', '1', '0', '1', '1383891233', '1386662271', '', '0', '', 'regex', '', '0', 'function'); INSERT INTO `heilphp_attribute` VALUES ('14', 'deadline', '截至时间', 'int(10) unsigned NOT NULL ', 'datetime', '0', '0-永久有效', '1', '', '1', '0', '1', '1383891233', '1387163248', '', '0', '', 'regex', '', '0', 'function'); INSERT INTO `heilphp_attribute` VALUES ('15', 'attach', '附件数量', 'tinyint(3) unsigned NOT NULL ', 'num', '0', '', '0', '', '1', '0', '1', '1383891233', '1387260355', '', '0', '', 'regex', '', '0', 'function'); INSERT INTO `heilphp_attribute` VALUES ('16', 'view', '浏览量', 'int(10) unsigned NOT NULL ', 'num', '0', '', '1', '', '1', '0', '1', '1383891233', '1383895835', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('17', 'comment', '评论数', 'int(10) unsigned NOT NULL ', 'num', '0', '', '1', '', '1', '0', '1', '1383891233', '1383895846', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('18', 'extend', '扩展统计字段', 'int(10) unsigned NOT NULL ', 'num', '0', '根据需求自行使用', '0', '', '1', '0', '1', '1383891233', '1384508264', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('19', 'level', '优先级', 'int(10) unsigned NOT NULL ', 'num', '0', '越高排序越靠前', '1', '', '1', '0', '1', '1383891233', '1383895894', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('20', 'create_time', '创建时间', 'int(10) unsigned NOT NULL ', 'datetime', '0', '', '1', '', '1', '0', '1', '1383891233', '1383895903', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('21', 'update_time', '更新时间', 'int(10) unsigned NOT NULL ', 'datetime', '0', '', '0', '', '1', '0', '1', '1383891233', '1384508277', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('22', 'status', '数据状态', 'tinyint(4) NOT NULL ', 'radio', '0', '', '0', '-1:删除\r\n0:禁用\r\n1:正常\r\n2:待审核\r\n3:草稿', '1', '0', '1', '1383891233', '1384508496', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('23', 'parse', '内容解析类型', 'tinyint(3) unsigned NOT NULL ', 'select', '0', '', '0', '0:html\r\n1:ubb\r\n2:markdown', '2', '0', '1', '1383891243', '1384511049', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('24', 'content', '文章内容', 'text NOT NULL ', 'editor', '', '', '1', '', '2', '0', '1', '1383891243', '1383896225', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('25', 'template', '详情页显示模板', 'varchar(100) NOT NULL ', 'string', '', '参照display方法参数的定义', '1', '', '2', '0', '1', '1383891243', '1383896190', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('26', 'bookmark', '收藏数', 'int(10) unsigned NOT NULL ', 'num', '0', '', '1', '', '2', '0', '1', '1383891243', '1383896103', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('27', 'parse', '内容解析类型', 'tinyint(3) unsigned NOT NULL ', 'select', '0', '', '0', '0:html\r\n1:ubb\r\n2:markdown', '3', '0', '1', '1383891252', '1387260461', '', '0', '', 'regex', '', '0', 'function'); INSERT INTO `heilphp_attribute` VALUES ('28', 'content', '下载详细描述', 'text NOT NULL ', 'editor', '', '', '1', '', '3', '0', '1', '1383891252', '1383896438', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('29', 'template', '详情页显示模板', 'varchar(100) NOT NULL ', 'string', '', '', '1', '', '3', '0', '1', '1383891252', '1383896429', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('30', 'file_id', '文件ID', 'int(10) unsigned NOT NULL ', 'file', '0', '需要函数处理', '1', '', '3', '0', '1', '1383891252', '1383896415', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('31', 'download', '下载次数', 'int(10) unsigned NOT NULL ', 'num', '0', '', '1', '', '3', '0', '1', '1383891252', '1383896380', '', '0', '', '', '', '0', ''); INSERT INTO `heilphp_attribute` VALUES ('32', 'size', '文件大小', 'bigint(20) unsigned NOT NULL ', 'num', '0', '单位bit', '1', '', '3', '0', '1', '1383891252', '1383896371', '', '0', '', '', '', '0', ''); -- ----------------------------- -- Table structure for `heilphp_category` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_category`; CREATE TABLE `heilphp_category` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类ID', `name` varchar(30) NOT NULL COMMENT '标志', `title` varchar(50) NOT NULL COMMENT '标题', `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID', `sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序(同级有效)', `list_row` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '列表每页行数', `meta_title` varchar(50) NOT NULL DEFAULT '' COMMENT 'SEO的网页标题', `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字', `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述', `template_index` varchar(100) NOT NULL DEFAULT '' COMMENT '频道页模板', `template_lists` varchar(100) NOT NULL DEFAULT '' COMMENT '列表页模板', `template_detail` varchar(100) NOT NULL DEFAULT '' COMMENT '详情页模板', `template_edit` varchar(100) NOT NULL DEFAULT '' COMMENT '编辑页模板', `model` varchar(100) NOT NULL DEFAULT '' COMMENT '列表绑定模型', `model_sub` varchar(100) NOT NULL DEFAULT '' COMMENT '子文档绑定模型', `type` varchar(100) NOT NULL DEFAULT '' COMMENT '允许发布的内容类型', `link_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '外链', `allow_publish` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否允许发布内容', `display` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '可见性', `reply` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否允许回复', `check` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '发布的文章是否需要审核', `reply_model` varchar(100) NOT NULL DEFAULT '', `extend` text NULL COMMENT '扩展设置', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '数据状态', `icon` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '分类图标', `groups` varchar(255) NOT NULL DEFAULT '' COMMENT '分组定义', PRIMARY KEY (`id`), UNIQUE KEY `uk_name` (`name`), KEY `pid` (`pid`) ) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='分类表'; -- ----------------------------- -- Records of `heilphp_category` -- ----------------------------- INSERT INTO `heilphp_category` VALUES ('1', 'blog', '博客', '0', '0', '10', '', '', '', '', '', '', '', '2,3','2', '2,1', '0', '0', '1', '0', '0', '1', '', '1379474947', '1382701539', '1', '0',''); INSERT INTO `heilphp_category` VALUES ('2', 'default_blog', '默认分类', '1', '1', '10', '', '', '', '', '', '', '', '2,3','2', '2,1,3', '0', '1', '1', '0', '1', '1', '', '1379475028', '1386839751', '1', '0',''); -- ----------------------------- -- Table structure for `heilphp_document` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_document`; CREATE TABLE `heilphp_document` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '文档ID', `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', `name` varchar(40) NOT NULL DEFAULT '' COMMENT '标识', `title` varchar(80) NOT NULL DEFAULT '' COMMENT '标题', `category_id` int(10) unsigned NOT NULL COMMENT '所属分类', `group_id` mediumint(8) unsigned NOT NULL COMMENT '所属分组', `description` varchar(140) NOT NULL DEFAULT '' COMMENT '描述', `root` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '根节点', `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属ID', `model_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '内容模型ID', `type` tinyint(3) unsigned NOT NULL DEFAULT '2' COMMENT '内容类型', `position` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '推荐位', `link_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '外链', `cover_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '封面', `display` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '可见性', `deadline` bigint(10) unsigned DEFAULT NULL COMMENT '截止时间', `attach` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '附件数量', `view` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '浏览量', `comment` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '评论数', `extend` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '扩展统计字段', `level` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '优先级', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '数据状态', `delete_time` bigint(10) unsigned DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`), KEY `idx_category_status` (`category_id`,`status`), KEY `idx_status_type_pid` (`status`,`uid`,`pid`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='文档模型基础表'; -- ----------------------------- -- Records of `heilphp_document` -- ----------------------------- INSERT INTO `heilphp_document` VALUES ('1', '1', '', 'HeilPHP0.01开发版发布', '2', '0','升级OneThink核心为ThinkPHP5.1', '0', '0', '2', '2', '0', '0', '0', '1', null, '0', '8', '0', '0', '0', '1406001413', '1406001413', '1',null); -- ----------------------------- -- Table structure for `heilphp_document_article` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_document_article`; CREATE TABLE `heilphp_document_article` ( `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '文档ID', `parse` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '内容解析类型', `content` text NOT NULL COMMENT '文章内容', `template` varchar(100) NOT NULL DEFAULT '' COMMENT '详情页显示模板', `bookmark` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收藏数', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档模型文章表'; -- ----------------------------- -- Records of `heilphp_document_article` -- ----------------------------- INSERT INTO `heilphp_document_article` VALUES ('1', '0', '<h1>\r\n HeilPHP0.01.1开发版发布&nbsp;\r\n</h1>\r\n<p>\r\n <br />\r\n</p>\r\n<p>\r\n <strong>HeilPHP是一个开源的内容管理框架,基于最新的ThinkPHP5.1版本和OneThink1.1版本开发,提供更方便、更安全的WEB应用开发体验,采用了全新的架构设计和命名空间机制,融合了模块化、驱动化和插件化的设计理念于一体,开启了国内WEB应用傻瓜式开发的新潮流。&nbsp;</strong> \r\n</p>\r\n<h2>\r\n 主要特性:\r\n</h2>\r\n<p>\r\n 1. 基于ThinkPHP最新5.1版本。\r\n</p>\r\n<p>\r\n 2. 模块化:全新的架构和模块化的开发机制,便于灵活扩展和二次开发。&nbsp;\r\n</p>\r\n<p>\r\n 3. 文档模型/分类体系:通过和文档模型绑定,以及不同的文档类型,不同分类可以实现差异化的功能,轻松实现诸如资讯、下载、讨论和图片等功能。\r\n</p>\r\n<p>\r\n 4. 开源免费:HeilPHP遵循Apache2开源协议,免费提供使用。&nbsp;\r\n</p>\r\n<p>\r\n 5. 用户行为:支持自定义用户行为,可以对单个用户或者群体用户的行为进行记录及分享,为您的运营决策提供有效参考数据。\r\n</p>\r\n<p>\r\n <br />\r\n</p>\r\n<p>\r\n <strong>&nbsp;HeilPHP集成了一个完善的后台管理体系和前台模板标签系统,让你轻松管理数据和进行前台网站的标签式开发。&nbsp;</strong> \r\n</p>\r\n<p>\r\n <br />\r\n</p>\r\n<h2>\r\n 后台主要功能:\r\n</h2>\r\n<p>\r\n 1. 用户Passport系统\r\n</p>\r\n<p>\r\n 2. 配置管理系统&nbsp;\r\n</p>\r\n<p>\r\n 3. 权限控制系统\r\n</p>\r\n<p>\r\n 4. 后台建模系统&nbsp;\r\n</p>\r\n<p>\r\n 5. 多级分类系统&nbsp;\r\n</p>\r\n<p>\r\n 6. 用户行为系统&nbsp;\r\n</p>\r\n<p>\r\n 7. 钩子和插件系统\r\n</p>\r\n<p>\r\n 8. 系统日志系统&nbsp;\r\n</p>\r\n<p>\r\n 9. 数据备份和还原\r\n</p>\r\n<p>\r\n <br />\r\n</p>\r\n<p>\r\n &nbsp; <br />\r\n</p>\r\n<p>\r\n <strong>HeilPHP开发团队 2018</strong> \r\n</p>', '', '0'); -- ----------------------------- -- Table structure for `heilphp_document_download` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_document_download`; CREATE TABLE `heilphp_document_download` ( `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '文档ID', `parse` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '内容解析类型', `content` text NOT NULL COMMENT '下载详细描述', `template` varchar(100) NOT NULL DEFAULT '' COMMENT '详情页显示模板', `file_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '文件ID', `download` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下载次数', `size` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '文件大小', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档模型下载表'; -- ----------------------------- -- Table structure for `heilphp_url` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_url`; CREATE TABLE `heilphp_url` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '链接唯一标识', `url` varchar(255) NOT NULL DEFAULT '' COMMENT '链接地址', `short` varchar(100) NOT NULL DEFAULT '' COMMENT '短网址', `status` tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '状态', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', PRIMARY KEY (`id`), UNIQUE KEY `idx_url` (`url`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='链接表'; -- ----------------------------- -- Table structure for `heilphp_channel` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_channel`; CREATE TABLE `heilphp_channel` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '频道ID', `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级频道ID', `title` varchar(30) NOT NULL COMMENT '频道标题', `url` varchar(100) NOT NULL COMMENT '频道连接', `sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '导航排序', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态', `target` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '新窗口打开', PRIMARY KEY (`id`), KEY `pid` (`pid`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT="频道表"; -- ----------------------------- -- Records of `heilphp_channel` -- ----------------------------- INSERT INTO `heilphp_channel` VALUES ('1', '0', '首页', 'Index/index', '1', '1379475111', '1379923177', '1', '0'); INSERT INTO `heilphp_channel` VALUES ('2', '0', '博客', 'Article/index?category=blog', '2', '1379475131', '1379483713', '1', '0'); INSERT INTO `heilphp_channel` VALUES ('3', '0', '官网', 'http://www.heilphp.com', '3', '1379475154', '1387163458', '1', '1'); -- ----------------------------- -- Table structure for `heilphp_ucenter_admin` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_ucenter_admin`; CREATE TABLE `heilphp_ucenter_admin` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员ID', `member_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员用户ID', `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '管理员状态', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='管理员表'; -- ----------------------------- -- Table structure for `heilphp_ucenter_app` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_ucenter_app`; CREATE TABLE `heilphp_ucenter_app` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '应用ID', `title` varchar(30) NOT NULL COMMENT '应用名称', `url` varchar(100) NOT NULL COMMENT '应用URL', `ip` char(15) NOT NULL DEFAULT '' COMMENT '应用IP', `auth_key` varchar(100) NOT NULL DEFAULT '' COMMENT '加密KEY', `sys_login` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '同步登陆', `allow_ip` varchar(255) NOT NULL DEFAULT '' COMMENT '允许访问的IP', `create_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '应用状态', PRIMARY KEY (`id`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='应用表'; -- ----------------------------- -- Table structure for `heilphp_ucenter_member` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_ucenter_member`; CREATE TABLE `heilphp_ucenter_member` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', `username` char(16) DEFAULT NULL COMMENT '用户名', `password` char(32) NOT NULL COMMENT '密码<PASSWORD>(字典排序)', `salt` char(10) DEFAULT NULL COMMENT '密码salt', `email` char(32) DEFAULT NULL COMMENT '用户邮箱', `mobile` char(15) DEFAULT NULL COMMENT '用户手机', `reg_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册时间', `reg_ip` bigint(20) NOT NULL DEFAULT '0' COMMENT '注册IP', `last_login_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间', `last_login_ip` bigint(20) NOT NULL DEFAULT '0' COMMENT '最后登录IP', `update_time` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `status` tinyint(4) DEFAULT '0' COMMENT '用户状态', PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`), UNIQUE KEY `mobile` (`mobile`), KEY `status` (`status`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='用户表'; -- ----------------------------- -- Table structure for `heilphp_ucenter_setting` -- ----------------------------- DROP TABLE IF EXISTS `heilphp_ucenter_setting`; CREATE TABLE `heilphp_ucenter_setting` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '设置ID', `type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '配置类型(1-用户配置)', `value` text NOT NULL COMMENT '配置数据', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='设置表'; -- -- 表的结构 `heilphp_picture` -- DROP TABLE IF EXISTS `heilphp_picture`; CREATE TABLE IF NOT EXISTS `heilphp_picture` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id自增', `type` varchar(50) NOT NULL, `path` varchar(255) NOT NULL DEFAULT '' COMMENT '路径', `url` varchar(255) NOT NULL DEFAULT '' COMMENT '图片链接', `md5` char(32) NOT NULL DEFAULT '' COMMENT '文件md5', `sha1` char(40) NOT NULL DEFAULT '' COMMENT '文件 sha1编码', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态', `create_time` bigint(10) unsigned NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=100000 COMMENT = '图片表'; -- -- 表的结构 `heilphp_file` -- DROP TABLE IF EXISTS `heilphp_file`; CREATE TABLE IF NOT EXISTS `heilphp_file` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id自增', `name` varchar(50) NULL COMMENT '原始文件名', `savename` varchar(50) NULL COMMENT '保存文件名', `savepath` varchar(255) NULL COMMENT '文件保存路径', `ext` char(6) NULL COMMENT '文件后缀', `mime` char(40) NULL COMMENT '文件mime类型', `size` bigint(10) NULL COMMENT '文件大小', `md5` char(32) NULL COMMENT '文件MD5', `sha1` char(40) NULL COMMENT '文件sha1编码', `location` tinyint(1) unsigned NULL COMMENT '文件保存位置 0-本地,1-FTP', `create_time` bigint(10) unsigned NULL DEFAULT '0' COMMENT '上传时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=100000 COMMENT = '文件表'; -- -- 表的结构 `heilphp_seo` -- DROP TABLE IF EXISTS `heilphp_seo`; CREATE TABLE IF NOT EXISTS `heilphp_seo` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id自增', `title` varchar(50) NULL COMMENT '设置说明', `module` varchar(50) NULL COMMENT '模块', `controller` varchar(50) NULL COMMENT '控制器', `action` varchar(50) NULL COMMENT '方法', `seo_title` text NULL COMMENT 'SEO标题', `seo_keywords` text NULL COMMENT 'SEO关键词', `seo_description` text NULL COMMENT 'SEO描述', `description` text NULL COMMENT 'SEO变量说明', `create_time` bigint(10) unsigned NULL COMMENT '创建时间', `update_time` bigint(10) unsigned NULL COMMENT '更新时间', `sort` int(10) unsigned NULL COMMENT '排序', `status` tinyint(1) unsigned NULL COMMENT '状态', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 COMMENT = '搜索引擎优化表'; -- -- 表的结构 `heilphp_ad_position` -- DROP TABLE IF EXISTS `heilphp_ad_position`; CREATE TABLE IF NOT EXISTS `heilphp_ad_position` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id自增', `title` varchar(80) DEFAULT NULL COMMENT '广告位名称', `name` varchar(80) DEFAULT NULL COMMENT '广告位标识', `type` tinyint(1) unsigned DEFAULT NULL COMMENT '广告位展示方式 0.单图 1.多图 2.文字链接 3.代码', `width` char(20) DEFAULT NULL COMMENT '广告位置宽度', `height` char(20) DEFAULT NULL COMMENT '广告位置高度', `margin` char(20) DEFAULT NULL COMMENT '外部边距', `padding` char(20) DEFAULT NULL COMMENT '内部边距', `pos` char(20) DEFAULT NULL COMMENT '位置标识', `style` tinyint(1) unsigned DEFAULT NUll COMMENT '广告样式', `theme` varchar(50) DEFAULT NUll COMMENT '适用主题', `create_time` bigint(10) unsigned DEFAULT NULL COMMENT '创建时间', `update_time` bigint(10) unsigned DEFAULT NULL COMMENT '更新时间', `status` tinyint(1) unsigned NOT NULl DEFAULT 1 COMMENT '状态(0:禁用,1:启用)', `sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `delete_time` bigint(10) unsigned DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 COMMENT = '广告位表'; -- -- 表的结构 `heilphp_ad` -- DROP TABLE IF EXISTS `heilphp_ad`; CREATE TABLE IF NOT EXISTS `heilphp_ad` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id自增', `title` varchar(80) DEFAULT NULL COMMENT '广告位名称', `position` int(10) unsigned NOT NULL COMMENT '广告位id', `data` text NOT NULL COMMENT '广告内容', `url` varchar(250) DEFAULT NULL COMMENT '链接地址', `target` varchar(30) DEFAULT NULL COMMENT '打开位置 "_blank" 等', `click_num` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '点击次数', `start_time` bigint(10) unsigned DEFAULT NULL COMMENT '开始时间', `end_time` bigint(10) unsigned DEFAULT NULL COMMENT '结束时间', `create_time` bigint(10) unsigned DEFAULT NULL COMMENT '创建时间', `update_time` bigint(10) unsigned DEFAULT NULL COMMENT '更新时间', `status` tinyint(1) unsigned NOT NULl DEFAULT 1 COMMENT '状态(0:禁用,1:启用)', `sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `delete_time` bigint(10) unsigned DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 COMMENT = '广告位表';
<gh_stars>10-100 SET XACT_ABORT ON; BEGIN TRANSACTION; -- update the version UPDATE usr_schema_version SET version_value='46' WHERE version_key='schema_patch'; DROP INDEX ix_usr_oguser_name ON usr_oguser; ALTER TABLE usr_oguser ADD userid varchar(255); UPDATE usr_oguser SET userid = name; ALTER TABLE usr_oguser ALTER COLUMN userid varchar(255) NOT NULL; ALTER TABLE usr_oguser DROP COLUMN name; ALTER TABLE usr_oguser ADD name varchar(255); ALTER TABLE usr_oguser ADD time_zone varchar(255); ALTER TABLE usr_oguser ADD email_address varchar(255); UPDATE usr_oguser SET name = userid; UPDATE usr_oguser SET time_zone = 'Europe/London'; ALTER TABLE usr_oguser ALTER COLUMN time_zone varchar(255) NOT NULL; CREATE INDEX ix_usr_oguser_userid ON usr_oguser(userid); COMMIT;
<reponame>connormcd/misc-scripts<gh_stars>10-100 ------------------------------------------------------------------------------- -- -- PLEASE NOTE -- -- No warranty, no liability, no support. -- -- This script is 100% at your own risk to use. -- ------------------------------------------------------------------------------- Here is a set of routines that do all the common base conversions. Syntax is similar to using to_number, to_date, etc. So, now you can select to_hex, to_bin, to_oct, to_dec of various numbers (or just call from pl/sql) create or replace function to_base( p_dec in number, p_base in number ) return varchar2 is l_str varchar2(255) default NULL; l_num number default p_dec; l_hex varchar2(16) default '0123456789ABCDEF'; begin if ( trunc(p_dec) <> p_dec OR p_dec < 0 ) then raise PROGRAM_ERROR; end if; loop l_str := substr( l_hex, mod(l_num,p_base)+1, 1 ) || l_str; l_num := trunc( l_num/p_base ); exit when ( l_num = 0 ); end loop; return l_str; end to_base; / create or replace function to_dec ( p_str in varchar2, p_from_base in number default 16 ) return number is l_num number default 0; l_hex varchar2(16) default '0123456789ABCDEF'; begin for i in 1 .. length(p_str) loop l_num := l_num * p_from_base + instr(l_hex,upper(substr(p_str,i,1)))-1; end loop; return l_num; end to_dec; / show errors create or replace function to_hex( p_dec in number ) return varchar2 is begin return to_base( p_dec, 16 ); end to_hex; / create or replace function to_bin( p_dec in number ) return varchar2 is begin return to_base( p_dec, 2 ); end to_bin; / create or replace function to_oct( p_dec in number ) return varchar2 is begin return to_base( p_dec, 8 ); end to_oct; /
CREATE DATABASE IF NOT EXISTS comments; GRANT UPDATE,DELETE,SELECT,INSERT,CREATE ON comments.* TO comments@'localhost' IDENTIFIED BY '(0mM3Nt$EnG!n3'; USE comments; CREATE TABLE IF NOT EXISTS categories( category_id int(10) unsigned NOT NULL auto_increment, category_name varchar(100) NOT NULL, category_prefix char(2) NOT NULL, created datetime NOT NULL, updated timestamp NOT NULL, PRIMARY KEY(category_id), KEY (created), KEY (updated) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO categories (`category_id`, `category_name`, `category_prefix`, `created`) VALUES(1, '<NAME>', 'AE', NOW()); INSERT INTO categories (`category_id`, `category_name`, `category_prefix`, `created`) VALUES(2, 'Hollister', 'HO', NOW()); INSERT INTO categories (`category_id`, `category_name`, `category_prefix`, `created`) VALUES(3, '<NAME>', 'RA', NOW()); CREATE TABLE IF NOT EXISTS products( product_id int(10) unsigned NOT NULL auto_increment, category_id int(10) unsigned NOT NULL, product_code char(5) NOT NULL, product_price decimal(3,2) NOT NULL, product_stock tinyint(3) unsigned NOT NULL, created datetime NOT NULL, updated timestamp NOT NULL, PRIMARY KEY(product_id), KEY(category_id), UNIQUE KEY(product_code), KEY (product_price), KEY (product_stock), KEY (created), KEY (updated) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO products (`product_id`, `category_id`, `product_code`, `product_price`, `product_stock`, `created`) VALUES(1, 1, 'AE001', 65.00, 10, NOW()); INSERT INTO products (`product_id`, `category_id`, `product_code`, `product_price`, `product_stock`, `created`) VALUES(2, 1, 'AE002', 65.00, 10, NOW()); INSERT INTO products (`product_id`, `category_id`, `product_code`, `product_price`, `product_stock`, `created`) VALUES(3, 2, 'HO001', 65.00, 10, NOW()); INSERT INTO products (`product_id`, `category_id`, `product_code`, `product_price`, `product_stock`, `created`) VALUES(4, 2, 'HO002', 65.00, 10, NOW()); INSERT INTO products (`product_id`, `category_id`, `product_code`, `product_price`, `product_stock`, `created`) VALUES(5, 3, 'RA001', 65.00, 10, NOW()); INSERT INTO products (`product_id`, `category_id`, `product_code`, `product_price`, `product_stock`, `created`) VALUES(6, 3, 'RA002', 65.00, 10, NOW()); CREATE TABLE IF NOT EXISTS comments( comment_id int(10) unsigned NOT NULL auto_increment, parent_id int(10) unsigned NOT NULL DEFAULT 0, product_id int(10) unsigned NOT NULL, name varchar(30) NOT NULL, email varchar(155) NOT NULL, comment_text text NOT NULL, approved tinyint(1) unsigned NOT NULL DEFAULT 1, created datetime NOT NULL, updated timestamp NOT NULL, PRIMARY KEY(comment_id), KEY (parent_id), KEY (product_id), KEY (approved), KEY (created), KEY (updated) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS users( user_id int(10) unsigned NOT NULL auto_increment, username varchar(20) NOT NULL, password varchar(100) NOT NULL, fullname varchar(30) NOT NULL, created datetime NOT NULL, updated timestamp NOT NULL, PRIMARY KEY(user_id), KEY (created), KEY (updated) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO users (`user_id`, `username`, `password`, `fullname`, `created`) VALUES(1, 'admin', '$2y$12$D3ENl6K8iJelQRwwxZ5CxeBvk5S59lC05UhCA8My5n4083SNjoVC.', 'Admin User', NOW());
alter table DirectoryEntry add constraint UK_bt0b3p8lm8yi06i7ux7ubq4o4 unique (path) alter table MediaEntry add constraint UK_gxy37bxxmxgnvgbkrdo5nv6gk unique (title) alter table SettingsEntry add constraint UK_6dwq37vrquhxaamp63e5dw81h unique (profile) alter table MediaEntry add constraint FK1uuo2mxrkaxfc2k28jtidcu19 foreign key (basePath_id) references DirectoryEntry
-- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 14 Jul 2018 pada 13.21 -- Versi server: 5.7.19 -- Versi PHP: 7.1.14 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: `buku` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `buku` -- CREATE TABLE `buku` ( `id_buku` int(11) NOT NULL, `judul_buku` varchar(30) NOT NULL, `penulis` varchar(20) NOT NULL, `penerbit` int(11) NOT NULL, `kategori` int(11) NOT NULL, `cover` varchar(50) NOT NULL, `tahun_terbit` date NOT NULL, `isbn` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `buku` -- INSERT INTO `buku` (`id_buku`, `judul_buku`, `penulis`, `penerbit`, `kategori`, `cover`, `tahun_terbit`, `isbn`) VALUES (1, 'Algoritma dan Pemrograman', '<NAME>', 5, 1, 'file_1531200137.jpg', '2018-03-14', 12345678), (2, 'Pemrograman Web', 'Benyamin Sueb', 1, 1, 'file_1531127991.jpg', '2018-07-09', 124195012), (7, 'Belajar Codeigniter', '<NAME>', 5, 1, 'file_1531145594.jpg', '2018-07-09', 2147483647), (8, 'Laravel', '<NAME>', 3, 1, 'file_1531145977.jpg', '2018-07-09', 432900), (9, '<NAME>', 'Sabeni', 2, 4, 'file_1531146143.jpg', '2018-07-09', 23094920), (10, '<NAME>', '<NAME>', 1, 2, 'file_1531147248.jpg', '2018-07-09', 230920420), (11, '<NAME>', '<NAME>', 4, 5, 'file_1531147401.jpg', '2018-07-18', 290432890), (12, '<NAME>', '<NAME>', 2, 2, 'file_1531147479.jpg', '2018-07-09', 2147483647); -- -------------------------------------------------------- -- -- Struktur dari tabel `kategori` -- CREATE TABLE `kategori` ( `id_kategori` int(11) NOT NULL, `nama_kategori` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `kategori` -- INSERT INTO `kategori` (`id_kategori`, `nama_kategori`) VALUES (1, 'Pemrograman '), (2, 'Fiksi'), (3, 'Komedi'), (4, 'Misteri'), (5, 'Religi'); -- -------------------------------------------------------- -- -- Struktur dari tabel `penerbit` -- CREATE TABLE `penerbit` ( `id_penerbit` int(11) NOT NULL, `nama_penerbit` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `penerbit` -- INSERT INTO `penerbit` (`id_penerbit`, `nama_penerbit`) VALUES (1, 'Elexmedia Komputindo'), (2, 'Andi Publisher'), (3, 'Lokomedia'), (4, 'Grasindo'), (5, 'Informatika'); -- -- Indexes for dumped tables -- -- -- Indeks untuk tabel `buku` -- ALTER TABLE `buku` ADD PRIMARY KEY (`id_buku`), ADD KEY `kategori` (`kategori`), ADD KEY `penerbit` (`penerbit`); -- -- Indeks untuk tabel `kategori` -- ALTER TABLE `kategori` ADD PRIMARY KEY (`id_kategori`); -- -- Indeks untuk tabel `penerbit` -- ALTER TABLE `penerbit` ADD PRIMARY KEY (`id_penerbit`); -- -- AUTO_INCREMENT untuk tabel yang dibuang -- -- -- AUTO_INCREMENT untuk tabel `buku` -- ALTER TABLE `buku` MODIFY `id_buku` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT untuk tabel `kategori` -- ALTER TABLE `kategori` MODIFY `id_kategori` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT untuk tabel `penerbit` -- ALTER TABLE `penerbit` MODIFY `id_penerbit` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables) -- -- -- Ketidakleluasaan untuk tabel `buku` -- ALTER TABLE `buku` ADD CONSTRAINT `kategori` FOREIGN KEY (`kategori`) REFERENCES `kategori` (`id_kategori`) ON UPDATE CASCADE, ADD CONSTRAINT `penerbit` FOREIGN KEY (`penerbit`) REFERENCES `penerbit` (`id_penerbit`) ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
------CONSULTA 1----- /*Realizar un stored procedure que devuelva la tabla de posiciones en cualquier momento. Como parámetro debe recibir la temporada (id o año) y tener dos parámetros excluyentes, el número de jornada y la fecha. Si recibe la fecha calcula la tabla a la fecha indicada aun así no haya terminado la jornada, y si recibe la jornada debe traer las posiciones hasta esa jornada. Si ambos están vacíos toma como si fuera el final de temporada. */ --POR FECHA //LA JORNADA TIENE QUE IR 0 SET AUTOPRINT ON; variable CURSORMEMORIA REFCURSOR; execute CONSULTA1(:CURSORMEMORIA, 2019,0 ,'27/10/2019'); --POR JORNADA SET AUTOPRINT ON; variable CURSORMEMORIA REFCURSOR; execute CONSULTA1(:CURSORMEMORIA, 2019,10 ,''); -----CONSULTA 2 --------- /* Vista que muestre los primeros 4 lugares de los últimos 40 años (TOP 10) columnas, puesto 1, puntos 1, puesto 2, puntos 2, puesto 3, puntos 3, puesto 4, puntos 4. La vista tendrá entonces un total de 40 filas. */ SELECT * FROM CONSULTA2; ------CONSULTA 3 --------- /*Consulta que muestre los equipos que ha ganado la liga más veces en los últimos 20 años (TOP 5)*/ SELECT * FROM CONSULTA3; ------CONSULTA 4 --------- /*Realizar una stored procedure que muestre que equipos descendieron y no aparecen en la temporada que se envíe por parámetro. */ SET AUTOPRINT ON; SET serveroutput ON variable CURSORMEMORIA REFCURSOR; execute CONSULTA_4(:CURSORMEMORIA, 2019); -----------------CONSULTA 5 ---------------------- --Realizar una vista que devuelva las victimas favoritas de un equipo, en otras --palabras, a quien han derrotado más veces. SELECT * FROM CONSULTA_5; ----------------CONSULTA 6--------------------- /*Realizar un stored procedure que reciba el equipo (id o nombre) y que devuelva las posiciones que ha ocupado en cada una de las temporadas, goles y puntos. */ SET AUTOPRINT ON; SET serveroutput ON variable CURSORMEMORIA REFCURSOR; execute CONSULTA_6(:CURSORMEMORIA, 'Barcelona'); -----------------CONSULTA 7--------------------- /*Responder ¿Cuál ha sido la victoria más abultada de los últimos 40 años? Partido, equipos y marcador. */ SELECT * FROM CONSULTA_7; ----------------CONSULTA 8 ----------------------- /*Realizar un stored procedure que la temporada (id o año) y que devuelva el historial de los equipos que han ocupado el primer puesto de la liga de inicio a fin de temporada, con fechas y puntos. */ SET serveroutput ON execute CONSULTA_8(1979); ------------------CONSULTA 9---------------------- --Realizar un stored procedure que la temporada (id o año) y que devuelva el historial --de los equipos que han ocupado el último puesto de la liga de inicio a fin de --temporada, con fechas y puntos. SET serveroutput ON execute CONSULTA_9(1979); ----------------CONSULTA 10 -------------------- --Vista que muestre, cuántos goles se anotaron en cada temporada, que equipo anoto --más, que equipo anoto menos. SELECT * FROM CONSULTA_10; ------------- CONSULTA 11----------------------- /*Consulta que muestre, al quipo con más victorias, más derrotas y más empates. */ SELECT * FROM CONSULTA_11 ORDER BY GANADOS DESC; --------------------CONSULTA 12---------------- /*Un grupo de stored procedures que efectué una simulación con la pueda calcular nuevamente los datos de todas las consultas anteriores. Debe ser capaz de modificar resultados, ingresando los parámetros de año, jornada, resultado de visita y local. Y un stored procedure que al ejecutarlo retorne todo a su estado original como si no hubiera hecho ningún cambio por medio de la simulación. */ --CREAR BACKUP DE ORIGINAL EXEC BACKUP_TABLA; ---MODIFICAR PARTIDO SET serveroutput ON EXEC consulta_12(2019,10,'Barcelona', 3, 'Real Madrid', 3); ----CONSULTAR PARTIDO MODIFICADO SELECT * FROM PARTIDO WHERE PARTIDO.ID_PARTIDO = 71166; -----VERIFICAR TABLA DE POSICIONES FINAL Y VERIFICAR CAMBIOS SET AUTOPRINT ON; variable CURSORMEMORIA REFCURSOR; execute CONSULTA1(:CURSORMEMORIA, 2019,38 ,''); -----COMPARAR DATOS SELECT TEMPORAL_BACKUP.*, 'ELIMINADOS' estatus FROM TEMPORAL_BACKUP WHERE NOT EXISTS ( SELECT * FROM PARTIDO WHERE TEMPORAL_BACKUP.FECHA = PARTIDO.FECHA AND TEMPORAL_BACKUP.EQ_LOCAL = PARTIDO.EQ_LOCAL AND TEMPORAL_BACKUP.VISITANTE = PARTIDO.VISITANTE AND TEMPORAL_BACKUP.GOLES_LOCAL = PARTIDO.GOLES_LOCAL AND TEMPORAL_BACKUP.GOLES_VISITA = PARTIDO.GOLES_VISITA ) SELECT PARTIDO.*, 'ELIMINADOS' estatus FROM PARTIDO WHERE NOT EXISTS ( SELECT * FROM TEMPORAL_BACKUP WHERE PARTIDO.FECHA = TEMPORAL_BACKUP.FECHA AND PARTIDO.EQ_LOCAL = TEMPORAL_BACKUP.EQ_LOCAL AND PARTIDO.VISITANTE = TEMPORAL_BACKUP.VISITANTE AND PARTIDO.GOLES_LOCAL = TEMPORAL_BACKUP.GOLES_LOCAL AND PARTIDO.GOLES_VISITA = TEMPORAL_BACKUP.GOLES_VISITA ) ----RESTAURAR BASE A DATOS ORIGINALES EXEC RESTAURAR_ORIGINAL;
SET GLOBAL local_infile = 1; USE pruebaperu; LOAD DATA LOCAL INFILE "D:\\Basededatos\\schema\\classif.csv" INTO TABLE pruebaperu.clasificaciones FIELDS TERMINATED BY ";" ENCLOSED BY '"' LINES TERMINATED BY "\r\n" IGNORE 1 LINES (`nombre_clasificacion`, `clasificacion_id` ) SET `nombre_clasificacion` = nullif(`nombre_clasificacion`, ''), `clasificacion_id` = nullif(`clasificacion_id`, '') ;
DROP PROCEDURE IF EXISTS set_global_dynamic; DELIMITER // CREATE PROCEDURE set_global_dynamic(IN pvar CHAR(64), IN pval CHAR(255)) BEGIN CREATE TABLE IF NOT EXISTS mysql.dynamics (variable CHAR(64), value CHAR(255), PRIMARY KEY (variable)); SET @cmd = CONCAT("SET GLOBAL ", pvar, " = '", pval, "'"); PREPARE stmt FROM @cmd; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET @cmd = ''; REPLACE INTO mysql.dynamics VALUES (pvar, pval); END; // DELIMITER ; DROP PROCEDURE IF EXISTS load_global_dynamic; DELIMITER // CREATE PROCEDURE load_global_dynamic () BEGIN DECLARE done INT DEFAULT 0; DECLARE pvar CHAR(64); DECLARE pval CHAR(255); DECLARE cur CURSOR FOR SELECT variable, value FROM mysql.dynamics; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; DECLARE EXIT HANDLER FOR SQLSTATE '42S02' BEGIN END; OPEN cur; REPEAT FETCH cur INTO pvar, pval; SET @cmd = CONCAT("SET GLOBAL ", pvar, " = '", pval, "'"); PREPARE stmt FROM @cmd; EXECUTE stmt; DEALLOCATE PREPARE stmt; UNTIL done END REPEAT; CLOSE cur; END; // DELIMITER ;
<filename>Thinking/sql/drawing/fluent_score.sql SELECT `crtuser`, count(`crtuser`) FROM drawing WHERE drawing.`Name` NOT LIKE '' AND drawing.`Name` NOT LIKE '% %' AND drawing.`Name` NOT LIKE '%,%' GROUP by crtuser ORDER BY crtuser ;
-- -- Database: `catalog` -- USE `catalog`; -- -------------------------------------------------------- -- -- Procedures -- -- -------------------------------------------------- -- `logging_info` procedure -- -------------------------------------------------- DROP PROCEDURE IF EXISTS logging_info; DELIMITER | CREATE PROCEDURE IF NOT EXISTS logging_info (_text TEXT) BEGIN SELECT _text as '** INFO: '; END | DELIMITER; -- -------------------------------------------------- -- `update_stac_tables` procedure -- -------------------------------------------------- DROP PROCEDURE IF EXISTS update_stac_tables; DELIMITER | CREATE PROCEDURE IF NOT EXISTS update_stac_tables () BEGIN -- 'Updates stac_collection table' DROP TABLE IF EXISTS stac_collection; CREATE TABLE IF NOT EXISTS stac_collection (SELECT * FROM _stac_collection); ALTER TABLE stac_collection ADD PRIMARY KEY (id); -- 'Updates stac_item table' DROP TABLE IF EXISTS stac_item; CREATE TABLE IF NOT EXISTS stac_item (SELECT * FROM _stac_item); -- ALTER TABLE stac_item ADD PRIMARY KEY (id, collection); CREATE INDEX stac_item_index_collection ON stac_item (collection); CALL logging_info('stac tables have been updated successfuly!'); END | DELIMITER; -- -------------------------------------------------- -- `remove_old_rows_from_security` procedure -- -------------------------------------------------- DROP PROCEDURE IF EXISTS remove_old_rows_from_security; DELIMITER | CREATE PROCEDURE IF NOT EXISTS remove_old_rows_from_security () BEGIN -- 86400 seconds is one day (24 hours) -- remove all rows that are one day old DELETE FROM security WHERE TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, timestamp)) >= 86400; END | DELIMITER ; -- -------------------------------------------------- -- `remove_trash_from_download` procedure -- development use, not production use -- -------------------------------------------------- DROP PROCEDURE IF EXISTS remove_trash_from_download; DELIMITER | CREATE PROCEDURE IF NOT EXISTS remove_trash_from_download () BEGIN -- remove bad values from Download table DELETE FROM Download WHERE sceneId IS NULL OR CHAR_LENGTH(sceneId) <= 8; END | DELIMITER ; -------------------------------------------------- -- update Dataset table records -------------------------------------------------- DELIMITER $$ DROP PROCEDURE IF EXISTS `update_collection_fields` $$ CREATE PROCEDURE update_collection_fields(collection_name TEXT) BEGIN -- this script looks for the min/max values of a collection -- and update its record with them UPDATE Dataset d INNER JOIN ( SELECT collection, MIN(datetime) start_date, MAX(datetime) end_date, MIN(bl_longitude) min_x, MIN(bl_latitude) min_y, MAX(tr_longitude) max_x, MAX(tr_latitude) max_y FROM stac_item WHERE collection = collection_name GROUP BY collection ) si ON d.Name = si.collection SET d.start_date = si.start_date, d.end_date = si.end_date, d.min_y = si.min_y, d.min_x = si.min_x, d.max_y = si.max_y, d.max_x = si.max_x WHERE Name = collection_name; END $$ DELIMITER ; -- example -- CALL update_collection_fields('CBERS4A_MUX_L2_DN'); -- CALL update_collection_fields('CBERS4A_MUX_L4_DN'); -- CALL update_collection_fields('CBERS4A_WFI_L2_DN'); -- CALL update_collection_fields('CBERS4A_WFI_L4_DN'); -- CALL update_collection_fields('CBERS4A_WPM_L2B_DN'); -- CALL update_collection_fields('CBERS4A_WPM_L2_DN'); -- CALL update_collection_fields('CBERS4A_WPM_L4_DN'); DELIMITER $$ DROP PROCEDURE IF EXISTS `update_dataset_records` $$ CREATE PROCEDURE update_dataset_records() BEGIN -- this procedure updates each row of Dataset table -- based on the available items DECLARE size_dataset INT DEFAULT 0; DECLARE i INT DEFAULT 0; DECLARE collection_name VARCHAR(20); SELECT COUNT(*) FROM Dataset INTO size_dataset; -- iterate over Dataset rows and call procedure to each collection SET i=0; WHILE i<size_dataset DO -- get collection name on the position 'i' SELECT Name FROM Dataset ORDER BY Name LIMIT i,1 INTO collection_name; -- call procedure passing the collection name CALL update_collection_fields(collection_name); SET i=i+1; END WHILE; END $$ DELIMITER ; -- example -- CALL update_dataset_records();
CREATE DEFINER=`root`@`localhost` FUNCTION `ConsultarProyecto`(`CodProyecto` INT) RETURNS text LANGUAGE SQL DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT '' BEGIN declare NombreProyecto TEXT; set NombreProyecto=''; #Valor por defecto, por si no encuentra el usuario select mantis_project_table.name into NombreProyecto from mantis_project_table where mantis_project_table.id=CodProyecto; if (NombreProyecto is null) then set NombreProyecto=''; end if; return NombreProyecto; END
<filename>postgres/00-create-extensions.sql \c template1; CREATE EXTENSION IF NOT EXISTS plpgsql; CREATE EXTENSION IF NOT EXISTS hstore;
DROP PROCEDURE IF EXISTS `proc_get_eid_age_breakdown_trends`; DELIMITER // CREATE PROCEDURE `proc_get_eid_age_breakdown_trends` (IN age INT(11), IN from_year INT(11), IN to_year INT(11)) BEGIN SET @QUERY = "SELECT `year`, `month`, `pos`, `neg` FROM `national_age_breakdown` WHERE 1"; SET @QUERY = CONCAT(@QUERY, " AND (`year` = '",from_year,"' OR `year` = '",to_year,"') and `age_band_id` = '",age,"' ORDER BY `year` ASC, `month` "); PREPARE stmt FROM @QUERY; EXECUTE stmt; END // DELIMITER ;
-- Lo que quieres mostrar = SELECT -- De donde voy a tomar los datos = FROM -- Los filtros de los datos que quieres mostrar = WHERE -- Los rubros por los que me interesa agrupar mi información = GROUP BY -- El orden en que quiero presentar mi información ORDER BY -- Los filtros que quiero que mis datos agrupados tengan HAVING -- ¿Cuántos tags tienen cada post? SELECT posts.titulo, COUNT(*) AS num_etiquetas FROM posts INNER JOIN posts_etiquetas ON posts.id = posts_etiquetas.post_id INNER JOIN etiquetas ON etiquetas.id = posts_etiquetas.etiqueta_id GROUP BY posts.id; -- ¿Cuál es el tag que mas se repite? SELECT etiquetas.nombre_etiqueta, COUNT(*) AS ocurrencias FROM etiquetas INNER JOIN posts_etiquetas ON etiquetas.id = posts_etiquetas.etiqueta_id GROUP BY etiquetas.id ORDER BY ocurrencias DESC; -- Los tags que tiene un post separados por comas SELECT posts.titulo, GROUP_CONCAT(nombre_etiqueta) FROM posts INNER JOIN posts_etiquetas ON posts.id = posts_etiquetas.post_id INNER JOIN etiquetas ON etiquetas.id = posts_etiquetas.etiqueta_id GROUP BY posts.id; -- ¿Que etiqueta no tiene ningun post asociado? SELECT * FROM etiquetas LEFT JOIN posts_etiquetas on etiquetas.id = posts_etiquetas.etiqueta_id WHERE posts_etiquetas.etiqueta_id IS NULL; -- Las categorías ordenadas por numero de posts SELECT c.nombre_categoria, COUNT(*) AS cant_posts FROM categorias AS c INNER JOIN posts AS p on c.id = p.categoria_id GROUP BY c.id ORDER BY cant_posts DESC; -- ¿Cuál es la categoría que tiene mas posts? SELECT c.nombre_categoria, COUNT(*) AS cant_posts FROM categorias AS c INNER JOIN posts AS p on c.id = p.categoria_id GROUP BY c.id ORDER BY cant_posts DESC LIMIT 1; -- ¿Que usuario ha contribuido con mas post? SELECT u.nickname, COUNT(*) AS cant_posts FROM usuarios AS u INNER JOIN posts AS p on u.id = p.usuario_id GROUP BY u.id ORDER BY cant_posts DESC LIMIT 1; -- ¿De que categorías escribe cada usuario? SELECT u.nickname, COUNT(*) AS cant_posts, GROUP_CONCAT(nombre_categoria) FROM usuarios AS u INNER JOIN posts AS p ON u.id = p.usuario_id INNER JOIN categorias AS c ON c.id = p.categoria_id GROUP BY u.id; -- ¿Que usuario no tiene ningun post asociado? SELECT * FROM usuarios LEFT JOIN posts on usuarios.id = posts.usuario_id WHERE posts.usuario_id IS NULL
CREATE TABLE [dbo].[HistoryTable] ( [Id] INT NOT NULL PRIMARY KEY IDENTITY, [InstanceId] NVARCHAR(50) NOT NULL, [ExecutionId] NVARCHAR(50) NOT NULL, [SequenceNumber] BIGINT NOT NULL, [HistoryEvent] NVARCHAR(MAX) NOT NULL, [EventTimestamp] DATETIME NOT NULL, [TimeStamp] DATETIMEOFFSET NOT NULL )
<reponame>CSCfi/antero<gh_stars>1-10 USE [ANTERO] GO /****** Object: StoredProcedure [dw].[p_lataa_d_horizon_projektit] Script Date: 15.6.2020 17:05:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dw].[p_lataa_d_horizon_projektit] AS TRUNCATE TABLE dw.d_horizon_projektit INSERT INTO dw.d_horizon_projektit ( [acronym], [call], [coordinator], [coordinatorCountry], [ecMaxContribution], [endDate], [frameworkProgramme], [fundingScheme], [id], [objective], [programme], [startDate], [status], [title], [topics], [totalCost], [rcn], [pillar] ) Select [acronym], [call], [coordinator], [coordinatorCountry], [ecMaxContribution], [endDate], [frameworkProgramme], [fundingScheme], [id], [objective], [programme], [startDate], [status], [title], [topics], [totalCost], [X.U.FEFF.rcn], CASE WHEN [programme] like 'H2020-EU.1%' THEN 'Excellent Science' WHEN [programme] like 'H2020-EU.2%' THEN 'Industrial Leadership' WHEN [programme] like 'H2020-EU.3%' THEN 'Societal Challenges' WHEN [programme] like 'H2020-EU.4%' THEN 'Spreading excellence and widening participation' WHEN [programme] like 'H2020-EU.5%' THEN 'Science with and for Society' WHEN [programme] like 'H2020-Euratom%' THEN 'Euratom' WHEN [programme] like 'H2020-EC%' THEN 'EC' ELSE 'Unknown' END AS [pillar] FROM [ANTERO].[sa].[sa_horizon_projektit]
WITH sfdc_pov AS ( SELECT * FROM {{ ref('sfdc_proof_of_value') }} ), sfdc_users AS ( SELECT * FROM {{ref('sfdc_users_xf')}} ), joined AS ( SELECT sfdc_pov.*, owner.name AS pov_owner_name, solarch.name AS solution_architect_name, tam.name AS technical_account_manager_name FROM sfdc_pov LEFT JOIN sfdc_users AS owner ON sfdc_pov.pov_owner_id = owner.id LEFT JOIN sfdc_users AS solarch ON sfdc_pov.solutions_architect_id = solarch.id LEFT JOIN sfdc_users AS tam ON sfdc_pov.technical_account_manager_id = tam.id ) SELECT * FROM joined
<gh_stars>1-10 -- script for creating a table in given database -- DDL query to create the table CREATE TABLE IF NOT EXISTS first_table (id INT, name VARCHAR(256));
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 26, 2021 at 05:01 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.10 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: `luminosity` -- -- -------------------------------------------------------- -- -- Table structure for table `articles` -- CREATE TABLE `articles` ( `id` bigint(20) NOT NULL, `user_id` int(11) NOT NULL, `article_id` varchar(32) NOT NULL, `title` varchar(300) NOT NULL, `tagline` varchar(600) DEFAULT NULL, `content` mediumtext NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `last_updated` timestamp NOT NULL DEFAULT current_timestamp(), `preview_img` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `article_bookmarks` -- CREATE TABLE `article_bookmarks` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `article_id` varchar(32) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `article_comments` -- CREATE TABLE `article_comments` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `article_id` varchar(32) NOT NULL, `parent_id` int(11) DEFAULT NULL, `content` varchar(1500) NOT NULL, `is_edited` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `article_comment_likes` -- CREATE TABLE `article_comment_likes` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `article_id` varchar(32) NOT NULL, `comment_id` int(11) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `article_reactions` -- CREATE TABLE `article_reactions` ( `id` int(11) NOT NULL, `type` varchar(12) NOT NULL, `user_id` int(11) NOT NULL, `article_id` varchar(32) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `article_tags` -- CREATE TABLE `article_tags` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `tag` varchar(12) NOT NULL, `article_id` varchar(32) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `article_views` -- CREATE TABLE `article_views` ( `id` int(11) NOT NULL, `user_id` varchar(50) NOT NULL, `article_id` varchar(32) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `drafts` -- CREATE TABLE `drafts` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `draft_id` varchar(32) DEFAULT NULL, `draft_name` varchar(255) NOT NULL, `title` varchar(1000) DEFAULT NULL, `tagline` varchar(2500) DEFAULT NULL, `content` mediumtext DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `last_updated` timestamp NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `email_verification_tokens` -- CREATE TABLE `email_verification_tokens` ( `id` int(11) NOT NULL, `email` varchar(300) NOT NULL, `token` varchar(300) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `followers` -- CREATE TABLE `followers` ( `id` int(11) NOT NULL, `follower_id` int(11) NOT NULL, `profile_id` int(11) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `forgot_password_tokens` -- CREATE TABLE `forgot_password_tokens` ( `id` int(11) NOT NULL, `email` varchar(300) NOT NULL, `token` varchar(300) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `is_used` tinyint(1) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `login_tokens` -- CREATE TABLE `login_tokens` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `token` varchar(300) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `uniq_id` varchar(32) NOT NULL, `email` varchar(300) NOT NULL, `username` varchar(30) NOT NULL, `display_name` varchar(30) NOT NULL, `password` varchar(300) NOT NULL, `about` varchar(300) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `profile_img` varchar(200) NOT NULL, `verified` tinyint(1) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `articles` -- ALTER TABLE `articles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `article_bookmarks` -- ALTER TABLE `article_bookmarks` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `unique_index` (`user_id`,`article_id`); -- -- Indexes for table `article_comments` -- ALTER TABLE `article_comments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `article_comment_likes` -- ALTER TABLE `article_comment_likes` ADD PRIMARY KEY (`id`); -- -- Indexes for table `article_reactions` -- ALTER TABLE `article_reactions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `article_tags` -- ALTER TABLE `article_tags` ADD PRIMARY KEY (`id`); -- -- Indexes for table `article_views` -- ALTER TABLE `article_views` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `user_id` (`user_id`,`article_id`); -- -- Indexes for table `drafts` -- ALTER TABLE `drafts` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `draft_id` (`draft_id`); -- -- Indexes for table `email_verification_tokens` -- ALTER TABLE `email_verification_tokens` ADD PRIMARY KEY (`id`); -- -- Indexes for table `followers` -- ALTER TABLE `followers` ADD PRIMARY KEY (`id`); -- -- Indexes for table `forgot_password_tokens` -- ALTER TABLE `forgot_password_tokens` ADD PRIMARY KEY (`id`); -- -- Indexes for table `login_tokens` -- ALTER TABLE `login_tokens` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `articles` -- ALTER TABLE `articles` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `article_bookmarks` -- ALTER TABLE `article_bookmarks` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `article_comments` -- ALTER TABLE `article_comments` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `article_comment_likes` -- ALTER TABLE `article_comment_likes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `article_reactions` -- ALTER TABLE `article_reactions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `article_tags` -- ALTER TABLE `article_tags` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `article_views` -- ALTER TABLE `article_views` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `drafts` -- ALTER TABLE `drafts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `email_verification_tokens` -- ALTER TABLE `email_verification_tokens` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `followers` -- ALTER TABLE `followers` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `forgot_password_tokens` -- ALTER TABLE `forgot_password_tokens` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `login_tokens` -- ALTER TABLE `login_tokens` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; DELIMITER $$ CREATE PROCEDURE `delete_article_aliases`(IN `articleID` VARCHAR(32)) MODIFIES SQL DATA BEGIN DELETE FROM articles WHERE article_id = articleID; DELETE FROM article_bookmarks WHERE article_id = articleID; DELETE FROM article_comments WHERE article_id = articleID; DELETE FROM article_comment_likes WHERE article_id = articleID; DELETE FROM article_reactions WHERE article_id = articleID; DELETE FROM article_tags WHERE article_id = articleID; DELETE FROM article_views WHERE article_id = articleID; END$$ DELIMITER ; DELIMITER $$ CREATE PROCEDURE `delete_comment_aliases`(IN commentID INT) BEGIN -- delete replies IF((SELECT parent_id FROM article_comments WHERE id = commentID) = 0) THEN DELETE FROM article_comments WHERE parent_id = commentID; DELETE FROM article_comment_likes WHERE comment_id = (SELECT id FROM article_comments WHERE parent_id = commentID); END IF; DELETE FROM article_comments WHERE id = commentID; DELETE FROM article_comment_likes WHERE comment_id = commentID; END$$ DELIMITER ;
<gh_stars>1-10 -- -- The ReliefWeb API. -- Prepared SQL queries for 'filter_operator_-post' definition. -- -- -- SELECT template for table `filter_operator_-post` -- SELECT FROM `filter_operator_-post` WHERE 1; -- -- INSERT template for table `filter_operator_-post` -- INSERT INTO `filter_operator_-post`() VALUES (); -- -- UPDATE template for table `filter_operator_-post` -- UPDATE `filter_operator_-post` SET WHERE 1; -- -- DELETE template for table `filter_operator_-post` -- DELETE FROM `filter_operator_-post` WHERE 0;
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64) -- -- Host: localhost Database: guardartododb -- ------------------------------------------------------ -- Server version 5.7.17-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `client` -- DROP TABLE IF EXISTS `client`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `client` ( `clientId` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(300) NOT NULL, `street` varchar(200) DEFAULT NULL, `town` varchar(200) DEFAULT NULL, `country` varchar(200) DEFAULT NULL, `state` varchar(200) DEFAULT NULL, `zipcode` varchar(5) DEFAULT NULL, `rfc` varchar(45) DEFAULT NULL, `phone` varchar(45) DEFAULT NULL, `cellPhone` varchar(45) DEFAULT NULL, `email` varchar(250) DEFAULT NULL, `legalRepresentative` varchar(400) DEFAULT NULL, `lineOfBusiness` varchar(200) DEFAULT NULL, `kindOfBusiness` varchar(200) DEFAULT NULL, `enable` tinyint(1) DEFAULT '1', `createByUserId` int(11) DEFAULT NULL, `createDatetime` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`clientId`) ) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `client` -- LOCK TABLES `client` WRITE; /*!40000 ALTER TABLE `client` DISABLE KEYS */; INSERT INTO `client` VALUES (12,'<NAME> <NAME>','PLAYA MONTECARLO, PRIMAVERA','MONTERREY','Mexico','NUEVO LEON','64830','N/A','8123712694','8122171817','<EMAIL>','N/A','Persona Fisica','HOGAR',0,NULL,'2017-01-20 16:13:04'),(13,'<NAME>','PLAYA MONTECARLO, PRIMAVERA','MONTERREY','Mexico','NUEVO LEON','64830','N/A','812365494','811652398','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-04-29 09:51:42'),(16,'Test','1234','12334','24234','234234','23423','','N/A','N/A','N/A','N/A','PERSONA FISICA','EMPRESA',0,NULL,'2017-05-04 21:07:50'),(17,'<NAME>','Calzada de los Pinos','<NAME>','<NAME>','Nuevo Leon','','N/A','83523488','8182534438','N/A','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 09:43:10'),(18,'<NAME>','<NAME> 221','<NAME>','<NAME>','Nuevo Leon','66456','N/A','83523488','8182534438','n','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 09:45:47'),(19,'<NAME>','<NAME> No. 221','<NAME>','<NAME>','Nuevo Leon','66450','N/A','83769430','8119111667','N/A','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 10:09:17'),(20,'<NAME>','Villa del Olvo 114','Villas de Anahuac','General Escobedo','Nuevo Leon','','N/A','80089451','8119166338','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 10:49:58'),(21,'<NAME>','Roan 148','Santa Luz','General Escobedo','Nuevo Leon','','N/A','83769563','8182532320','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 10:53:08'),(22,'<NAME>','Privada Edmonton 213','Privadas del Canada','San Nicolas','Nuevo Leon','','N/A','22302436','8118001968','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 10:56:01'),(23,'<NAME>','Bodega','Colonia PEDREGAL','Apodaca','Nuevo Leon','','N/A','24082747','8115909598','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 10:59:04'),(24,'<NAME>','Cd Baez 246','<NAME>','Monterrey','Nuevo Leon','','N/A','82535646','8112559841','','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 11:01:45'),(25,'<NAME>','Lhmiouilpan 2722','Mitras Centro','Monterrey','Nuevo Leon','','N/A','83485662','8120056222','','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 11:05:25'),(26,'<NAME>','Calzada de los Pinos 104','Las Calzadas Residencial','San Ped<NAME>','Nuevo Leon','','N/A','83523888','8182534438','N/A','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 11:07:50'),(27,'<NAME>','','Las Calzadas Residencial','<NAME>','Nuevo Leon','','N/A','83523488','8182534438','N/A','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 11:10:06'),(28,'<NAME>','tenayuca 7809','<NAME>','Monterrey','Nuevo Leon','','N/A','83220636','8326799042','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 11:12:19'),(29,'<NAME>','Cd Del Halcon 143','Los Viñedos','Torreon','Coahuila','27019','N/A','','8718871574','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 11:15:39'),(30,'<NAME>','19 de Marzo 420','<NAME>','San Nicolas','Nuevo Leon','66450','SATR680329UI1','81151214','8111219890','<EMAIL>','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-05-06 11:18:17'),(31,'Comercializadora BACSSA','Amayuca 130','<NAME>','Monterrey','Nuevo Leon','64830','CBT131028U75','14924210','8110458917','<EMAIL>','<NAME>','PERSONA MORAL','EMPRESA',0,NULL,'2017-05-06 11:28:38'),(32,'DEACERO S.A.P.I DE CV','Av. Lazaro Cardenas #2333','<NAME>','<NAME>','Nuevo Leon','66269','DEA7103086X2','8448084000','8115318586','<EMAIL>','<NAME>','PERSONA MORAL','EMPRESA',1,NULL,'2017-05-20 12:49:07'),(33,'<NAME>','<NAME> No. 221','<NAME>','San Nicolas','NUEVO LEON','','N/A','83769430','8119111667','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:05:13'),(34,'<NAME>','Villa del Olvo 114','Villas de Anahuac','General Escobedo','Nuevo Leon','66059','N/A','','81 1916 6338','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:29:22'),(35,'<NAME>','<NAME>','Santa Luz','General Escobedo','Nuevo Leon','64830','N/A','','8182532320','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:31:25'),(36,'<NAME>','Zaragoza 926','Pedregal de Apodaca','Apodaca','Nuevo Leon','66605','N/A','','81 1762 3122','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:34:00'),(37,'<NAME>','Cda. Baez 246','<NAME>','Monterrey','Nuevo Leon','','N/A','','81 8253 5646','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:36:45'),(38,'<NAME>','Lymiouilpan 2722','Mitras Centro','Monterrey','Nuevo Leon','','N/A','','81 2005 6622','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:38:24'),(39,'<NAME>','Calzada de los Pinos 104','Las Calzadas Recidencial','<NAME>','Nuevo Leon','','N/A','8182534438','8182534438','','','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:39:58'),(40,'<NAME>','Tenayuca 7809','Lomas Modelo','Monterrey','Nuevo Leon','','N/A','','1 (832) 679-9042','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:46:13'),(41,'<NAME>','Halcon 43','Los Viñedos','Torreón','coahuila','27019','N/A','','8718871574','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:48:31'),(42,'<NAME>','19 de Marzo, #420','El roble','San Nicolas','Nuevo Leon','66450','N/A','','8111219890','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-14 12:51:31'),(43,'<NAME>','Lirio 420','Valle de las Palmas','Apodaca','Nuevo Leon','66612','N/A','21703009','8184666140','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-17 12:25:09'),(44,'<NAME>','Mc allen 403','Recidencial Puerta del Norte','General Escobedo','Nuevo Leon','66054','N/A','805816250','8120743887','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-18 12:08:27'),(45,'<NAME>','<NAME> 121','Calzada de Anahuac','<NAME>','<NAME>','66059','N/A','21385288','811981673','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-21 13:35:14'),(46,'<NAME>','<NAME> 360','Roble','<NAME>','NUEVO LEON','64830','N/A','83766431','8115194464','N/A','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-22 10:46:11'),(47,'<NAME>','<NAME> 226','<NAME>','Monterrey','NUEVO LEON','64620','N/A','','8112519567','','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-07-22 10:48:03'),(48,'<NAME>','C. Gaviota 432','Hacienda las palmas','Apodaca','NUEVO LEON','66635','N/A','','','N/A','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 09:57:02'),(49,'Menzies Aviation SA DE CV','Boulevard luis donaldo colosio Mza 26, Lote 03-01, Local 2','SM 311','<NAME>','Quintana Roo','','MAM971023SK7','10888562','8123548264','<EMAIL>','<NAME>','PERSONA MORAL','EMPRESA',1,NULL,'2017-07-24 10:20:55'),(50,'<NAME> Mexico','Av. Sendero Norte, Bodega L, No. Ext. 510,','Balcones de Anahuac','San Nicolas','Nuevo Leon','66422','LME080505HT2','19462055','','<EMAIL>','<NAME>','PERSONA MORAL','EMPRESA',1,NULL,'2017-07-24 10:24:23'),(51,'<NAME>','Agustin de Inturbide 416','Heroes de Mexico','San Nicolas','Nuevo Leon','66415','N/A','83131888','8117639894','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 10:26:52'),(52,'<NAME>','C. Montes Pirinelos 912','Las puentes 7sec.','San Nicolas','Nuevo Leon','66460','N/A','96887981','8119084230','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 10:28:54'),(53,'<NAME>','C.Calzada Inglesa 270.','Calzadas Anahuac, Sec. Frances','San Nicolas','Nuevo Leon','66050','N/A','','8111825172','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 10:31:36'),(54,'<NAME>','San Carlos 1312,Cam Real San Jose','hda. Los Cantus','General Escobedo','Nuevo Leon','66059','N/A','86616260','8182541085','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 10:37:50'),(55,'<NAME>.L DE CV','<NAME> 2186, Interior 2','Obispado','Monterrey','Nuevo Leon','64060','ROOD140627F8A','83761499','8184709639','rs.com','<NAME>','PERSONA MORAL','EMPRESA',1,NULL,'2017-07-24 10:42:38'),(56,'<NAME>','C. Mision de San Jorge 152','Fracc. Mision de Huinala','Apodaca','Nuevo Leon','66646','N/A','25296854','8115616007','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 10:45:08'),(57,'<NAME>','C. Sirio. No.401','Fracc. Anahuac Sendero','General Escobedo','Nuevo Leon','66418','N/A','81053032','8182524658','','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 10:47:16'),(58,'<NAME>','6 de Enero, No.205.','El roble','San Nicolas','Nuevo Leon','','N/A','','8120028878','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-24 10:49:01'),(59,'UYGXIAKOFGVS','DZBG','XFBGB','GXFGB','GBFGB','GF','GFB','FXGB','FGB','GBF','GBF','PERSONA FISICA','HOGAR',0,NULL,'2017-07-25 13:31:58'),(60,'<NAME>','Barranca del Cobre #201','Las sierras','Mexico','NUEVO LEON','66377','N/A','','8111885147','<EMAIL>','N/A','PERSONA FISICA','HOGAR',1,NULL,'2017-07-26 15:38:52'),(61,'Prueba','Prueba','Prueba','Prueba','Prueba','Prueb','Prueba','Prueba','Prueba','Prueba','N/A','PERSONA FISICA','HOGAR',0,NULL,'2017-07-27 13:52:11'),(62,'<NAME>','J Arco 433','Roma','Monterrey','Nuevo Leon','64700','YAGC790621S60','','8112770365','<EMAIL>','','PERSONA FISICA','HOGAR',1,NULL,'2017-07-27 16:24:41'),(63,'XDN DHGN','GHN','GHNGH','NGH','NHG','NGHN','GHNGH','NGHN','GHNGHN','GHNGH','','PERSONA FISICA','',0,NULL,'2017-07-28 15:24:26'); /*!40000 ALTER TABLE `client` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `clientfile` -- DROP TABLE IF EXISTS `clientfile`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientfile` ( `fileId` int(11) NOT NULL AUTO_INCREMENT, `clientId` int(11) NOT NULL, `description` varchar(200) DEFAULT NULL, `name` varchar(2000) DEFAULT NULL, `originalname` varchar(2000) DEFAULT NULL, `enable` bit(1) DEFAULT b'1', PRIMARY KEY (`fileId`) ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `clientfile` -- LOCK TABLES `clientfile` WRITE; /*!40000 ALTER TABLE `clientfile` DISABLE KEYS */; INSERT INTO `clientfile` VALUES (11,48,'Credencial','2017-07-24 08.48.12.jpg','2017-07-24 08.48.12.jpg',''),(12,48,'Comprobante','2017-07-24 08.48.16.jpg','2017-07-24 08.48.16.jpg',''),(13,60,'Credencial','WhatsApp Image 2017-07-26 at 3.40.42 PM.jpeg','WhatsApp Image 2017-07-26 at 3.40.42 PM.jpeg',''),(14,45,'INE Y comprobante Dom','Pedro Riccardo.pdf','Pedro Riccardo.pdf','\0'),(15,45,'INE Y comprobante Dom','Pedro Riccardo.pdf','Pedro Riccardo.pdf',''),(16,40,'IFE','Sr. Marco.pdf','Sr. Marco.pdf',''),(17,58,'Licencia y Comprobante Dom','<NAME>.pdf','<NAME>.pdf','\0'),(18,58,'Licencia y Comprobante de Dom','D08 <NAME>.pdf','D08 <NAME>.pdf',''),(19,32,'Acta Constitutiva B01','EP 7719 constitutiva DEACERO c última pagina.pdf','EP 7719 constitutiva DEACERO c última pagina.pdf',''),(20,32,'RFC B01','image001.jpg','image001.jpg',''),(21,32,'INE B01','image002.jpg','image002.jpg',''),(22,32,'Comprobante Dom. B01','image003.png','image003.png',''),(23,34,'Pasaporte y Comprobante B','DINO RENZO.pdf','DINO RENZO.pdf','\0'),(24,34,'Pasaporte y Comprobante B05','DINO RENZO.pdf','DINO RENZO.pdf',''),(25,35,'IFE B08','REQUISITOS HECTOR.pdf','REQUISITOS HECTOR.pdf',''),(26,37,'INE B04','Alfredo Javier 2.jpeg','Alfredo Javier 2.jpeg',''),(27,37,'Comprobante B04','Alfredo Javier.jpeg','Alfredo Javier.jpeg',''),(28,38,'INE B09','Nora Laura.pdf','Nora Laura.pdf',''),(29,35,'Comprobante B08','Hector Comprobante.jpeg','Hector Comprobante.jpeg',''),(30,39,'IFE y Comprobante de domicilio','Sra. Veronica.pdf','Sra. Veronica.pdf',''),(31,40,'Comprobante Dom.','Marco comprobante.jpeg','Marco comprobante.jpeg',''),(32,41,'Comprobante Dom.','Sr. Angel Comprobante.pdf','Sr. Angel Comprobante.pdf',''),(33,41,'IFE','Sr. Angel IFE.pdf','Sr. Angel IFE.pdf',''),(34,43,'gfdg','Balance.xlsx','Balance.xlsx','\0'),(35,43,'g','Espacio BK.jpeg','Espacio BK.jpeg','\0'); /*!40000 ALTER TABLE `clientfile` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `payment` -- DROP TABLE IF EXISTS `payment`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment` ( `paymentId` int(11) NOT NULL, `rentId` int(11) DEFAULT NULL, `date` datetime DEFAULT NULL, `transaction` datetime DEFAULT NULL, `promotionId` int(11) DEFAULT NULL, `amount` decimal(10,2) NOT NULL DEFAULT '0.00', `discount` decimal(10,2) DEFAULT NULL, `description` varchar(2000) DEFAULT NULL, `comment` varchar(200) DEFAULT NULL, `methodOfPayment` varchar(45) DEFAULT NULL, `enable` tinyint(1) DEFAULT '1', `createByUserId` varchar(45) DEFAULT NULL, `createDatetime` datetime DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `payment` -- LOCK TABLES `payment` WRITE; /*!40000 ALTER TABLE `payment` DISABLE KEYS */; INSERT INTO `payment` VALUES (1,33,'2017-05-04 00:00:00','2017-05-04 21:10:29',NULL,3712.00,NULL,NULL,NULL,'Efectivo',1,NULL,'2017-05-04 21:10:29'),(2,42,'2017-04-03 00:00:00','2017-05-11 13:27:29',NULL,1450.00,NULL,NULL,NULL,'Efectivo',1,NULL,'2017-05-11 13:27:29'),(3,42,'2017-05-03 00:00:00','2017-05-11 13:27:53',NULL,1450.00,NULL,NULL,NULL,NULL,1,NULL,'2017-05-11 13:27:53'),(3,42,'2017-06-03 00:00:00','2017-05-11 13:27:53',NULL,1450.00,NULL,NULL,NULL,NULL,1,NULL,'2017-05-11 13:27:53'),(4,46,'2017-04-10 00:00:00','2017-05-11 13:29:39',NULL,3712.00,NULL,NULL,NULL,'Efectivo',1,NULL,'2017-05-11 13:29:39'),(5,39,'2017-01-12 00:00:00','2017-05-11 13:36:57',NULL,638.00,NULL,NULL,'SE PAGARON 3 MESES','Efectivo',1,NULL,'2017-05-11 13:36:57'),(6,46,'2017-05-10 00:00:00','2017-05-11 13:38:22',NULL,3712.00,NULL,NULL,NULL,'Efectivo',1,NULL,'2017-05-11 13:38:22'),(7,45,'2017-03-09 00:00:00','2017-05-11 13:42:26',NULL,1160.00,NULL,NULL,NULL,NULL,1,NULL,'2017-05-11 13:42:26'),(8,45,'2017-04-09 00:00:00','2017-05-11 13:50:26',NULL,1160.00,NULL,NULL,NULL,'Efectivo',1,NULL,'2017-05-11 13:50:26'),(9,44,'2017-03-06 00:00:00','2017-05-13 14:14:06',NULL,1450.00,NULL,NULL,NULL,'Efectivo',1,NULL,'2017-05-13 14:14:06'),(10,48,'2017-07-02 00:00:00','2017-07-02 00:35:13',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:13'),(10,NULL,NULL,'2017-07-02 00:35:13',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:13'),(10,NULL,NULL,'2017-07-02 00:35:13',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:13'),(11,48,'2017-07-02 00:00:00','2017-07-02 00:35:21',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:22'),(11,NULL,NULL,'2017-07-02 00:35:21',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:22'),(11,NULL,NULL,'2017-07-02 00:35:21',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:22'),(12,48,'2017-07-02 00:00:00','2017-07-02 00:35:38',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:38'),(12,NULL,NULL,'2017-07-02 00:35:38',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:38'),(12,NULL,NULL,'2017-07-02 00:35:38',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:38'),(13,48,'2017-07-02 00:00:00','2017-07-02 00:35:49',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:49'),(13,NULL,NULL,'2017-07-02 00:35:49',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:49'),(13,NULL,NULL,'2017-07-02 00:35:49',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:49'),(14,48,'2017-07-02 00:00:00','2017-07-02 00:35:51',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:51'),(14,NULL,NULL,'2017-07-02 00:35:51',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:51'),(14,NULL,NULL,'2017-07-02 00:35:51',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:51'),(15,48,'2017-07-02 00:00:00','2017-07-02 00:35:51',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:51'),(15,NULL,NULL,'2017-07-02 00:35:51',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:51'),(15,NULL,NULL,'2017-07-02 00:35:51',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:51'),(16,48,'2017-07-02 00:00:00','2017-07-02 00:35:52',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:53'),(16,NULL,NULL,'2017-07-02 00:35:52',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:53'),(16,NULL,NULL,'2017-07-02 00:35:52',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:53'),(17,48,'2017-07-02 00:00:00','2017-07-02 00:35:53',NULL,5104.00,0.00,NULL,'sad','Efectivo',1,NULL,'2017-07-02 00:35:53'),(17,NULL,NULL,'2017-07-02 00:35:53',NULL,34.00,NULL,'dsfdsf','sad','Efectivo',1,NULL,'2017-07-02 00:35:53'),(17,NULL,NULL,'2017-07-02 00:35:53',NULL,43.00,NULL,'dfssdfd','sad','Efectivo',1,NULL,'2017-07-02 00:35:53'),(18,49,'2017-07-02 00:00:00','2017-07-02 11:46:33',NULL,5104.00,0.00,NULL,'dsfsdg','Efectivo',0,NULL,'2017-07-02 11:46:33'),(18,NULL,NULL,'2017-07-06 15:55:01',NULL,100.00,NULL,'Candando',NULL,'Efectivo',1,NULL,'2017-07-06 15:55:01'),(18,47,'2017-08-20 00:00:00','2017-07-06 15:55:01',NULL,5104.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-06 15:55:01'),(19,50,'2017-07-14 00:00:00','2017-07-14 11:23:12',NULL,2552.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-14 11:23:13'),(20,52,'2017-07-17 00:00:00','2017-07-17 12:40:04',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-17 12:40:04'),(21,53,'2017-07-21 00:00:00','2017-07-21 13:39:41',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-21 13:39:41'),(22,54,'2017-07-24 00:00:00','2017-07-24 09:59:31',NULL,3712.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-24 09:59:31'),(23,51,'2017-07-14 00:00:00','2017-07-24 10:49:56',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:49:56'),(24,55,'2017-06-30 00:00:00','2017-07-24 10:51:54',NULL,3712.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:51:54'),(25,56,'2016-12-01 00:00:00','2017-07-24 10:53:55',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:53:55'),(26,56,'2017-01-01 00:00:00','2017-07-24 10:54:05',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:54:05'),(27,56,'2017-02-01 00:00:00','2017-07-24 10:54:16',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:54:16'),(28,56,'2017-03-01 00:00:00','2017-07-24 10:54:30',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:54:30'),(29,56,'2017-04-01 00:00:00','2017-07-24 10:54:43',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:54:43'),(30,56,'2017-05-01 00:00:00','2017-07-24 10:54:56',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:54:56'),(31,56,'2017-06-01 00:00:00','2017-07-24 10:55:14',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:55:14'),(32,56,'2017-07-01 00:00:00','2017-07-24 10:55:34',NULL,638.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-24 10:55:35'),(33,80,'2017-07-11 00:00:00','2017-07-25 14:09:48',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-25 14:09:48'),(34,81,'2017-07-26 00:00:00','2017-07-26 15:56:34',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-26 15:56:34'),(35,57,'2016-12-09 00:00:00','2017-07-28 09:17:50',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:17:50'),(36,57,'2017-01-09 00:00:00','2017-07-28 09:18:19',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:18:19'),(37,57,'2017-02-09 00:00:00','2017-07-28 09:18:59',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:18:59'),(38,57,'2017-03-09 00:00:00','2017-07-28 09:19:15',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:19:15'),(39,57,'2017-04-09 00:00:00','2017-07-28 09:19:34',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:19:34'),(40,57,'2017-05-09 00:00:00','2017-07-28 09:19:52',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:19:52'),(41,57,'2017-06-09 00:00:00','2017-07-28 09:20:09',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:20:09'),(42,57,'2017-07-09 00:00:00','2017-07-28 09:20:31',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:20:31'),(43,58,'2016-12-30 00:00:00','2017-07-28 09:20:59',NULL,3712.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:20:59'),(44,58,'2017-01-30 00:00:00','2017-07-28 09:21:31',NULL,3712.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:21:31'),(45,58,'2017-02-28 00:00:00','2017-07-28 09:21:49',NULL,3712.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:21:49'),(46,58,'2017-03-30 00:00:00','2017-07-28 09:22:13',NULL,3712.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:22:13'),(47,58,'2017-04-30 00:00:00','2017-07-28 09:22:30',NULL,3712.00,0.00,NULL,NULL,NULL,1,NULL,'2017-07-28 09:22:31'),(48,58,'2017-05-30 00:00:00','2017-07-28 09:22:49',NULL,3712.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:22:49'),(49,59,'2017-01-12 00:00:00','2017-07-28 09:23:08',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:23:08'),(50,59,'2017-02-12 00:00:00','2017-07-28 09:23:26',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:23:26'),(51,59,'2017-03-12 00:00:00','2017-07-28 09:23:44',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:23:44'),(52,59,'2017-04-12 00:00:00','2017-07-28 09:23:56',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:23:56'),(53,59,'2017-05-12 00:00:00','2017-07-28 09:24:12',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:24:12'),(54,59,'2017-06-12 00:00:00','2017-07-28 09:24:29',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:24:29'),(55,59,'2017-07-12 00:00:00','2017-07-28 09:24:48',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:24:48'),(56,60,'2017-01-24 00:00:00','2017-07-28 09:25:18',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:25:18'),(57,60,'2017-02-24 00:00:00','2017-07-28 09:25:30',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:25:30'),(58,60,'2017-03-24 00:00:00','2017-07-28 09:26:35',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:26:35'),(59,60,'2017-04-24 00:00:00','2017-07-28 09:26:46',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:26:46'),(60,60,'2017-05-24 00:00:00','2017-07-28 09:26:58',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:26:58'),(61,60,'2017-06-24 00:00:00','2017-07-28 09:27:12',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:27:12'),(62,60,'2017-07-24 00:00:00','2017-07-28 09:27:24',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:27:24'),(63,61,'2017-01-31 00:00:00','2017-07-28 09:28:18',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:28:18'),(64,61,'2017-02-28 00:00:00','2017-07-28 09:28:34',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:28:34'),(65,61,'2017-03-31 00:00:00','2017-07-28 09:28:46',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:28:46'),(66,61,'2017-04-30 00:00:00','2017-07-28 09:30:40',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:30:40'),(67,61,'2017-05-31 00:00:00','2017-07-28 09:31:04',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:31:04'),(68,61,'2017-06-30 00:00:00','2017-07-28 09:31:17',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:31:17'),(69,64,'2017-02-24 00:00:00','2017-07-28 09:31:40',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:31:40'),(70,64,'2017-03-24 00:00:00','2017-07-28 09:31:51',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:31:51'),(71,64,'2017-04-24 00:00:00','2017-07-28 09:32:02',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:32:02'),(72,64,'2017-05-24 00:00:00','2017-07-28 09:32:14',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:32:14'),(73,64,'2017-06-24 00:00:00','2017-07-28 09:32:28',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:32:28'),(74,64,'2017-07-24 00:00:00','2017-07-28 09:32:41',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:32:41'),(75,65,'2017-03-06 00:00:00','2017-07-28 09:32:58',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:32:58'),(76,65,'2017-04-06 00:00:00','2017-07-28 09:33:17',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:33:17'),(77,65,'2017-05-06 00:00:00','2017-07-28 09:33:31',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:33:31'),(78,65,'2017-06-06 00:00:00','2017-07-28 09:33:42',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:33:42'),(79,65,'2017-07-06 00:00:00','2017-07-28 09:33:55',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:33:55'),(80,66,'2017-03-09 00:00:00','2017-07-28 09:34:17',NULL,1160.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:34:17'),(81,66,'2017-04-09 00:00:00','2017-07-28 09:34:29',NULL,1160.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:34:29'),(82,66,'2017-05-09 00:00:00','2017-07-28 09:34:40',NULL,1160.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:34:40'),(83,66,'2017-06-09 00:00:00','2017-07-28 09:35:27',NULL,1160.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:35:27'),(84,66,'2017-07-09 00:00:00','2017-07-28 09:35:39',NULL,1160.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:35:39'),(85,69,'2017-03-29 00:00:00','2017-07-28 09:36:05',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:36:05'),(86,69,'2017-04-29 00:00:00','2017-07-28 09:36:16',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:36:16'),(87,69,'2017-05-29 00:00:00','2017-07-28 09:36:27',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:36:27'),(88,69,'2017-06-29 00:00:00','2017-07-28 09:36:42',NULL,638.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:36:42'),(89,62,'2017-04-24 00:00:00','2017-07-28 09:42:05',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:42:05'),(90,62,'2017-05-24 00:00:00','2017-07-28 09:44:22',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:44:22'),(91,62,'2017-06-24 00:00:00','2017-07-28 09:44:35',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:44:35'),(92,62,'2017-07-24 00:00:00','2017-07-28 09:44:48',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:44:48'),(93,70,'2017-04-26 00:00:00','2017-07-28 09:46:05',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:46:05'),(94,70,'2017-05-26 00:00:00','2017-07-28 09:46:16',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:46:16'),(95,70,'2017-06-26 00:00:00','2017-07-28 09:47:54',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:47:54'),(96,70,'2017-07-26 00:00:00','2017-07-28 09:48:06',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:48:06'),(97,71,'2017-05-25 00:00:00','2017-07-28 09:48:26',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:48:26'),(98,NULL,NULL,'2017-07-28 09:48:55',NULL,100.00,NULL,'Candado',NULL,'Transferencia',1,NULL,'2017-07-28 09:48:55'),(98,71,'2017-06-25 00:00:00','2017-07-28 09:48:55',NULL,1450.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:48:55'),(99,72,'2017-05-26 00:00:00','2017-07-28 09:49:25',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:49:25'),(100,72,'2017-06-26 00:00:00','2017-07-28 09:49:36',NULL,638.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:49:36'),(101,72,'2017-07-26 00:00:00','2017-07-28 09:49:49',NULL,638.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:49:49'),(102,82,'2017-06-09 00:00:00','2017-07-28 09:51:10',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:51:10'),(103,85,'2017-06-09 00:00:00','2017-07-28 09:51:51',NULL,928.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:51:51'),(104,85,'2017-07-09 00:00:00','2017-07-28 09:53:05',NULL,928.00,0.00,NULL,NULL,'Transferencia',1,NULL,'2017-07-28 09:53:05'),(105,75,'2017-06-13 00:00:00','2017-07-28 09:53:35',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:53:35'),(106,75,'2017-07-13 00:00:00','2017-07-28 09:53:48',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:53:48'),(107,86,'2017-06-27 00:00:00','2017-07-28 09:54:06',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:54:06'),(108,86,'2017-07-27 00:00:00','2017-07-28 09:54:41',NULL,1450.00,0.00,NULL,'Vence los 27/07/2017 MES GRATIS','Efectivo',1,NULL,'2017-07-28 09:54:41'),(109,76,'2017-06-27 00:00:00','2017-07-28 09:54:55',NULL,1450.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:54:55'),(110,76,'2017-07-27 00:00:00','2017-07-28 09:55:14',NULL,1450.00,0.00,NULL,'mes de julio gratis','Efectivo',1,NULL,'2017-07-28 09:55:14'),(111,77,'2017-06-27 00:00:00','2017-07-28 09:55:33',NULL,2552.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:55:33'),(112,77,'2017-07-27 00:00:00','2017-07-28 09:55:59',NULL,2552.00,0.00,NULL,'MES JULIO GRATIS.','Efectivo',1,NULL,'2017-07-28 09:55:59'),(113,78,'2017-06-30 00:00:00','2017-07-28 09:56:27',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:56:27'),(114,79,'2017-06-30 00:00:00','2017-07-28 09:56:54',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:56:54'),(115,67,'2017-07-07 00:00:00','2017-07-28 09:57:40',NULL,2552.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:57:40'),(116,68,'2017-07-07 00:00:00','2017-07-28 09:57:51',NULL,2552.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-07-28 09:57:51'),(117,61,'2017-07-31 00:00:00','2017-08-02 11:15:04',NULL,638.00,0.00,NULL,NULL,'Efectivo',1,NULL,'2017-08-02 11:15:04'); /*!40000 ALTER TABLE `payment` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `promotion` -- DROP TABLE IF EXISTS `promotion`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `promotion` ( `promotionId` int(11) NOT NULL AUTO_INCREMENT, `promotiontypeId` int(11) NOT NULL, `name` varchar(200) NOT NULL, `description` varchar(400) DEFAULT NULL, `amount` decimal(10,0) DEFAULT NULL, `percentage` int(11) DEFAULT NULL, `enable` tinyint(1) NOT NULL DEFAULT '1', `createByUserId` int(11) DEFAULT NULL, `createDatetime` datetime DEFAULT NULL, PRIMARY KEY (`promotionId`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `promotion` -- LOCK TABLES `promotion` WRITE; /*!40000 ALTER TABLE `promotion` DISABLE KEYS */; INSERT INTO `promotion` VALUES (1,1,'1','2',NULL,100,0,NULL,NULL),(2,1,'3','4',NULL,100,0,NULL,NULL),(3,1,'3 x 2','Te regalamos 1 mes, pagando 2.',NULL,100,1,NULL,NULL); /*!40000 ALTER TABLE `promotion` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `promotiontype` -- DROP TABLE IF EXISTS `promotiontype`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `promotiontype` ( `promotiontypeId` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) NOT NULL, `enable` tinyint(1) DEFAULT '1', `createByUserId` varchar(45) DEFAULT NULL, `createDatetime` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`promotiontypeId`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `promotiontype` -- LOCK TABLES `promotiontype` WRITE; /*!40000 ALTER TABLE `promotiontype` DISABLE KEYS */; INSERT INTO `promotiontype` VALUES (1,'Mes gratis',1,NULL,NULL),(2,'Descuento',1,NULL,NULL); /*!40000 ALTER TABLE `promotiontype` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `quotes` -- DROP TABLE IF EXISTS `quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `quotes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` varchar(150) NOT NULL, `private` tinyint(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `quotes` -- LOCK TABLES `quotes` WRITE; /*!40000 ALTER TABLE `quotes` DISABLE KEYS */; INSERT INTO `quotes` VALUES (1,'SADFGDAGDScdsfgsdcdfgsdfgsd',0),(2,'SADFxsvccvGDA GDSc dsfg sdcdfgsdfgsd',0),(3,'SAfgsd',1); /*!40000 ALTER TABLE `quotes` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `rent` -- DROP TABLE IF EXISTS `rent`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `rent` ( `rentId` int(11) NOT NULL AUTO_INCREMENT, `clientId` int(11) NOT NULL, `storagelokerId` int(11) NOT NULL, `startDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `endDate` datetime DEFAULT NULL, `cost` decimal(10,2) DEFAULT '0.00', `iva` decimal(10,2) DEFAULT '0.00', `extra` decimal(10,2) DEFAULT '0.00', `total` decimal(10,2) DEFAULT '0.00', `comment` varchar(500) NOT NULL DEFAULT '', `folio` varchar(20) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', `enable` tinyint(1) NOT NULL DEFAULT '1', `createByUserId` int(11) DEFAULT NULL, `createDatetime` datetime DEFAULT NULL, PRIMARY KEY (`rentId`) ) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `rent` -- LOCK TABLES `rent` WRITE; /*!40000 ALTER TABLE `rent` DISABLE KEYS */; INSERT INTO `rent` VALUES (24,12,2,'2017-01-20 16:01:00','2017-04-27 13:04:52',2200.00,252.00,0.00,2552.00,'','B1701A02024',0,0,NULL,NULL),(25,12,2,'2017-01-20 16:01:00',NULL,2200.00,252.00,0.00,2552.00,'','B1701A02025',1,0,NULL,NULL),(26,12,2,'2017-01-20 16:01:00',NULL,2200.00,252.00,0.00,2552.00,'','B1701A02026',1,0,NULL,NULL),(27,12,8,'2017-01-24 23:01:00',NULL,200.00,0.00,0.00,3200.00,'','B1701A08027',1,0,NULL,NULL),(28,12,8,'2017-01-24 23:01:00',NULL,200.00,0.00,0.00,3200.00,'','B1701A08028',1,0,NULL,NULL),(29,12,8,'2017-01-24 23:01:00',NULL,200.00,0.00,0.00,3200.00,'','B1701A08029',1,0,NULL,NULL),(30,12,9,'2017-04-27 13:05:10',NULL,1250.00,16.00,0.00,1450.00,'','B1704A09030',1,0,NULL,NULL),(31,13,6,'2017-04-29 09:52:14',NULL,2200.00,352.00,NULL,2552.00,'','B1704A06031',1,0,NULL,NULL),(33,16,5,'2017-05-04 21:07:58',NULL,3200.00,512.00,0.00,3712.00,'','B1705A05033',1,0,NULL,NULL),(34,19,45,'2016-11-10 10:10:14',NULL,550.00,88.00,0.00,638.00,'','B1611A04034',1,0,NULL,NULL),(35,20,49,'2016-12-01 10:50:09','2017-07-06 15:55:31',550.00,88.00,0.00,638.00,'','B1612B05035',0,0,NULL,NULL),(36,21,52,'2016-12-09 10:53:11',NULL,550.00,88.00,0.00,638.00,'','B1612B08036',1,0,NULL,NULL),(37,22,51,'2016-12-16 10:56:03',NULL,550.00,88.00,0.00,638.00,'','B1612B07037',1,0,NULL,NULL),(38,23,41,'2016-12-30 10:59:07',NULL,3200.00,512.00,0.00,3712.00,'','B1612D02038',1,0,NULL,NULL),(39,24,48,'2017-01-12 11:01:49',NULL,550.00,88.00,0.00,638.00,'','B1701B04039',1,0,NULL,NULL),(40,25,53,'2017-01-24 11:05:27',NULL,550.00,88.00,0.00,638.00,'','B1701B09040',1,0,NULL,NULL),(41,26,46,'2017-01-23 11:07:52',NULL,550.00,88.00,0.00,638.00,'','B1701A03041',1,0,NULL,NULL),(42,27,28,'2017-04-03 11:10:09',NULL,1250.00,200.00,0.00,1450.00,'','B1704C03042',1,0,NULL,NULL),(43,28,27,'2017-02-24 11:12:22',NULL,1250.00,200.00,0.00,1450.00,'','B1702C02043',1,0,NULL,NULL),(44,29,22,'2017-03-06 11:15:43',NULL,1250.00,200.00,0.00,1450.00,'','B1703B11044',1,0,NULL,NULL),(45,30,26,'2017-03-09 11:18:20',NULL,1000.00,160.00,0.00,1160.00,'','B1703C01045',1,0,NULL,NULL),(46,31,12,'2017-03-10 11:28:44',NULL,3200.00,512.00,0.00,3712.00,'','B1703B01046',1,0,NULL,NULL),(47,32,57,'2017-05-20 12:51:13',NULL,4400.00,704.00,0.00,5104.00,'','B1705C0506047',1,0,NULL,NULL),(48,32,58,'2017-07-02 00:33:36',NULL,4400.00,704.00,0.00,5104.00,'','B1707W01048',1,0,NULL,NULL),(49,32,58,'2017-07-02 11:45:25',NULL,4400.00,704.00,0.00,5104.00,'','B1707W01049',1,0,NULL,NULL),(50,32,6,'2017-07-14 11:16:36',NULL,2200.00,352.00,0.00,2552.00,'','B1707A06050',1,0,NULL,NULL),(51,33,74,'2017-07-14 12:25:56',NULL,550.00,88.00,0.00,638.00,'','B1707A04051',1,1,NULL,NULL),(52,43,75,'2017-07-17 12:26:48',NULL,1250.00,200.00,0.00,1450.00,'','B1707D13052',1,1,NULL,NULL),(53,45,76,'2017-07-21 13:36:46',NULL,1250.00,200.00,0.00,1450.00,'','B1707D12053',1,1,NULL,NULL),(54,48,13,'2017-07-24 09:57:52',NULL,3200.00,512.00,0.00,3712.00,'','B1707B02054',1,1,NULL,NULL),(55,32,12,'2017-06-30 10:50:06',NULL,3200.00,512.00,0.00,3712.00,'','B1706B01055',1,1,NULL,NULL),(56,34,49,'2016-12-01 10:52:06',NULL,550.00,88.00,0.00,638.00,'','B1612B05056',1,1,NULL,NULL),(57,35,52,'2016-12-09 10:56:03',NULL,550.00,88.00,0.00,638.00,'','B1612B08057',1,1,NULL,NULL),(58,36,41,'2016-12-30 10:58:34',NULL,3200.00,512.00,0.00,3712.00,'','B1612D02058',1,1,NULL,NULL),(59,37,48,'2017-01-12 10:59:55',NULL,550.00,88.00,0.00,638.00,'','B1701B04059',1,1,NULL,NULL),(60,38,53,'2017-01-24 11:00:46',NULL,550.00,88.00,0.00,638.00,'','B1701B09060',1,1,NULL,NULL),(61,39,46,'2017-01-31 11:01:39',NULL,550.00,88.00,0.00,638.00,'','B1701A03061',1,1,NULL,NULL),(62,39,28,'2017-04-24 11:02:40',NULL,1250.00,200.00,0.00,1450.00,'','B1704C03062',1,1,NULL,NULL),(63,40,27,'2017-02-02 11:03:53',NULL,1250.00,200.00,0.00,1450.00,'','B1702C02063',1,0,NULL,NULL),(64,40,27,'2017-02-24 11:04:48',NULL,1250.00,200.00,0.00,1450.00,'','B1702C02064',1,1,NULL,NULL),(65,41,69,'2017-03-06 11:05:29',NULL,1250.00,200.00,0.00,1450.00,'','B1703B19065',1,1,NULL,NULL),(66,42,78,'2017-03-09 11:09:20',NULL,1000.00,160.00,0.00,1160.00,'','B1703C01066',1,1,NULL,NULL),(67,44,30,'2017-07-07 11:11:12',NULL,2200.00,352.00,0.00,2552.00,'','B1707C05067',1,1,NULL,NULL),(68,44,31,'2017-07-07 11:11:42',NULL,2200.00,352.00,0.00,2552.00,'','B1707C06068',1,1,NULL,NULL),(69,46,50,'2017-03-29 13:09:27',NULL,550.00,88.00,0.00,638.00,'','B1703B06069',1,1,NULL,NULL),(70,49,70,'2017-04-26 13:11:15',NULL,1250.00,200.00,0.00,1450.00,'','B1704B20070',1,1,NULL,NULL),(71,50,37,'2017-05-25 13:13:09',NULL,1250.00,200.00,0.00,1450.00,'','B1705C12071',1,1,NULL,NULL),(72,51,47,'2017-05-26 13:17:39',NULL,550.00,88.00,0.00,638.00,'','B1705B03072',1,1,NULL,NULL),(73,59,6,'2017-07-25 13:32:01',NULL,2200.00,352.00,0.00,2552.00,'','B1707A06073',1,0,NULL,NULL),(74,52,63,'2017-06-09 13:49:14',NULL,550.00,88.00,0.00,638.00,'','B1706B13074',1,0,NULL,NULL),(75,53,35,'2017-06-13 13:50:25',NULL,1250.00,200.00,0.00,1450.00,'','B1706C10075',1,1,NULL,NULL),(76,54,38,'2017-06-27 13:52:07',NULL,1250.00,200.00,0.00,1450.00,'','B1706C13076',1,1,NULL,NULL),(77,55,59,'2017-06-27 13:52:59',NULL,2200.00,352.00,0.00,2552.00,'','B1706A01077',1,1,NULL,NULL),(78,56,51,'2017-06-30 13:54:04',NULL,550.00,88.00,0.00,638.00,'','B1706B07078',1,1,NULL,NULL),(79,57,54,'2017-06-30 13:54:37',NULL,550.00,88.00,0.00,638.00,'','B1706B10079',1,1,NULL,NULL),(80,39,79,'2017-07-11 13:56:45',NULL,550.00,88.00,0.00,638.00,'','B1707D03080',1,1,NULL,NULL),(81,60,80,'2017-07-26 15:43:26',NULL,1250.00,200.00,0.00,1450.00,'','B1707D07081',1,0,NULL,NULL),(82,52,71,'2017-06-09 13:28:59',NULL,1250.00,200.00,0.00,1450.00,'','B1706B21082',1,1,NULL,NULL),(83,61,81,'2017-07-27 13:53:31','2017-07-27 13:55:15',550.00,88.00,0.00,638.00,'','B1707A04083',0,0,NULL,NULL),(84,62,95,'2017-06-09 16:24:58','2017-07-27 16:31:18',800.00,128.00,0.00,928.00,'','B1706X01084',0,0,NULL,NULL),(85,62,95,'2017-06-09 16:31:36',NULL,800.00,128.00,0.00,928.00,'','B1706X01085',1,1,NULL,NULL),(86,54,32,'2017-06-27 09:15:14',NULL,1250.00,200.00,0.00,1450.00,'','B1706C07086',1,1,NULL,NULL),(87,58,80,'2017-06-02 14:06:02',NULL,1250.00,200.00,0.00,1450.00,'','B1706D07087',1,1,NULL,NULL),(88,63,82,'2017-07-28 15:24:28',NULL,550.00,88.00,0.00,638.00,'','B1707A04088',1,0,NULL,NULL),(89,38,8,'2017-07-28 15:29:48',NULL,3200.00,512.00,0.00,3712.00,'','B1707A08089',1,1,NULL,NULL); /*!40000 ALTER TABLE `rent` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `rentauthorization` -- DROP TABLE IF EXISTS `rentauthorization`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `rentauthorization` ( `rentauthorizationId` int(11) NOT NULL AUTO_INCREMENT, `rentId` int(11) DEFAULT NULL, `userId` int(11) DEFAULT NULL, `enable` tinyint(1) DEFAULT '1', `createByUserId` int(11) DEFAULT NULL, `createDatetime` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`rentauthorizationId`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `rentauthorization` -- LOCK TABLES `rentauthorization` WRITE; /*!40000 ALTER TABLE `rentauthorization` DISABLE KEYS */; INSERT INTO `rentauthorization` VALUES (1,30,11,1,NULL,'2017-04-27 13:05:55'),(2,31,11,1,NULL,'2017-04-29 09:54:43'),(3,33,11,1,NULL,'2017-05-04 21:08:13'),(4,48,12,1,NULL,'2017-07-02 00:33:59'),(5,49,12,1,NULL,'2017-07-02 11:45:47'),(6,50,11,1,NULL,'2017-07-14 11:16:48'),(7,84,13,1,NULL,'2017-07-27 16:27:09'),(8,84,11,1,NULL,'2017-07-27 16:27:09'),(9,85,11,1,NULL,'2017-07-27 16:32:06'),(10,85,13,1,NULL,'2017-07-27 16:32:06'),(11,89,13,1,NULL,'2017-07-28 15:30:27'),(12,89,11,1,NULL,'2017-07-28 15:30:27'),(13,89,14,1,NULL,'2017-07-28 15:30:27'); /*!40000 ALTER TABLE `rentauthorization` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `rentfile` -- DROP TABLE IF EXISTS `rentfile`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `rentfile` ( `rentfileId` int(11) NOT NULL AUTO_INCREMENT, `rentId` int(11) NOT NULL, `name` varchar(200) NOT NULL, `originalname` varchar(200) DEFAULT NULL, `enable` tinyint(1) DEFAULT '1', PRIMARY KEY (`rentfileId`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `rentfile` -- LOCK TABLES `rentfile` WRITE; /*!40000 ALTER TABLE `rentfile` DISABLE KEYS */; INSERT INTO `rentfile` VALUES (1,42,'BD Clientes GuardarTodo.accdb','BD Clientes GuardarTodo.accdb',1); /*!40000 ALTER TABLE `rentfile` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `rentpromotion` -- DROP TABLE IF EXISTS `rentpromotion`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `rentpromotion` ( `rentpromotionId` int(11) NOT NULL AUTO_INCREMENT, `rentId` int(11) NOT NULL, `promotionId` int(11) NOT NULL, `applied` tinyint(1) DEFAULT '0', `enable` tinyint(1) DEFAULT '1', `createByUserId` varchar(45) DEFAULT NULL, `createDatetime` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`rentpromotionId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `rentpromotion` -- LOCK TABLES `rentpromotion` WRITE; /*!40000 ALTER TABLE `rentpromotion` DISABLE KEYS */; /*!40000 ALTER TABLE `rentpromotion` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `storageloker` -- DROP TABLE IF EXISTS `storageloker`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `storageloker` ( `storagelokerId` int(11) NOT NULL AUTO_INCREMENT, `storagelokertypeId` int(11) NOT NULL, `number` varchar(45) NOT NULL, `enable` tinyint(1) DEFAULT '1', `createByUserId` int(11) DEFAULT NULL, `createDatetime` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`storagelokerId`) ) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `storageloker` -- LOCK TABLES `storageloker` WRITE; /*!40000 ALTER TABLE `storageloker` DISABLE KEYS */; INSERT INTO `storageloker` VALUES (1,5,'A01',1,NULL,'2016-12-19 21:01:47'),(2,6,'A02',1,NULL,'2016-12-19 21:01:47'),(3,1,'A03',1,NULL,'2016-12-19 21:01:47'),(4,1,'A04',1,NULL,'2016-12-19 21:01:47'),(5,4,'A05',1,NULL,'2016-12-19 21:01:47'),(6,3,'A06',1,NULL,'2016-12-19 21:01:47'),(7,3,'A07',0,NULL,'2016-12-19 21:01:47'),(8,4,'A08',1,NULL,'2016-12-19 21:01:47'),(9,4,'A09',1,NULL,'2016-12-19 21:01:47'),(10,4,'A10',1,NULL,'2016-12-19 21:01:47'),(11,4,'A11',1,NULL,'2016-12-19 21:01:47'),(12,4,'B01',1,NULL,'2016-12-19 21:01:47'),(13,4,'B02',1,NULL,'2016-12-19 21:01:47'),(14,1,'B03',1,NULL,'2016-12-19 21:01:47'),(15,1,'B04',1,NULL,'2016-12-19 21:01:47'),(16,1,'B05',1,NULL,'2016-12-19 21:01:47'),(17,1,'B06',1,NULL,'2016-12-19 21:01:47'),(18,1,'B07',1,NULL,'2016-12-19 21:01:47'),(19,1,'B08',1,NULL,'2016-12-19 21:01:47'),(20,1,'B09',1,NULL,'2016-12-19 21:01:47'),(21,1,'B10',1,NULL,'2016-12-19 21:01:47'),(22,2,'B11',0,NULL,'2016-12-19 21:01:47'),(23,2,'B12',0,NULL,'2016-12-19 21:01:47'),(24,2,'B22',0,NULL,'2016-12-19 21:01:47'),(25,2,'B14',0,NULL,'2016-12-19 21:01:47'),(26,8,'C01',1,NULL,'2016-12-19 21:01:47'),(27,2,'C02',1,NULL,'2016-12-19 21:01:47'),(28,2,'C03',1,NULL,'2016-12-19 21:01:47'),(29,3,'C04',1,NULL,'2016-12-19 21:01:47'),(30,3,'C05',1,NULL,'2016-12-19 21:01:47'),(31,3,'C06',1,NULL,'2016-12-19 21:01:47'),(32,2,'C07',1,NULL,'2016-12-19 21:01:47'),(33,3,'C08',1,NULL,'2016-12-19 21:01:47'),(34,1,'C09',1,NULL,'2016-12-19 21:01:47'),(35,2,'C10',1,NULL,'2016-12-19 21:01:47'),(36,4,'C11',1,NULL,'2016-12-19 21:01:47'),(37,2,'C12',1,NULL,'2016-12-19 21:01:47'),(38,2,'C13',1,NULL,'2016-12-19 21:01:47'),(39,1,'C14',1,NULL,'2016-12-19 21:01:47'),(40,4,'D01',1,NULL,'2016-12-19 21:01:47'),(41,4,'D02',1,NULL,'2016-12-19 21:01:47'),(42,3,'D03',0,NULL,'2016-12-19 21:01:47'),(43,3,'D04',0,NULL,'2016-12-19 21:01:47'),(44,3,'D05',0,NULL,'2016-12-19 21:01:47'),(45,7,'A04',0,NULL,'2017-05-06 10:10:09'),(46,7,'A03',1,NULL,'2017-05-06 10:44:28'),(47,7,'B03',1,NULL,'2017-05-06 10:44:39'),(48,7,'B04',1,NULL,'2017-05-06 10:44:50'),(49,7,'B05',1,NULL,'2017-05-06 10:44:56'),(50,7,'B06',1,NULL,'2017-05-06 10:45:01'),(51,7,'B07',1,NULL,'2017-05-06 10:45:09'),(52,7,'B08',1,NULL,'2017-05-06 10:45:15'),(53,7,'B09',1,NULL,'2017-05-06 10:45:21'),(54,7,'B10',1,NULL,'2017-05-06 10:45:27'),(55,7,'C09',1,NULL,'2017-05-06 10:45:37'),(56,7,'C14',0,NULL,'2017-05-06 10:45:43'),(57,9,'C0506',0,NULL,'2017-05-20 12:50:43'),(58,9,'W01',0,NULL,'2017-07-02 00:31:40'),(59,3,'A01',1,NULL,'2017-07-14 12:06:08'),(60,3,'A02',1,NULL,'2017-07-14 12:08:04'),(61,7,'B11',1,NULL,'2017-07-14 12:14:47'),(62,7,'B12',1,NULL,'2017-07-14 12:14:59'),(63,7,'B13',1,NULL,'2017-07-14 12:15:08'),(64,7,'B14',1,NULL,'2017-07-14 12:15:23'),(65,7,'B15',1,NULL,'2017-07-14 12:15:31'),(66,7,'B16',1,NULL,'2017-07-14 12:15:45'),(67,7,'B17',1,NULL,'2017-07-14 12:15:54'),(68,7,'B18',1,NULL,'2017-07-14 12:16:04'),(69,2,'B19',1,NULL,'2017-07-14 12:16:39'),(70,2,'B20',1,NULL,'2017-07-14 12:16:48'),(71,2,'B21',1,NULL,'2017-07-14 12:16:59'),(72,2,'B22',0,NULL,'2017-07-14 12:17:10'),(73,7,'A03',0,NULL,'2017-07-14 12:25:46'),(74,7,'A04',0,NULL,'2017-07-14 12:25:52'),(75,2,'D13',1,NULL,'2017-07-17 12:26:46'),(76,2,'D12',1,NULL,'2017-07-21 13:36:38'),(77,4,'B02',0,NULL,'2017-07-24 09:57:49'),(78,11,'C01',1,NULL,'2017-07-24 11:09:17'),(79,7,'D03',1,NULL,'2017-07-25 13:56:42'),(80,2,'D07',1,NULL,'2017-07-26 15:43:23'),(81,7,'A04',0,NULL,'2017-07-27 13:49:59'),(82,7,'A04',1,NULL,'2017-07-27 13:59:19'),(83,12,'B22',1,NULL,'2017-07-27 14:03:56'),(84,7,'D04',1,NULL,'2017-07-27 14:06:09'),(85,7,'D05',1,NULL,'2017-07-27 14:06:24'),(86,7,'D06',1,NULL,'2017-07-27 14:06:37'),(87,2,'D08',1,NULL,'2017-07-27 14:06:58'),(88,7,'D09',1,NULL,'2017-07-27 14:07:11'),(89,7,'D10',1,NULL,'2017-07-27 14:07:25'),(90,7,'D11',1,NULL,'2017-07-27 14:07:36'),(91,2,'D14',1,NULL,'2017-07-27 14:08:06'),(92,3,'D15',1,NULL,'2017-07-27 14:08:18'),(93,3,'D16',1,NULL,'2017-07-27 14:08:30'),(94,3,'D17',1,NULL,'2017-07-27 14:08:41'),(95,14,'X01',1,NULL,'2017-07-27 16:23:37'),(96,3,'A07',1,NULL,'2017-07-28 15:18:49'); /*!40000 ALTER TABLE `storageloker` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `storagelokertype` -- DROP TABLE IF EXISTS `storagelokertype`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `storagelokertype` ( `storagelokertypeId` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) NOT NULL, `description` varchar(45) DEFAULT NULL, `price` decimal(8,2) NOT NULL, `size` varchar(45) DEFAULT NULL, `enable` tinyint(1) DEFAULT '1', `createByUserId` int(11) DEFAULT NULL, `createDatetime` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`storagelokertypeId`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `storagelokertype` -- LOCK TABLES `storagelokertype` WRITE; /*!40000 ALTER TABLE `storagelokertype` DISABLE KEYS */; INSERT INTO `storagelokertype` VALUES (1,'MiniBodega','Medidas 1 x 3',550.00,'3mts²',0,NULL,'2016-12-19 20:26:29'),(2,'Chica','Medidas 2.4 x 3',1250.00,'7mts²',1,NULL,'2016-12-19 20:26:29'),(3,'Mediana','Medidas 2.9 x 3.7',2200.00,'11mts²',1,NULL,'2016-12-19 20:26:29'),(4,'Grande','Medidas 4 x 4',3200.00,'16mts²',1,NULL,'2016-12-19 20:26:29'),(5,'Especial','42mts²',0.00,NULL,0,NULL,'2017-01-21 13:17:18'),(6,'Especial',NULL,2563.00,NULL,0,NULL,'2017-01-21 13:34:59'),(7,'Minibodega','1 x 3',550.00,'3 mts²',1,NULL,'2017-05-06 09:40:16'),(8,'Especial CH 5mts²','Bodega Chica, tiene menos metros cuadrados',1000.00,'2.5 x 3',0,NULL,'2017-05-11 13:49:03'),(9,'Especial 22mts²','Mayor capacidad',4400.00,NULL,0,NULL,'2017-05-20 12:50:24'),(10,'1',NULL,2.00,'3 mts²',0,NULL,'2017-07-02 00:30:59'),(11,'Especial 5m','Bodega de',1000.00,'5 mts²',1,NULL,'2017-07-24 11:08:43'),(12,'Especial 13m','Bodega de',2600.00,'13 mts²',1,NULL,'2017-07-27 15:15:39'),(13,'Especial 4m','Medias 1.3X3',600.00,'4 mts²',1,NULL,'2017-07-27 16:09:05'),(14,'Ext','Espacio Libre, Sin bodega (Carros, Tarimas)',800.00,'Variaible',1,NULL,'2017-07-27 16:23:05'); /*!40000 ALTER TABLE `storagelokertype` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user` -- DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user` ( `userId` int(11) NOT NULL AUTO_INCREMENT, `firstName` varchar(200) NOT NULL, `lastName` varchar(200) NOT NULL, `username` varchar(20) NOT NULL, `password` varchar(20) NOT NULL, `reset` tinyint(1) DEFAULT '1', `imgUrl` varchar(200) DEFAULT NULL, `enable` tinyint(1) DEFAULT '1', PRIMARY KEY (`userId`,`username`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user` -- LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; INSERT INTO `user` VALUES (1,'Administrador','','admin','Gu4rdar@Todo',0,'users-1.svg',1),(11,'<NAME>','<NAME>','Valeria','GT1234',0,'users-5.svg',1),(12,'Edilberto','Salazar','mosh','tool4',0,'users-10.svg',0),(13,'<NAME>.','Llamas','Llamas','12345',1,'users-10.svg',1),(14,'VXDV','SDVSD','Miguel','12345',1,'users-8.svg',1); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; -- -- Dumping routines for database 'guardartododb' -- /*!50003 DROP FUNCTION IF EXISTS `f_get_payment_status` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = utf8 */ ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `f_get_payment_status`(rentId int) RETURNS int(11) BEGIN RETURN 1; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 DROP FUNCTION IF EXISTS `f_pending_payments` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = utf8 */ ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `f_pending_payments`(rentId int) RETURNS int(11) BEGIN DECLARE pending INT; DECLARE i INT; DECLARE counter INT; DECLARE valida BIT; SELECT timestampdiff(month, r.startDate, DATE_ADD(NOW(), INTERVAL 1 MONTH)) FROM rent r WHERE r.rentId = rentId INTO pending; SET i = 0; SET counter = 0; WHILE(i < pending) DO SET i = i + 1; SELECT COALESCE(sum(p.amount),0) < r.total from payment p INNER JOIN rent r ON p.rentId = r.rentId WHERE p.rentId = rentId AND p.enable = 1 AND p.date BETWEEN DATE_ADD(DATE(r.startDate), INTERVAL i-1 MONTH) AND DATE_ADD(DATE(r.startDate), INTERVAL i MONTH) INTO valida; set counter = counter + IF(valida = 1, 1, 0); END WHILE; RETURN counter; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 DROP PROCEDURE IF EXISTS `sp_get_pendingpayment_rent` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = utf8 */ ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_get_pendingpayment_rent`(p_rentId int) BEGIN DECLARE pending INT; DECLARE i INT; DECLARE counter INT; drop temporary table if exists valida; create temporary table valida ( id int unsigned not null, valid int null, date date not null ); SELECT timestampdiff(month, r.startDate, DATE_ADD(NOW(), INTERVAL 12 MONTH)) FROM rent r WHERE r.rentId = p_rentId INTO pending; SET i = 0; SET counter = 0; WHILE(i < pending) DO SET i = i + 1; INSERT INTO valida SELECT i, COALESCE(sum(p.amount),0) < r.total, DATE_ADD(DATE(r.startDate), INTERVAL i-1 MONTH) from payment p INNER JOIN rent r ON p.rentId = r.rentId WHERE p.rentId = p_rentId AND p.enable = 1 AND p.date BETWEEN DATE_ADD(DATE(r.startDate), INTERVAL i-1 MONTH) AND DATE_ADD(DATE(r.startDate), INTERVAL i MONTH); END WHILE; select * FROM valida; drop temporary table if exists valida; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 DROP PROCEDURE IF EXISTS `sp_new_clients` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = utf8 */ ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_new_clients`() BEGIN DECLARE i INT; DECLARE counter INT; SET i = 0; SET counter = 5; drop temporary table if exists tabletemp; create temporary table tabletemp ( count int null, date date not null ); WHILE(i < counter) DO INSERT INTO tabletemp SELECT count(c.clientId), DATE_ADD(date_format(now(), '%y-%m-01' ), INTERVAL i - counter MONTH) FROM client c WHERE c.enable = 1 AND date(c.createDatetime) BETWEEN DATE_ADD(date_format(now(), '%y-%m-01' ), INTERVAL i - counter MONTH) AND last_day(DATE_ADD(date_format(now(), '%y-%m-01' ), INTERVAL i - counter MONTH)); SET i = i + 1; END WHILE; select * FROM tabletemp; drop temporary table if exists tabletemp; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 DROP PROCEDURE IF EXISTS `sp_storagelokers_rented` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = utf8 */ ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_storagelokers_rented`() BEGIN DECLARE i INT; DECLARE counter INT; SET i = 0; SET counter = 5; drop temporary table if exists tabletemp; create temporary table tabletemp ( count int null, date date not null ); WHILE(i < counter) DO INSERT INTO tabletemp SELECT count(r.rentId), DATE_ADD(date_format(now(), '%y-%m-01' ), INTERVAL i - counter MONTH) FROM rent r WHERE r.enable = 1 AND date(r.startDate) BETWEEN DATE_ADD(date_format(now(), '%y-%m-01' ), INTERVAL i - counter MONTH) AND last_day(DATE_ADD(date_format(now(), '%y-%m-01' ), INTERVAL i - counter MONTH)); SET i = i + 1; END WHILE; select * FROM tabletemp; drop temporary table if exists tabletemp; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-08-02 23:20:56
with accounts as ( select * from {{ref('quickbooks_accounts_xf')}} ), ledger as ( select * from {{ref('quickbooks_general_ledger')}} ), d1 as ( select ledger.*, case when transaction_type = account_type then 1 else -1 end as multiplier from ledger inner join accounts on ledger.account_id = accounts.id ) select id, txn_date, amount, account_id, {% if var('classes_enabled', true) %} class_id, {% endif %} transaction_type, source, amount * multiplier as adj_amount, sum(amount * multiplier) over (partition by account_id order by txn_date rows unbounded preceding) as current_account_balance from d1
<reponame>jrharalson/almanac.httparchive.org #standardSQL # 09_19c: % valid ARIA attributes # Valid attributes from https://github.com/dequelabs/axe-core/blob/master/lib/commons/aria/index.js CREATE TEMPORARY FUNCTION isValidAttribute(attr STRING) RETURNS BOOLEAN AS (attr IN ('aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant', 'aria-roledescription')); SELECT client, COUNTIF(isValidAttribute(attr)) AS freq, COUNT(attr) AS total, ROUND(COUNTIF(isValidAttribute(attr)) * 100 / COUNT(attr), 2) AS pct FROM `httparchive.almanac.summary_response_bodies`, UNNEST(REGEXP_EXTRACT_ALL(LOWER(body), '<[^>]+\\b(aria-\\w+)=[\'"]?[\\w-]+')) AS attr WHERE date = '2019-07-01' AND firstHtml AND attr IS NOT NULL GROUP BY client ORDER BY freq / total DESC
<filename>query/src/test/resources/query/sql/query62.sql select test_kylin_fact.lstg_format_name,sum(test_kylin_fact.price) as GMV , min(cal_dt) as min_cal_dt , count(*) as TRANS_CNT from test_kylin_fact group by test_kylin_fact.lstg_format_name having sum(price)>5000 and count(*)>72
CREATE TABLE event_participants ( participants_id BINARY(16) NOT NULL, event_id BINARY(16) NOT NULL, PRIMARY KEY (participants_id, event_id), FOREIGN KEY participant_id_join_fk (participants_id) REFERENCES participant (id), FOREIGN KEY event_id_join_fk (event_id) REFERENCES event (id) ) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
<filename>src/test/tinc/tincrepo/mpp/gpdb/tests/storage/aoco_alter/aoco_alter_scenario_test/sql/largetab-altercol-failvalidate.sql -- -- @created 2014-06-06 12:00:00 -- @modified 2014-06-06 12:00:00 -- @tags storage -- @description Validate that the alter table add/drop column did not work when a 'panic fault' was introduced as the alter was taking place \d large_aoco_table
-- simple batch start CREATE PROCEDURE p8146 AS SELECT 1 GO EXEC p8146 1 GO DROP PROCEDURE p8146 GO begin transaction GO CREATE PROCEDURE p8146 AS SELECT 1 GO EXEC p8146 1 GO -- Below output is only applicable if query is special case. for example, CREATE/ALTER TRIGGER, CREATE/ALTER FUNCTION, CREATE/ALTER PROC, CREATE/ALTER VIEW etc if (@@trancount > 0) select cast('compile time error' as text) else select cast('runtime error' as text) GO if (@@trancount > 0) rollback tran GO DROP PROCEDURE p8146 GO -- simple batch end GO create schema error_mapping; GO -- Next portion is to check if error is being raised during parse analysis phase GO create table error_mapping.temp1 (a int) GO CREATE PROCEDURE p8146 AS SELECT 1 GO create procedure error_mapping.ErrorHandling1 as begin insert into error_mapping.temp1 values(1) EXEC p8146 1 end GO DROP PROCEDURE p8146 GO create table error_mapping.temp2 (a int) GO CREATE PROCEDURE p8146 AS SELECT 1 GO insert into error_mapping.temp2 values(1) EXEC p8146 1 GO DROP PROCEDURE p8146 GO -- Here we are assuming that error_mapping.ErrorHandling1 is created with no error GO create table error_mapping.temp3 (a int) GO CREATE PROCEDURE p8146 AS SELECT 1 GO insert into error_mapping.temp3 values(1) exec error_mapping.ErrorHandling1; GO DROP PROCEDURE p8146 GO if ((select count(*) from error_mapping.temp1) = 0 and (select count(*) from error_mapping.temp2) = 0 and (select count(*) from error_mapping.temp3) > 0) select cast('parse analysis phase error' as text) GO drop procedure error_mapping.ErrorHandling1; GO drop table error_mapping.temp1; drop table error_mapping.temp2; drop table error_mapping.temp3; GO -- Parse analysis phase end GO -- compile time error portion -- Executing test error_mapping.ErrorHandling1 CREATE PROCEDURE p8146 AS SELECT 1 GO create procedure error_mapping.ErrorHandling1 as begin EXEC p8146 1 if @@error > 0 select cast('STATEMENT TERMINATING ERROR' as text); select @@trancount; end GO if @@error > 0 select cast('Compile time error' as text); if @@trancount > 0 rollback transaction; drop procedure error_mapping.ErrorHandling1; set xact_abort OFF; set implicit_transactions OFF; GO DROP PROCEDURE p8146 GO CREATE PROCEDURE p8146 AS SELECT 1 GO begin transaction GO -- Executing test error_mapping.ErrorHandling1 create procedure error_mapping.ErrorHandling1 as begin EXEC p8146 1 if @@error > 0 select cast('STATEMENT TERMINATING ERROR' as text); end GO declare @err int = @@error; if (@err > 0 and @@trancount > 0) select cast('BATCH ONLY TERMINATING' as text) else if @err > 0 select cast('BATCH TERMINATING\ txn rolledback' as text); if @@trancount > 0 rollback transaction; drop procedure error_mapping.ErrorHandling1; set xact_abort OFF; set implicit_transactions OFF; GO GO DROP PROCEDURE p8146 GO -- Checking xact_abort_flag for compile time error -- set xact_abort ON; GO CREATE PROCEDURE p8146 AS SELECT 1 GO begin transaction GO -- Executing test error_mapping.ErrorHandling1 create procedure error_mapping.ErrorHandling1 as begin EXEC p8146 1 if @@error > 0 select cast('STATEMENT TERMINATING ERROR' as text); end GO declare @err int = @@error; if (@err > 0 and @@trancount > 0) select cast('BATCH ONLY TERMINATING' as text) else if @err > 0 select cast('BATCH TERMINATING\ txn rolledback' as text); if @@trancount > 0 rollback transaction; drop procedure error_mapping.ErrorHandling1; set xact_abort OFF; set implicit_transactions OFF; GO GO DROP PROCEDURE p8146 GO set xact_abort OFF; GO -- comiple time error portion end -- -- Next portion is for runtime error -- -- Executing test error_mapping.ErrorHandling10000000 CREATE PROCEDURE p8146 AS SELECT 1 GO create procedure error_mapping.ErrorHandling1 as begin EXEC p8146 1 if @@error > 0 select cast('STATEMENT TERMINATING ERROR' as text); select @@trancount; end GO if @@error > 0 select cast('CURRENT BATCH TERMINATING ERROR' as text); GO create procedure error_mapping.ErrorHandling2 as begin exec error_mapping.ErrorHandling1; if @@error > 0 select cast('CURRENT BATCH TERMINATING ERROR' as text); end GO begin transaction; GO exec error_mapping.ErrorHandling2; GO declare @err int = @@error; if (@err > 0 and @@trancount > 0) select cast('BATCH ONLY TERMINATING' as text) else if @err > 0 select cast('BATCH TERMINATING\ txn rolledback' as text); if @@trancount > 0 rollback transaction; drop procedure error_mapping.ErrorHandling1; drop procedure error_mapping.ErrorHandling2; set xact_abort OFF; set implicit_transactions OFF; GO DROP PROCEDURE p8146 GO set xact_abort ON; GO -- Executing test error_mapping.ErrorHandling10000000 CREATE PROCEDURE p8146 AS SELECT 1 GO create procedure error_mapping.ErrorHandling1 as begin EXEC p8146 1 if @@error > 0 select cast('STATEMENT TERMINATING ERROR' as text); select @@trancount; end GO if @@error > 0 select cast('CURRENT BATCH TERMINATING ERROR' as text); GO create procedure error_mapping.ErrorHandling2 as begin exec error_mapping.ErrorHandling1; if @@error > 0 select cast('CURRENT BATCH TERMINATING ERROR' as text); end GO begin transaction; GO exec error_mapping.ErrorHandling2; GO declare @err int = @@error; if (@err > 0 and @@trancount > 0) select cast('BATCH ONLY TERMINATING' as text) else if @err > 0 select cast('BATCH TERMINATING\ txn rolledback' as text); if @@trancount > 0 rollback transaction; drop procedure error_mapping.ErrorHandling1; drop procedure error_mapping.ErrorHandling2; set xact_abort OFF; set implicit_transactions OFF; GO DROP PROCEDURE p8146 GO set xact_abort OFF; GO -- Error classification is done -- -- Executing test error_mapping.ErrorHandling10000000 CREATE PROCEDURE p8146 AS SELECT 1 GO begin try select 1 EXEC p8146 1 end try begin catch select xact_state(); end catch if @@trancount > 0 rollback transaction; drop procedure error_mapping.ErrorHandling1; drop procedure error_mapping.ErrorHandling2; set xact_abort OFF; set implicit_transactions OFF; GO DROP PROCEDURE p8146 GO GO drop schema error_mapping; GO
/* Navicat MySQL Data Transfer Source Server : mysql Source Server Version : 50617 Source Host : localhost:3306 Source Database : wms Target Server Type : MYSQL Target Server Version : 50617 File Encoding : 65001 Date: 2016-08-07 09:54:10 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `wms_access` -- ---------------------------- DROP TABLE IF EXISTS `wms_access`; CREATE TABLE `wms_access` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主id', `role_id` smallint(6) unsigned NOT NULL COMMENT '角色id', `node_id` smallint(6) unsigned NOT NULL COMMENT '节点id', `level` tinyint(1) NOT NULL COMMENT '级别', `pid` smallint(6) DEFAULT NULL COMMENT '父id', `module` varchar(50) DEFAULT NULL COMMENT '模块', PRIMARY KEY (`id`), KEY `idx_role_id` (`role_id`), KEY `idx_node_id` (`node_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限分配'; -- ---------------------------- -- Records of wms_access -- ---------------------------- -- ---------------------------- -- Table structure for `wms_ad` -- ---------------------------- DROP TABLE IF EXISTS `wms_ad`; CREATE TABLE `wms_ad` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主id', `name` varchar(40) NOT NULL DEFAULT '' COMMENT '广告位名称', `mark` varchar(30) NOT NULL DEFAULT '' COMMENT '广告位标识', `platform` tinyint(1) NOT NULL DEFAULT '0' COMMENT '设备平台[见配置文件]', `ad_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=代码2=文字3=图片', `time_limit` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1=永不过期2=时间限制', `start_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '开始时间', `end_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '结束时间', `normal_content` text NOT NULL COMMENT '正常显示内容', `overdue_content` text NOT NULL COMMENT '过期显示内容', `status` tinyint(1) DEFAULT '1' COMMENT '1为可用 2为禁用', `is_deleted` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=正常 2=删除', `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`), KEY `idx_time_limit` (`time_limit`), KEY `idx_mark` (`mark`), KEY `idx_start_time` (`start_time`), KEY `idx_end_time` (`end_time`), KEY `idx_status` (`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告'; -- ---------------------------- -- Records of wms_ad -- ---------------------------- -- ---------------------------- -- Table structure for `wms_admin` -- ---------------------------- DROP TABLE IF EXISTS `wms_admin`; CREATE TABLE `wms_admin` ( `id` mediumint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `nickname` varchar(16) DEFAULT NULL COMMENT '昵称', `username` varchar(16) NOT NULL COMMENT '用户名', `password` varchar(32) NOT NULL COMMENT '密码', `tel` varchar(15) DEFAULT NULL, `email` varchar(15) DEFAULT NULL, `create_time` int(11) unsigned NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`), KEY `nickname` (`nickname`) ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COMMENT='用户表'; -- ---------------------------- -- Records of wms_admin -- ---------------------------- INSERT INTO `wms_admin` VALUES ('1', '布尔', 'bool', 'c506ff134babdd6e68ab3e6350e95305', '18101565685', '<EMAIL>', '1475662263'); INSERT INTO `wms_admin` VALUES ('32', 'test', 'test', '098f6bcd4621d373cade4e832627b4f6', '222000', '<EMAIL>', '1461049869'); INSERT INTO `wms_admin` VALUES ('33', 'admin', 'admin', 'd9b1d7db4cd6e70935368a1efb10e377', '11', '<EMAIL>', '1461204870'); -- ---------------------------- -- Table structure for `wms_admin_role` -- ---------------------------- DROP TABLE IF EXISTS `wms_admin_role`; CREATE TABLE `wms_admin_role` ( `role_id` mediumint(12) unsigned NOT NULL COMMENT '角色id', `admin_id` mediumint(12) unsigned NOT NULL COMMENT '用户id', KEY `role_id` (`role_id`), KEY `admin_id` (`admin_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_admin_role -- ---------------------------- INSERT INTO `wms_admin_role` VALUES ('1', '33'); INSERT INTO `wms_admin_role` VALUES ('7', '33'); INSERT INTO `wms_admin_role` VALUES ('1', '1'); INSERT INTO `wms_admin_role` VALUES ('7', '32'); INSERT INTO `wms_admin_role` VALUES ('10', '32'); -- ---------------------------- -- Table structure for `wms_attribute` -- ---------------------------- DROP TABLE IF EXISTS `wms_attribute`; CREATE TABLE `wms_attribute` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `type` enum('range','number','radio','file','checkbox','button','week','time','date','password','text','email','url','month','tel','search','select','color') DEFAULT 'text', `content` varchar(200) DEFAULT NULL, `note` varchar(200) DEFAULT NULL, `time` int(11) unsigned DEFAULT NULL, `status` tinyint(1) unsigned DEFAULT '0', PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_attribute -- ---------------------------- INSERT INTO `wms_attribute` VALUES ('28', '号码', 'checkbox', '34,35,36,37,38,39,40,41,42,43,44,45,46', '鞋子号码', '1461557423', '0'); INSERT INTO `wms_attribute` VALUES ('29', '颜色', 'checkbox', '白色,黑色,蓝色,绿色,紫色,红色,天蓝色', '鞋子颜色', '1461557664', '0'); INSERT INTO `wms_attribute` VALUES ('31', '出厂日期', 'date', '', '出厂日期', '1461571851', '0'); INSERT INTO `wms_attribute` VALUES ('32', '号码', 'checkbox', 'XS,S,M,L,XL,XXL,XXXL', '衣服尺寸', '1461808173', '0'); INSERT INTO `wms_attribute` VALUES ('33', '颜色', 'checkbox', '白色,黑色,蓝色,绿色,紫色,红色,天蓝色', '衣服', '1461831605', '0'); INSERT INTO `wms_attribute` VALUES ('34', '季节', 'select', '春秋,夏季,冬季', '鞋子季节', '1461831862', '0'); INSERT INTO `wms_attribute` VALUES ('35', '材质', 'text', '', '鞋子的材质', '1461831994', '0'); INSERT INTO `wms_attribute` VALUES ('36', '款式', 'select', '商务,休闲,运动,韩版,英伦', '鞋子款式', '1461832335', '0'); INSERT INTO `wms_attribute` VALUES ('37', '适用对象', 'select', '儿童(6-18),青年(18-25周岁),中年(26-40),中老年(40-50),老年(50以上)', '鞋子适用对象', '1461832510', '1'); INSERT INTO `wms_attribute` VALUES ('38', '闭合方式', 'select', '系带,拉链', '鞋子闭合方式', '1461832716', '1'); INSERT INTO `wms_attribute` VALUES ('39', '鞋跟', 'select', '平底,中跟,高跟,内增高', '鞋子鞋跟样式', '1461832801', '0'); -- ---------------------------- -- Table structure for `wms_brand` -- ---------------------------- DROP TABLE IF EXISTS `wms_brand`; CREATE TABLE `wms_brand` ( `id` mediumint(9) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(40) DEFAULT NULL, `time` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='品牌表'; -- ---------------------------- -- Records of wms_brand -- ---------------------------- INSERT INTO `wms_brand` VALUES ('1', 'XTEP/特步', '1461312069'); INSERT INTO `wms_brand` VALUES ('2', '耐克NIKE', '1461312183'); INSERT INTO `wms_brand` VALUES ('3', 'ANTA/安踏', '1461312192'); INSERT INTO `wms_brand` VALUES ('4', '贵人鸟', '1461312200'); INSERT INTO `wms_brand` VALUES ('5', '李宁', '1461312246'); INSERT INTO `wms_brand` VALUES ('6', '乔丹', '1461312252'); INSERT INTO `wms_brand` VALUES ('7', 'erke/鸿星尔克', '1461312267'); INSERT INTO `wms_brand` VALUES ('8', '阿迪达斯', '1461312279'); INSERT INTO `wms_brand` VALUES ('9', '361°', '1461312279'); -- ---------------------------- -- Table structure for `wms_category` -- ---------------------------- DROP TABLE IF EXISTS `wms_category`; CREATE TABLE `wms_category` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(40) NOT NULL, `time` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='商品分类'; -- ---------------------------- -- Records of wms_category -- ---------------------------- INSERT INTO `wms_category` VALUES ('1', '鞋子', '1461307800'); INSERT INTO `wms_category` VALUES ('2', '衣服', '1461307877'); INSERT INTO `wms_category` VALUES ('3', '袜子', '1461207877'); INSERT INTO `wms_category` VALUES ('4', '男鞋', '1461310483'); INSERT INTO `wms_category` VALUES ('5', '女鞋', '1461310492'); INSERT INTO `wms_category` VALUES ('6', '运动鞋', '1461310561'); INSERT INTO `wms_category` VALUES ('7', '休闲鞋', '1461310572'); INSERT INTO `wms_category` VALUES ('8', '帆布鞋', '1461310686'); INSERT INTO `wms_category` VALUES ('9', '皮鞋', '1461310759'); -- ---------------------------- -- Table structure for `wms_category_attribute` -- ---------------------------- DROP TABLE IF EXISTS `wms_category_attribute`; CREATE TABLE `wms_category_attribute` ( `category_id` mediumint(12) unsigned NOT NULL COMMENT '鍟嗗搧id', `attribute_id` mediumint(12) unsigned NOT NULL COMMENT '灞炴€d' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_category_attribute -- ---------------------------- INSERT INTO `wms_category_attribute` VALUES ('1', '28'); INSERT INTO `wms_category_attribute` VALUES ('1', '29'); INSERT INTO `wms_category_attribute` VALUES ('4', '30'); INSERT INTO `wms_category_attribute` VALUES ('1', '31'); INSERT INTO `wms_category_attribute` VALUES ('2', '32'); INSERT INTO `wms_category_attribute` VALUES ('2', '33'); INSERT INTO `wms_category_attribute` VALUES ('1', '34'); INSERT INTO `wms_category_attribute` VALUES ('1', '35'); INSERT INTO `wms_category_attribute` VALUES ('1', '36'); INSERT INTO `wms_category_attribute` VALUES ('1', '37'); INSERT INTO `wms_category_attribute` VALUES ('1', '38'); INSERT INTO `wms_category_attribute` VALUES ('1', '39'); -- ---------------------------- -- Table structure for `wms_config` -- ---------------------------- DROP TABLE IF EXISTS `wms_config`; CREATE TABLE `wms_config` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键递增', `field_name` varchar(30) NOT NULL DEFAULT '' COMMENT '字段名称', `field_value` varchar(150) NOT NULL DEFAULT '' COMMENT '字段内容', `field_desc` varchar(30) NOT NULL DEFAULT '' COMMENT '字段描述', `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '类型', `atta_type` tinyint(1) NOT NULL DEFAULT '2' COMMENT '1=有附件2=无', `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`), KEY `idx_filed_name` (`field_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网站配置'; -- ---------------------------- -- Records of wms_config -- ---------------------------- -- ---------------------------- -- Table structure for `wms_depot` -- ---------------------------- DROP TABLE IF EXISTS `wms_depot`; CREATE TABLE `wms_depot` ( `id` mediumint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(60) NOT NULL COMMENT '仓库名称', `time` int(11) unsigned NOT NULL COMMENT '时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仓库表'; -- ---------------------------- -- Records of wms_depot -- ---------------------------- -- ---------------------------- -- Table structure for `wms_depot_store` -- ---------------------------- DROP TABLE IF EXISTS `wms_depot_store`; CREATE TABLE `wms_depot_store` ( `depot_id` mediumint(12) unsigned NOT NULL COMMENT '仓库id', `store_id` mediumint(12) unsigned NOT NULL COMMENT '门店id', KEY `depot_id` (`depot_id`), KEY `store_id` (`store_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仓库'; -- ---------------------------- -- Records of wms_depot_store -- ---------------------------- -- ---------------------------- -- Table structure for `wms_goods` -- ---------------------------- DROP TABLE IF EXISTS `wms_goods`; CREATE TABLE `wms_goods` ( `id` mediumint(12) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id', `sn` varchar(60) NOT NULL COMMENT 'sn', `name` varchar(60) NOT NULL COMMENT '名称', `brand_id` mediumint(9) unsigned NOT NULL COMMENT '品牌id', `time` int(11) unsigned DEFAULT NULL COMMENT '时间', `price` decimal(10,2) DEFAULT NULL, `sum` mediumint(12) unsigned DEFAULT NULL, `total` decimal(12,2) unsigned DEFAULT NULL, `store_id` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `sn` (`sn`) USING BTREE, KEY `brand_id` (`brand_id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_goods -- ---------------------------- INSERT INTO `wms_goods` VALUES ('1', '001', '特步01', '3', '1461576497', '20.00', '190', '3800.00', '1'); INSERT INTO `wms_goods` VALUES ('2', '002', '特步02', '1', '1461576854', '60.00', '20', '1200.00', null); INSERT INTO `wms_goods` VALUES ('3', '003', '衣服', '1', '1461810099', '99.00', '11', '1089.00', '3'); INSERT INTO `wms_goods` VALUES ('4', '004', '贵人鸟鞋子', '4', '1462258269', '120.00', '30', '3600.00', null); INSERT INTO `wms_goods` VALUES ('6', '005', '特步衣服', '1', '1462258724', '80.00', '50', '4000.00', null); INSERT INTO `wms_goods` VALUES ('7', '006', '李宁', '5', '1462335589', '30.00', '80', '2400.00', null); INSERT INTO `wms_goods` VALUES ('8', '007', '贵人鸟衣服', '4', '1462335911', '20.00', '50', '1000.00', null); INSERT INTO `wms_goods` VALUES ('9', '008', 'bool', '1', '1462351559', '50.00', '50', '2500.00', null); INSERT INTO `wms_goods` VALUES ('10', '009', '111', '1', '1462353852', '20.00', '100', '2000.00', null); INSERT INTO `wms_goods` VALUES ('11', '0010', 'slaon', '7', '1462354174', '60.00', '50', '3000.00', null); INSERT INTO `wms_goods` VALUES ('12', '0011', '测试', '1', '1462409831', '100.00', '140', '14000.00', null); INSERT INTO `wms_goods` VALUES ('13', '0012', 'is_test', '1', '1462412320', '100.00', '40', '4000.00', null); INSERT INTO `wms_goods` VALUES ('14', '0013', 'is bool', '1', '1462412576', '150.00', '180', '27000.00', null); INSERT INTO `wms_goods` VALUES ('15', '0014', '搜索', '1', '1462412825', '160.00', '50', '8000.00', null); INSERT INTO `wms_goods` VALUES ('16', '0015', '测试数据', '1', '1462413110', '39.00', '77', '3003.00', '2'); INSERT INTO `wms_goods` VALUES ('17', '0016', 'Haley', '1', '1462424710', '30.00', '158', '4740.00', null); INSERT INTO `wms_goods` VALUES ('18', '0071', '1111二个', '4', '1462516379', '30.00', '10', '300.00', '2'); -- ---------------------------- -- Table structure for `wms_goods_attrbute` -- ---------------------------- DROP TABLE IF EXISTS `wms_goods_attrbute`; CREATE TABLE `wms_goods_attrbute` ( `goods_id` mediumint(9) unsigned DEFAULT NULL, `attrbute_id` mediumint(9) unsigned DEFAULT NULL, `attrbute_value` varchar(50) DEFAULT NULL, `price` decimal(10,2) unsigned DEFAULT NULL, `count` mediumint(12) unsigned DEFAULT NULL, `val` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_goods_attrbute -- ---------------------------- INSERT INTO `wms_goods_attrbute` VALUES ('11', '0', 'XS:白色 ', '60.00', '9', null); INSERT INTO `wms_goods_attrbute` VALUES ('11', '0', 'M:白色 ', '60.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('2', '39', null, null, null, '中跟'); INSERT INTO `wms_goods_attrbute` VALUES ('2', '36', null, null, null, '韩版'); INSERT INTO `wms_goods_attrbute` VALUES ('2', '35', null, null, null, '棉布'); INSERT INTO `wms_goods_attrbute` VALUES ('2', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('2', '31', null, null, null, '2016-05-02'); INSERT INTO `wms_goods_attrbute` VALUES ('2', '0', '40:白色 ', '60.00', '19', null); INSERT INTO `wms_goods_attrbute` VALUES ('4', '0', '40:白色 ', '120.00', '19', null); INSERT INTO `wms_goods_attrbute` VALUES ('4', '0', '40:蓝色 ', '120.00', '10', null); INSERT INTO `wms_goods_attrbute` VALUES ('4', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('4', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('4', '35', null, null, null, '皮革'); INSERT INTO `wms_goods_attrbute` VALUES ('4', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('4', '31', null, null, null, '2016-05-05'); INSERT INTO `wms_goods_attrbute` VALUES ('6', '0', 'M:白色 ', '80.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('6', '0', 'M:黑色 ', '60.00', '20', null); INSERT INTO `wms_goods_attrbute` VALUES ('8', '0', 'M:蓝色 ', '20.00', '19', null); INSERT INTO `wms_goods_attrbute` VALUES ('8', '0', 'L:蓝色 ', '30.00', '19', null); INSERT INTO `wms_goods_attrbute` VALUES ('7', '0', '40:白色 ', '30.00', '19', null); INSERT INTO `wms_goods_attrbute` VALUES ('7', '0', '41:白色 ', '30.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('7', '0', '42:白色 ', '30.00', '38', null); INSERT INTO `wms_goods_attrbute` VALUES ('7', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('7', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('7', '35', null, null, null, '皮革'); INSERT INTO `wms_goods_attrbute` VALUES ('7', '34', null, null, null, '夏季'); INSERT INTO `wms_goods_attrbute` VALUES ('7', '31', null, null, null, '2016-05-03'); INSERT INTO `wms_goods_attrbute` VALUES ('15', '0', '40:白色 ', '160.00', '19', null); INSERT INTO `wms_goods_attrbute` VALUES ('15', '0', '41:白色 ', '160.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('15', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('15', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('15', '35', null, null, null, '漆皮PU'); INSERT INTO `wms_goods_attrbute` VALUES ('15', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('15', '31', null, null, null, '2016-05-06'); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '34:白色 ', '34.00', '20', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '34:黑色 ', '34.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '34:蓝色 ', '34.00', '34', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '35:白色 ', '35.00', '40', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '35:黑色 ', '35.00', '48', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '35:蓝色 ', '35.00', '35', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '36:白色 ', '36.00', '36', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '36:黑色 ', '36.00', '36', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '0', '36:蓝色 ', '36.00', '36', null); INSERT INTO `wms_goods_attrbute` VALUES ('14', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('14', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('14', '35', null, null, null, 'PU'); INSERT INTO `wms_goods_attrbute` VALUES ('14', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('14', '31', null, null, null, '2016-05-05'); INSERT INTO `wms_goods_attrbute` VALUES ('13', '0', '34:白色 ', '100.00', '20', null); INSERT INTO `wms_goods_attrbute` VALUES ('13', '0', '34:黑色 ', '100.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('13', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('13', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('13', '35', null, null, null, '帆布'); INSERT INTO `wms_goods_attrbute` VALUES ('13', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('13', '31', null, null, null, '2016-05-06'); INSERT INTO `wms_goods_attrbute` VALUES ('12', '0', '34:白色 ', '100.00', '20', null); INSERT INTO `wms_goods_attrbute` VALUES ('12', '0', '34:黑色 ', '100.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('12', '0', '35:白色 ', '100.00', '40', null); INSERT INTO `wms_goods_attrbute` VALUES ('12', '0', '35:黑色 ', '100.00', '48', null); INSERT INTO `wms_goods_attrbute` VALUES ('12', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('12', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('12', '35', null, null, null, '橡胶'); INSERT INTO `wms_goods_attrbute` VALUES ('12', '34', null, null, null, '夏季'); INSERT INTO `wms_goods_attrbute` VALUES ('12', '31', null, null, null, '2016-05-03'); INSERT INTO `wms_goods_attrbute` VALUES ('9', '0', '34:白色 ', '50.00', '20', null); INSERT INTO `wms_goods_attrbute` VALUES ('9', '0', '34:黑色 ', '50.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('9', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('9', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('9', '35', null, null, null, 'PVC'); INSERT INTO `wms_goods_attrbute` VALUES ('9', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('9', '31', null, null, null, '2016-05-04'); INSERT INTO `wms_goods_attrbute` VALUES ('10', '0', '34:白色 ', '20.00', '20', null); INSERT INTO `wms_goods_attrbute` VALUES ('10', '0', '34:黑色 ', '20.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('10', '0', '35:白色 ', '20.00', '40', null); INSERT INTO `wms_goods_attrbute` VALUES ('10', '0', '35:黑色 ', '20.00', '48', null); INSERT INTO `wms_goods_attrbute` VALUES ('10', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('10', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('10', '35', null, null, null, '网布'); INSERT INTO `wms_goods_attrbute` VALUES ('10', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('10', '31', null, null, null, '2016-05-01'); INSERT INTO `wms_goods_attrbute` VALUES ('17', '0', '39:白色 ', '30.00', '39', null); INSERT INTO `wms_goods_attrbute` VALUES ('17', '0', '39:黑色 ', '30.00', '39', null); INSERT INTO `wms_goods_attrbute` VALUES ('17', '0', '40:白色 ', '30.00', '19', null); INSERT INTO `wms_goods_attrbute` VALUES ('17', '0', '40:黑色 ', '30.00', '40', null); INSERT INTO `wms_goods_attrbute` VALUES ('17', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('17', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('17', '35', null, null, null, '皮革'); INSERT INTO `wms_goods_attrbute` VALUES ('17', '34', null, null, null, '春秋'); INSERT INTO `wms_goods_attrbute` VALUES ('17', '31', null, null, null, '2016-05-04'); INSERT INTO `wms_goods_attrbute` VALUES ('1', '0', '41:白色 ', '20.00', '30', null); INSERT INTO `wms_goods_attrbute` VALUES ('1', '0', '41:黑色 ', '20.00', '29', null); INSERT INTO `wms_goods_attrbute` VALUES ('1', '0', '42:白色 ', '20.00', '38', null); INSERT INTO `wms_goods_attrbute` VALUES ('1', '0', '42:黑色 ', '20.00', '78', null); INSERT INTO `wms_goods_attrbute` VALUES ('1', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('1', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('1', '35', null, null, null, '皮革'); INSERT INTO `wms_goods_attrbute` VALUES ('1', '34', null, null, null, '冬季'); INSERT INTO `wms_goods_attrbute` VALUES ('1', '31', null, null, null, '2016-04-30'); INSERT INTO `wms_goods_attrbute` VALUES ('3', '0', 'M:白色 ', '99.00', '1', null); INSERT INTO `wms_goods_attrbute` VALUES ('3', '0', 'L:白色 ', '99.00', '10', null); INSERT INTO `wms_goods_attrbute` VALUES ('16', '0', '38:蓝色 ', '39.00', '39', null); INSERT INTO `wms_goods_attrbute` VALUES ('16', '0', '39:蓝色 ', '38.00', '38', null); INSERT INTO `wms_goods_attrbute` VALUES ('16', '39', null, null, null, '平底'); INSERT INTO `wms_goods_attrbute` VALUES ('16', '36', null, null, null, '商务'); INSERT INTO `wms_goods_attrbute` VALUES ('16', '35', null, null, null, 'PU'); INSERT INTO `wms_goods_attrbute` VALUES ('16', '34', null, null, null, '夏季'); INSERT INTO `wms_goods_attrbute` VALUES ('16', '31', null, null, null, '2016-05-03'); INSERT INTO `wms_goods_attrbute` VALUES ('18', '0', 'XS:白色 ', '30.00', '9', null); -- ---------------------------- -- Table structure for `wms_goods_category` -- ---------------------------- DROP TABLE IF EXISTS `wms_goods_category`; CREATE TABLE `wms_goods_category` ( `goods_id` mediumint(9) unsigned NOT NULL, `category_id` mediumint(9) unsigned NOT NULL, KEY `category_id` (`category_id`), KEY `goods_id` (`goods_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_goods_category -- ---------------------------- INSERT INTO `wms_goods_category` VALUES ('11', '2'); INSERT INTO `wms_goods_category` VALUES ('2', '1'); INSERT INTO `wms_goods_category` VALUES ('4', '1'); INSERT INTO `wms_goods_category` VALUES ('6', '2'); INSERT INTO `wms_goods_category` VALUES ('8', '2'); INSERT INTO `wms_goods_category` VALUES ('7', '1'); INSERT INTO `wms_goods_category` VALUES ('15', '1'); INSERT INTO `wms_goods_category` VALUES ('14', '1'); INSERT INTO `wms_goods_category` VALUES ('13', '1'); INSERT INTO `wms_goods_category` VALUES ('12', '1'); INSERT INTO `wms_goods_category` VALUES ('9', '1'); INSERT INTO `wms_goods_category` VALUES ('10', '1'); INSERT INTO `wms_goods_category` VALUES ('17', '1'); INSERT INTO `wms_goods_category` VALUES ('1', '1'); INSERT INTO `wms_goods_category` VALUES ('3', '2'); INSERT INTO `wms_goods_category` VALUES ('16', '1'); INSERT INTO `wms_goods_category` VALUES ('18', '2'); -- ---------------------------- -- Table structure for `wms_goods_extend` -- ---------------------------- DROP TABLE IF EXISTS `wms_goods_extend`; CREATE TABLE `wms_goods_extend` ( `goods_id` mediumint(9) unsigned DEFAULT NULL, `val` varchar(20) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `count` mediumint(12) unsigned DEFAULT NULL, `time` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_goods_extend -- ---------------------------- -- ---------------------------- -- Table structure for `wms_link` -- ---------------------------- DROP TABLE IF EXISTS `wms_link`; CREATE TABLE `wms_link` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键递增', `title` varchar(30) NOT NULL DEFAULT '' COMMENT '标题', `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=友情链接 2=合作伙伴', `icon` varchar(60) NOT NULL DEFAULT '' COMMENT '图片', `url` varchar(60) NOT NULL DEFAULT '' COMMENT '链接地址', `order` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=启用 2=禁用', `is_deleted` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=正常 2=删除', `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`), KEY `idx_create_time` (`create_time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='友情链接'; -- ---------------------------- -- Records of wms_link -- ---------------------------- -- ---------------------------- -- Table structure for `wms_news` -- ---------------------------- DROP TABLE IF EXISTS `wms_news`; CREATE TABLE `wms_news` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键递增', `title` varchar(30) NOT NULL DEFAULT '' COMMENT '标题', `category_id` int(10) NOT NULL DEFAULT '0' COMMENT '类别ID', `content` text NOT NULL COMMENT '内容', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=启用 2=禁用', `is_deleted` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=正常 2=删除', `publish_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '发布时间', `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`), KEY `idx_category_id` (`category_id`), KEY `idx_create_time` (`create_time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='最新公告'; -- ---------------------------- -- Records of wms_news -- ---------------------------- -- ---------------------------- -- Table structure for `wms_news_category` -- ---------------------------- DROP TABLE IF EXISTS `wms_news_category`; CREATE TABLE `wms_news_category` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '分类名称', `parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级ID', `order` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序', `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1=正常 2=删除', `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='资讯类别'; -- ---------------------------- -- Records of wms_news_category -- ---------------------------- -- ---------------------------- -- Table structure for `wms_node` -- ---------------------------- DROP TABLE IF EXISTS `wms_node`; CREATE TABLE `wms_node` ( `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT COMMENT '主id', `name` varchar(20) NOT NULL COMMENT '名字', `title` varchar(50) DEFAULT NULL COMMENT '标题', `status` tinyint(1) DEFAULT '0' COMMENT '状态', `remark` varchar(255) DEFAULT NULL COMMENT '备注', `sort` smallint(6) unsigned DEFAULT NULL COMMENT '排序', `pid` smallint(6) unsigned NOT NULL COMMENT '父id', `level` tinyint(1) unsigned NOT NULL COMMENT '级别', PRIMARY KEY (`id`), KEY `idx_level` (`level`), KEY `idx_pid` (`pid`), KEY `idx_status` (`status`), KEY `idx_name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8 COMMENT='权限节点'; -- ---------------------------- -- Records of wms_node -- ---------------------------- INSERT INTO `wms_node` VALUES ('1', 'Admin', '后台管理', '1', 'WMS后台管理系统', '0', '0', '1'); INSERT INTO `wms_node` VALUES ('2', 'News', '资讯管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('3', 'index', '资讯列表', '1', '', '0', '2', '3'); INSERT INTO `wms_node` VALUES ('4', 'add', '添加', '1', '', '0', '2', '3'); INSERT INTO `wms_node` VALUES ('5', 'edit', '编辑', '1', '', '0', '2', '3'); INSERT INTO `wms_node` VALUES ('6', 'status', '启用/禁用', '1', '', '0', '2', '3'); INSERT INTO `wms_node` VALUES ('7', 'del', '删除', '1', '', '0', '2', '3'); INSERT INTO `wms_node` VALUES ('8', 'category', '资讯分类', '1', '', '0', '2', '3'); INSERT INTO `wms_node` VALUES ('9', 'Link', '链接管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('10', 'index', '链接列表', '1', '', '0', '9', '3'); INSERT INTO `wms_node` VALUES ('11', 'add', '添加', '1', '', '0', '9', '3'); INSERT INTO `wms_node` VALUES ('12', 'edit', '编辑', '1', '', '0', '9', '3'); INSERT INTO `wms_node` VALUES ('13', 'status', '启用/禁用', '1', '', '0', '9', '3'); INSERT INTO `wms_node` VALUES ('14', 'del', '删除', '1', '', '0', '9', '3'); INSERT INTO `wms_node` VALUES ('15', 'details', '详情', '1', '', '0', '9', '3'); INSERT INTO `wms_node` VALUES ('16', 'Ad', '广告管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('17', 'index', '广告列表', '1', '', '0', '16', '3'); INSERT INTO `wms_node` VALUES ('18', 'add', '添加', '1', '', '0', '16', '3'); INSERT INTO `wms_node` VALUES ('19', 'edit', '编辑', '1', '', '0', '16', '3'); INSERT INTO `wms_node` VALUES ('20', 'status', '启用/禁用', '1', '', '0', '16', '3'); INSERT INTO `wms_node` VALUES ('21', 'del', '删除', '1', '', '0', '16', '3'); INSERT INTO `wms_node` VALUES ('22', 'details', '详情', '1', '', '0', '16', '3'); INSERT INTO `wms_node` VALUES ('23', 'User', '用户管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('24', 'index', '用户列表', '1', '', '0', '23', '3'); INSERT INTO `wms_node` VALUES ('26', 'del', '删除', '1', '', '0', '23', '3'); INSERT INTO `wms_node` VALUES ('27', 'details', '详情', '1', '', '0', '23', '3'); INSERT INTO `wms_node` VALUES ('28', 'Admin', '管理员管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('29', 'index', '管理员列表', '1', '', '0', '28', '3'); INSERT INTO `wms_node` VALUES ('30', 'add', '添加', '1', '', '0', '28', '3'); INSERT INTO `wms_node` VALUES ('31', 'edit', '编辑', '1', '', '0', '28', '3'); INSERT INTO `wms_node` VALUES ('32', 'status', '启用/禁用', '1', '', '0', '28', '3'); INSERT INTO `wms_node` VALUES ('33', 'del', '删除', '1', '', '0', '28', '3'); INSERT INTO `wms_node` VALUES ('34', 'details', '详情', '1', '', '0', '28', '3'); INSERT INTO `wms_node` VALUES ('35', 'Config', '配置管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('36', 'index', '列表+编辑', '1', '', '0', '35', '3'); INSERT INTO `wms_node` VALUES ('37', 'add', '添加', '1', '', '0', '35', '3'); INSERT INTO `wms_node` VALUES ('38', 'Access', '权限管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('39', 'index', '节点列表', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('40', 'addNode', '添加节点', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('41', 'editNode', '编辑节点', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('42', 'opSort', '节点排序', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('43', 'opNodeStatus', '启用/禁用(节点)', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('44', 'delNode', '删除节点', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('45', 'roleList', '角色列表', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('46', 'addRole', '添加角色', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('47', 'editRole', '编辑角色', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('48', 'opRoleStatus', '启用/禁用(角色)', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('49', 'changeRole', '分配权限', '1', '', '0', '38', '3'); INSERT INTO `wms_node` VALUES ('50', 'Db', '数据库管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('51', 'index', '数据表列表', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('52', 'restore', '导入列表', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('53', 'zipList', '压缩包列表', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('54', 'repair', '优化与修复', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('55', 'status', '禁用/启用', '1', '', '0', '23', '3'); INSERT INTO `wms_node` VALUES ('56', 'restoreData', '导入', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('57', 'delSqlFiles', '删除SQL文件', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('58', 'sendSql', '发送邮箱', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('59', 'zipSql', '压缩为ZIP', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('60', 'unzipSqlfile', '解压缩为SQL', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('61', 'delZipFiles', '删除ZIP文件', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('62', 'downFile', '下载文件', '1', '', '0', '50', '3'); INSERT INTO `wms_node` VALUES ('63', 'Template', '模板管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('64', 'index', '文件列表', '1', '', '0', '63', '3'); INSERT INTO `wms_node` VALUES ('65', 'downFile', '下载文件', '1', '', '0', '63', '3'); INSERT INTO `wms_node` VALUES ('66', 'edit', '编辑', '1', '', '0', '63', '3'); INSERT INTO `wms_node` VALUES ('67', 'mkdir', '创建文件夹', '1', '', '0', '63', '3'); INSERT INTO `wms_node` VALUES ('68', 'reName', '重命名', '1', '', '0', '63', '3'); INSERT INTO `wms_node` VALUES ('69', 'delFile', '删除文件', '1', '', '0', '63', '3'); INSERT INTO `wms_node` VALUES ('70', 'Oplog', '日志管理', '1', '', '0', '1', '2'); INSERT INTO `wms_node` VALUES ('71', 'index', '日志列表', '1', '', '0', '70', '3'); -- ---------------------------- -- Table structure for `wms_oplog` -- ---------------------------- DROP TABLE IF EXISTS `wms_oplog`; CREATE TABLE `wms_oplog` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主id', `model` varchar(30) NOT NULL DEFAULT '' COMMENT '模块', `action` varchar(30) NOT NULL DEFAULT '' COMMENT '动作', `admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户id', `admin_name` varchar(50) DEFAULT '' COMMENT '用户名', `role_id` int(10) NOT NULL DEFAULT '0' COMMENT '管理角色id', `role_name` varchar(50) NOT NULL DEFAULT '' COMMENT '管理角色', `bak` varchar(256) NOT NULL DEFAULT '' COMMENT '备注', `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='后台操作表'; -- ---------------------------- -- Records of wms_oplog -- ---------------------------- INSERT INTO `wms_oplog` VALUES ('1', 'Public', 'loginout', '1', 'admin', '1', '管理员', '退出', '1406110377'); INSERT INTO `wms_oplog` VALUES ('2', 'Public', 'index', '1', 'admin', '1', '超级管理员', '登录', '1406110389'); -- ---------------------------- -- Table structure for `wms_position` -- ---------------------------- DROP TABLE IF EXISTS `wms_position`; CREATE TABLE `wms_position` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(40) NOT NULL COMMENT '职位名称', `time` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='职位表'; -- ---------------------------- -- Records of wms_position -- ---------------------------- INSERT INTO `wms_position` VALUES ('1', '店长', '1461291852'); INSERT INTO `wms_position` VALUES ('2', '职员', '1461291852'); -- ---------------------------- -- Table structure for `wms_privilege` -- ---------------------------- DROP TABLE IF EXISTS `wms_privilege`; CREATE TABLE `wms_privilege` ( `id` mediumint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(60) NOT NULL COMMENT '权限名称', `parent_id` mediumint(11) unsigned DEFAULT '0' COMMENT '父级id', `controller` varchar(20) DEFAULT NULL, `module` varchar(20) DEFAULT NULL, `action` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), KEY `parent_id` (`parent_id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='权限表'; -- ---------------------------- -- Records of wms_privilege -- ---------------------------- INSERT INTO `wms_privilege` VALUES ('1', '超级管理员', '0', '---', '---', '---'); INSERT INTO `wms_privilege` VALUES ('2', '角色管理', '0', 'Role', 'Role', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('3', '用户管理', '0', 'Account', 'User', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('4', '商品品牌', '0', 'Brand', 'Brand', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('5', '商品分类', '0', 'Category', 'Category', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('6', '商品管理', '0', 'Goods', 'Goods', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('7', '职位管理', '0', 'Position', 'Position', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('8', '权限管理', '0', 'Privilege', 'Privilege', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('9', '门店管理', '0', 'Store', 'Store', 'index,add,edit,delete'); INSERT INTO `wms_privilege` VALUES ('10', '管理员管理', '0', 'Admin', 'Admin', 'index,add,edit,delete'); -- ---------------------------- -- Table structure for `wms_record` -- ---------------------------- DROP TABLE IF EXISTS `wms_record`; CREATE TABLE `wms_record` ( `goods_id` mediumint(9) unsigned NOT NULL, `no` varchar(40) NOT NULL COMMENT '员工编号', `name` varchar(18) NOT NULL COMMENT '员工姓名', `create_time` int(11) NOT NULL, `sn` varchar(50) NOT NULL, `goods_name` varchar(80) NOT NULL, `price` decimal(10,2) unsigned NOT NULL COMMENT '价格', `value` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='销售记录'; -- ---------------------------- -- Records of wms_record -- ---------------------------- INSERT INTO `wms_record` VALUES ('1', '2016', 'bool', '1462774517', '001', '特步01', '20.00', 'L,蓝色 '); INSERT INTO `wms_record` VALUES ('1', '2016', 'bool', '1462775581', '001', '特步01', '20.00', '41,黑色 '); INSERT INTO `wms_record` VALUES ('2', '2016', 'bool', '1462775581', '001', '特步01', '20.00', '42,白色 '); INSERT INTO `wms_record` VALUES ('2', '2016', 'bool', '1462775587', '001', '特步01', '20.00', '42,白色 '); INSERT INTO `wms_record` VALUES ('2', '2016', 'bool', '1462775594', '001', '特步01', '20.00', '42,白色 '); INSERT INTO `wms_record` VALUES ('2', '2016', 'bool', '1462775598', '001', '特步01', '20.00', '42,白色 '); INSERT INTO `wms_record` VALUES ('1', '2016', 'bool', '1462775599', '001', '特步01', '20.00', '42,黑色 '); INSERT INTO `wms_record` VALUES ('5', '2016', 'bool', '1462775637', '001', '特步01', '20.00', '40,白色 '); INSERT INTO `wms_record` VALUES ('3', '2016', 'bool', '1462775637', '001', '特步01', '20.00', '41,白色 '); INSERT INTO `wms_record` VALUES ('2', '2016', 'bool', '1462775637', '001', '特步01', '20.00', '42,白色 '); INSERT INTO `wms_record` VALUES ('4', '2016', 'bool', '1462775657', '001', '特步01', '20.00', '34,白色 '); INSERT INTO `wms_record` VALUES ('4', '2016', 'bool', '1462775657', '001', '特步01', '20.00', '34,黑色 '); INSERT INTO `wms_record` VALUES ('3', '2016', 'bool', '1462775657', '001', '特步01', '20.00', '35,白色 '); INSERT INTO `wms_record` VALUES ('3', '2016', 'bool', '1462775657', '001', '特步01', '20.00', '35,黑色 '); -- ---------------------------- -- Table structure for `wms_role` -- ---------------------------- DROP TABLE IF EXISTS `wms_role`; CREATE TABLE `wms_role` ( `id` mediumint(11) unsigned NOT NULL AUTO_INCREMENT, `role_name` varchar(30) NOT NULL COMMENT '角色名称', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='角色表'; -- ---------------------------- -- Records of wms_role -- ---------------------------- INSERT INTO `wms_role` VALUES ('1', '超级管理员'); INSERT INTO `wms_role` VALUES ('6', '用户管理员'); INSERT INTO `wms_role` VALUES ('7', '角色管理员'); INSERT INTO `wms_role` VALUES ('8', '商品管理员'); INSERT INTO `wms_role` VALUES ('9', '职位管理员'); INSERT INTO `wms_role` VALUES ('10', '权限管理员'); INSERT INTO `wms_role` VALUES ('11', '门店管理员'); -- ---------------------------- -- Table structure for `wms_role_privilege` -- ---------------------------- DROP TABLE IF EXISTS `wms_role_privilege`; CREATE TABLE `wms_role_privilege` ( `privliege_id` mediumint(12) unsigned NOT NULL COMMENT '权限id', `role_id` mediumint(12) unsigned NOT NULL COMMENT '角色id', KEY `role_id` (`role_id`), KEY `privliege_id` (`privliege_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色权限表,角色->权限'; -- ---------------------------- -- Records of wms_role_privilege -- ---------------------------- INSERT INTO `wms_role_privilege` VALUES ('3', '6'); INSERT INTO `wms_role_privilege` VALUES ('2', '7'); INSERT INTO `wms_role_privilege` VALUES ('4', '8'); INSERT INTO `wms_role_privilege` VALUES ('5', '8'); INSERT INTO `wms_role_privilege` VALUES ('6', '8'); INSERT INTO `wms_role_privilege` VALUES ('7', '9'); INSERT INTO `wms_role_privilege` VALUES ('8', '10'); INSERT INTO `wms_role_privilege` VALUES ('9', '11'); INSERT INTO `wms_role_privilege` VALUES ('1', '1'); INSERT INTO `wms_role_privilege` VALUES ('2', '1'); INSERT INTO `wms_role_privilege` VALUES ('3', '1'); INSERT INTO `wms_role_privilege` VALUES ('4', '1'); INSERT INTO `wms_role_privilege` VALUES ('5', '1'); INSERT INTO `wms_role_privilege` VALUES ('6', '1'); INSERT INTO `wms_role_privilege` VALUES ('7', '1'); INSERT INTO `wms_role_privilege` VALUES ('8', '1'); INSERT INTO `wms_role_privilege` VALUES ('9', '1'); -- ---------------------------- -- Table structure for `wms_role_user` -- ---------------------------- DROP TABLE IF EXISTS `wms_role_user`; CREATE TABLE `wms_role_user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主id', `role_id` mediumint(9) unsigned DEFAULT NULL COMMENT '角色id', `user_id` char(32) DEFAULT NULL COMMENT '用户id', PRIMARY KEY (`id`), KEY `idx_role_id` (`role_id`), KEY `idx_user_id` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户角色'; -- ---------------------------- -- Records of wms_role_user -- ---------------------------- INSERT INTO `wms_role_user` VALUES ('1', '1', '1'); -- ---------------------------- -- Table structure for `wms_sale` -- ---------------------------- DROP TABLE IF EXISTS `wms_sale`; CREATE TABLE `wms_sale` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='销售'; -- ---------------------------- -- Records of wms_sale -- ---------------------------- -- ---------------------------- -- Table structure for `wms_stock` -- ---------------------------- DROP TABLE IF EXISTS `wms_stock`; CREATE TABLE `wms_stock` ( `no_id` mediumint(12) unsigned NOT NULL COMMENT '货号id', `sn` varchar(30) NOT NULL COMMENT '产品sn号', `depot_id` mediumint(12) unsigned NOT NULL COMMENT '仓库id', `goods_id` mediumint(12) unsigned NOT NULL COMMENT '商品id', `store_id` mediumint(12) unsigned NOT NULL, `num` mediumint(12) unsigned NOT NULL, KEY `depot_id` (`depot_id`), KEY `goods_id` (`goods_id`), KEY `store_id` (`store_id`), KEY `sn` (`sn`), KEY `no_id` (`no_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='库存'; -- ---------------------------- -- Records of wms_stock -- ---------------------------- -- ---------------------------- -- Table structure for `wms_store` -- ---------------------------- DROP TABLE IF EXISTS `wms_store`; CREATE TABLE `wms_store` ( `id` mediumint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `leader` varchar(30) DEFAULT NULL COMMENT '负责人,领导人', `name` varchar(60) NOT NULL COMMENT '门店名称', `tel` varchar(20) DEFAULT NULL, `address` varchar(100) NOT NULL COMMENT '地址', `desc` varchar(200) DEFAULT NULL, `create_time` varchar(20) NOT NULL COMMENT '创建时间', `status` tinyint(1) unsigned DEFAULT '0', PRIMARY KEY (`id`), KEY `leader` (`leader`), KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='门店表'; -- ---------------------------- -- Records of wms_store -- ---------------------------- INSERT INTO `wms_store` VALUES ('1', '李先生', '东创科技园金枫路分店', '0512-5689107', '江苏省苏州市', '描述', '2016-04-14', '0'); INSERT INTO `wms_store` VALUES ('2', '李先生', '观前街分店', '0512-5689108', '苏州市观前街', '描述内容', '2016-04-14', '0'); INSERT INTO `wms_store` VALUES ('3', '赵先生', '工业园区湖东分店', '0512-5689105', '江苏省苏州市工业园区湖东', '描述', '2016-04-14', '0'); INSERT INTO `wms_store` VALUES ('4', '李先生', '苏州市高新区木渎分店', '0512-5689102', '苏州市高新区木渎分店', '苏州市高新区木渎分店', '2016-04-22', '0'); -- ---------------------------- -- Table structure for `wms_user` -- ---------------------------- DROP TABLE IF EXISTS `wms_user`; CREATE TABLE `wms_user` ( `id` mediumint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `nickname` varchar(16) DEFAULT NULL COMMENT '昵称', `username` varchar(16) NOT NULL COMMENT '用户名', `password` varchar(32) NOT NULL COMMENT '密码', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态,0正常 1禁止 2删除', `create_time` int(11) unsigned NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`), KEY `nickname` (`nickname`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='用户表'; -- ---------------------------- -- Records of wms_user -- ---------------------------- INSERT INTO `wms_user` VALUES ('13', '布尔', 'bool', 'c506ff134babdd6e68ab3e6350e95305', '0', '1460968251'); INSERT INTO `wms_user` VALUES ('14', '毛毛', 'maomao', '4a8a08f09d37b73795649038408b5f33', '0', '1460969225'); INSERT INTO `wms_user` VALUES ('15', '布尔', 'a', '4a8a08f09d37b73795649038408b5f33', '0', '1460970912'); INSERT INTO `wms_user` VALUES ('16', '测试', 'b', '4a8a08f09d37b73795649038408b5f33', '0', '1460970931'); INSERT INTO `wms_user` VALUES ('17', 'ColorRabbit', 'ColorRabbit', '3e21a1642f4596362cf77c25c6d7a9d7', '0', '1461315134'); INSERT INTO `wms_user` VALUES ('18', '毛毛', 'maomao1', '202cb962ac59075b964b07152d234b70', '0', '1461721685'); -- ---------------------------- -- Table structure for `wms_userinfo` -- ---------------------------- DROP TABLE IF EXISTS `wms_userinfo`; CREATE TABLE `wms_userinfo` ( `id` mediumint(11) unsigned NOT NULL, `no` varchar(25) DEFAULT NULL, `qq` int(11) unsigned DEFAULT NULL COMMENT 'qq', `tel` varchar(15) DEFAULT NULL COMMENT '电话', `email` varchar(40) DEFAULT NULL COMMENT '邮箱', `sex` enum('女','男') DEFAULT NULL, `position` int(10) unsigned DEFAULT NULL, `address` varchar(120) DEFAULT NULL, `post` int(7) DEFAULT NULL, `store_id` int(11) unsigned NOT NULL, KEY `store_id` (`store_id`), KEY `position` (`position`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wms_userinfo -- ---------------------------- INSERT INTO `wms_userinfo` VALUES ('13', '2016', '30024167', '18101565682', '<EMAIL>', '男', '2', '江苏省苏州市工业园区', '267000', '1'); INSERT INTO `wms_userinfo` VALUES ('14', '44444444', '123456', '1414141414', '<EMAIL>', '男', '2', '河南省商丘市', '267000', '2'); INSERT INTO `wms_userinfo` VALUES ('15', '123', '1222', '123', '1', '男', '1', '1', '233', '3'); INSERT INTO `wms_userinfo` VALUES ('16', 'b', '1233', '123456', '<EMAIL>', '男', '2', '江苏省苏州市', '123', '1'); INSERT INTO `wms_userinfo` VALUES ('17', 'CR20160422', '0', '', '', '男', '1', '', '0', '2'); INSERT INTO `wms_userinfo` VALUES ('18', 'mao123', '0', '', '', '男', '2', '', '0', '2');
--change_owner method auto increment table owner auto increment serial object owner create class xxx ( a integer auto_increment, b integer ); select * from db_class where class_name='xxx'; select name, owner.name from db_serial where name='xxx_ai_a'; call change_owner('xxx','public') on class db_root; select * from db_class where class_name='xxx'; select name, owner.name from db_serial where name='xxx_ai_a'; drop class public.xxx;
SELECT city FROM weather WHERE temp_lo = (SELECT max(temp_lo) FROM weather);
DROP INDEX IF EXISTS index_payments_order_id; DROP INDEX IF EXISTS index_payments_created_by; DROP TABLE IF EXISTS payments;
<gh_stars>0 select gn.id,gn.id -110, count(*) from genes gn join HGT_PAR_FRAGMS hpf on hpf.GENE_ID = gn.id group by gn.id order by count(*) desc
-- Initialize the database. -- Drop any existing data and create empty tables. DROP TABLE IF EXISTS `group`; DROP TABLE IF EXISTS `photo`; DROP TABLE IF EXISTS `user`; DROP TABLE IF EXISTS `cache`; CREATE TABLE `group` (id BIGINT PRIMARY KEY AUTO_INCREMENT,oss_dir TEXT NOT NULL comment 'oss 中的文件路径',created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间'); CREATE TABLE `photo` ( id INTEGER PRIMARY KEY AUTO_INCREMENT, name CHARACTER(200) NOT NULL comment '图片名称', oss_path TEXT NOT NULL COMMENT 'oss文件系统的路径', group_id CHARACTER(100) NOT NULL comment '组id', feature MEDIUMTEXT NOT NULL comment '特征值', created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间' ); CREATE TABLE `face` ( id INTEGER PRIMARY KEY AUTO_INCREMENT, user_id CHARACTER(200) NOT NULL comment '用户id', group_id CHARACTER(100) NOT NULL comment '关注的组id', photo_id INTEGER NOT NULL comment '头像图片id', created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间' ); CREATE TABLE `cache` ( id INTEGER PRIMARY KEY AUTO_INCREMENT, user_id CHARACTER(200) NOT NULL comment '用户id', group_id CHARACTER(100) NOT NULL comment '关注的组id', similar_photo_id INTEGER NOT NULL comment '相似图片的id', notified BOOLEAN NOT NULL comment '是否已推送通知', created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间' );
<reponame>UMassMedIT/ProfilesRNS SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [RDF.].[GetDataRDF.DebugLog]( [LogID] [int] IDENTITY(1,1) NOT NULL, [subject] [bigint] NULL, [predicate] [bigint] NULL, [object] [bigint] NULL, [offset] [bigint] NULL, [limit] [bigint] NULL, [showDetails] [bit] NULL, [expand] [bit] NULL, [SessionID] [uniqueidentifier] NULL, [StartDate] [datetime] NULL, [DurationMS] [int] NULL, PRIMARY KEY CLUSTERED ( [LogID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO
<gh_stars>100-1000 -- Initial database schema and CREATE TABLE authors ( id int NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL, biography mediumtext, PRIMARY KEY (id) ) ENGINE=InnoDB; CREATE TABLE books ( id int(11) NOT NULL AUTO_INCREMENT, author_id int NOT NULL, title varchar(100) NOT NULL, isbn varchar(13), PRIMARY KEY (id), FOREIGN KEY (author_id) REFERENCES authors (id) ) ENGINE=InnoDB; INSERT INTO authors (name, biography) VALUES ('<NAME>', '<NAME> is an American television writer and novelist, best known as the author of The Underland Chronicles and The Hunger Games trilogy'); SET @id = LAST_INSERT_ID(); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Gregor the Overlander', '9780439678131'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Gregor and the Prophecy of Bane', '9780439650762'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Gregor and the Curse of the Warmbloods', '9780439656245'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Gregor and the Marks of Secret', '9780439791465'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Gregor and the Code of Claw', '9780439791441'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Hunger Games', '9780439023528'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Catching Fire', '9780545227247'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Mockingjay', '9780439023511'); INSERT INTO authors (name) VALUES ('<NAME>'); SET @id = LAST_INSERT_ID(); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Dragonflight', '9780345335463'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Dragonquest', '9780345022455'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The White Dragon', '9780345275677'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Dragonsong', '9780689305078'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Dragonsinger', '9780689305702'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Dragondrums', '9780689306853'); INSERT INTO authors (name) VALUES ('<NAME>'); SET @id = LAST_INSERT_ID(); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Mindstar Rising', '9780330537742'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'A Quantum Murder', '9780330537759'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Nano Flower', '9780330537810'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Reality Dysfunction', '9781447208570'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Neutronium Alchemist', '9781447208587'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Naked God', '9781447208594'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Misspent Youth', '9781447224082'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Pandora''s Star', '9781447279662'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Judas Unchained', '9781447279679'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Dreaming Void', '9781447208563'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Temporal Void', '9780330507882'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Evolutionary Void', '9780330443173'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Abyss Beyond Dreams', '9780230769465'); INSERT INTO authors (name) VALUES ('<NAME>'); SET @id = LAST_INSERT_ID(); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME> and the Philosopher''s Stone', '0747532699'); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME> and the Chamber of Secrets', '0747538492'); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME> and the Prisoner of Azkaban', '0747542155'); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME>ter and the Goblet of Fire', '074754624X'); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME> and the Order of the Phoenix', '0747551006'); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME> and the Half-Blood Prince', '0747581088'); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME> and the Deathly Hallows', '0545010225'); INSERT INTO authors (name) VALUES ('<NAME>'); SET @id = LAST_INSERT_ID(); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'A Wizard of Earthsea', '0395276535'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Tombs of Atuan', '187470323X'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Farthest Shore', '0689300549'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Tehanu', '0689315953'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Tales from Earthsea', '0151005613'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Other Wind', '0151006849'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Dispossessed', '0060125632'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Word for World Is Forest', '0399117164'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Rocannon''s World', '0824014243'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Planet of Exile', '0575025956'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'City of Illusions', '0575007583'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Left Hand of Darkness', '0441478123'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Telling', '0151005672'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Lathe of Heaven', '0684125293'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Wind''s Twelve Quarters', '0060125624'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Orsinian Tales', '0060125616'); INSERT INTO authors (name) VALUES ('<NAME>'); SET @id = LAST_INSERT_ID(); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Colour of Magic', '086140324X'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Light Fantastic', '0861402030'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Equal Rites', '0575039507'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Mort', '0575041714'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Sourcery', '0575042176'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Wyrd Sisters', '0575043636'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Pyramids', '0575044632'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Guards! Guards!', '0575046066'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Eric', '0575051914'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Moving Pictures', '0575047631'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Reaper Man', '0575049790'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Witches Abroad', '0575049804'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Small Gods', '0060177500'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Lords and Ladies', '0575052236'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Men At Arms', '0575055030'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Soul Music', '0575055049'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Interesting Times', '0575058005'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Maskerade', '0575058080'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Feet of Clay', '0575059001'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Hogfather', '057506403X'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Jingo', '0575065400'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Last Continent', '0385409893'); INSERT INTO books (author_id, title, isbn) VALUES (@id, '<NAME>', '0385409923'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Fifth Elephant', '0385409958'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Truth', '0385601026'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Thief of Time', '0060199563'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Last Hero', '057506885X'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Amazing Murice and his Educated Rodents', '0385601239'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Night Watch', '0385602642'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Wee Free Men', '0385605331'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Monstrous Regiment', '0385603401'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'A Hat Full of Sky', '0385607369'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Going Postal', '0385603428'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Thud!', '0385608675'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Wintersmith', '0385609841'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Making Money', '0385611013'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Unseen Academicals', '0385609345'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'I Shall Wear Midnight', '0385611072'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Snuff', '9780385619264'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'Raising Steam', '9780857522276'); INSERT INTO books (author_id, title, isbn) VALUES (@id, 'The Shepherd''s Crown', '9780857534811');
<reponame>uwescience/raco select r.a, s.a, t.a from R2 r, R2 s, R2 t where r.b=s.a and s.b=t.a;
<gh_stars>1000+ -- +migrate Up SELECT create_index('workflow_run_tag', 'IDX_WORKFLOW_RUN_TAG_VALUE', 'tag,value'); -- +migrate Down DROP INDEX idx_workflow_run_tag_value;
-- sql from sakai select year(OrderDate) as ThisYear ,[Order_ShipCountry] as Region ,[ProductName] as Product ,[Order_Amount] as Sales into MyCube from ABC_Retail where [Order_ShipCountry] in ('USA','Canada','UK') and [ProductName] in ('Chai','Tofu','Chocolade'); -- create table CREATE TABLE abc_retail.MyCube( ThisYear year default null, Region varchar(255), Product varchar(255), Sales numeric(20,2) ); -- Create MyCube table from the denormalized table INSERT INTO abc_retail.MyCube ( ThisYear, Region, Product, Sales ) SELECT year(OrderDate) as ThisYear ,Order_ShipCountry as Region ,ProductName as Product ,Order_Amount as Sales FROM abc_retail.ABC_Retail WHERE Order_ShipCountry in ('USA','Canada','UK') and ProductName in ('Chai','Tofu','Chocolade');
<reponame>razzium/milo # ************************************************************ # Sequel Pro SQL dump # Version 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Hôte: 127.0.0.1 (MySQL 5.5.5-10.3.14-MariaDB-1:10.3.14+maria~bionic) # Base de données: db_milo # Temps de génération: 2019-09-18 16:24:53 +0000 # ************************************************************ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; # Affichage de la table ci_sessions # ------------------------------------------------------------ DROP TABLE IF EXISTS `ci_sessions`; CREATE TABLE `ci_sessions` ( `id` varchar(128) NOT NULL, `ip_address` varchar(45) NOT NULL, `timestamp` int(10) unsigned NOT NULL DEFAULT 0, `data` blob NOT NULL, PRIMARY KEY (`id`), KEY `ci_sessions_timestamp` (`timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Affichage de la table environments # ------------------------------------------------------------ DROP TABLE IF EXISTS `environments`; CREATE TABLE `environments` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) unsigned NOT NULL, `name` text NOT NULL, `folder` text NOT NULL, `webserver` enum('apache','nginx') DEFAULT NULL, `php_version_id` int(11) unsigned DEFAULT NULL, `php_port` bigint(20) DEFAULT NULL, `php_ssl_port` bigint(20) DEFAULT NULL, `php_dockerfile` longtext DEFAULT NULL, `mysql_version_id` int(11) unsigned DEFAULT NULL, `mysql_port` bigint(20) DEFAULT NULL, `mysql_dockerfile` longtext DEFAULT NULL, `mysql_user` text NOT NULL, `mysql_password` text NOT NULL, `has_pma` tinyint(2) unsigned DEFAULT NULL, `pma_port` bigint(20) DEFAULT NULL, `has_sftp` tinyint(2) unsigned DEFAULT NULL, `sftp_user` text NOT NULL, `sftp_password` text NOT NULL, `sftp_port` bigint(20) DEFAULT NULL, `docker_compose` longtext DEFAULT NULL, `xDebug_remote_host` text DEFAULT NULL, `created_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `php_version_id` (`php_version_id`), KEY `mysql_version_id` (`mysql_version_id`), CONSTRAINT `environments_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `ion_auth_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `environments_ibfk_2` FOREIGN KEY (`php_version_id`) REFERENCES `php_versions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `environments_ibfk_3` FOREIGN KEY (`mysql_version_id`) REFERENCES `mysql_versions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `environments` WRITE; /*!40000 ALTER TABLE `environments` DISABLE KEYS */; INSERT INTO `environments` (`id`, `user_id`, `name`, `folder`, `webserver`, `php_version_id`, `php_port`, `php_ssl_port`, `php_dockerfile`, `mysql_version_id`, `mysql_port`, `mysql_dockerfile`, `mysql_user`, `mysql_password`, `has_pma`, `pma_port`, `has_sftp`, `sftp_user`, `sftp_password`, `sftp_port`, `docker_compose`, `created_date`) VALUES (53,1,'Sample project','5d825a304fcf7','apache',1,11018,16149,'FROM php:7.1-apache\n\n#RUN a2enmod rewrite\n\n# Install libs\nRUN apt-get update && apt-get install -y libzip-dev libxml2 libxml2-dev git zlib1g-dev\nRUN docker-php-ext-install mysqli pdo pdo_mysql soap mbstring zip\nRUN apt-get update \\\n&& apt-get install -y zlib1g-dev libicu-dev libfreetype6-dev libjpeg62-turbo-dev g++ \\\n&& docker-php-ext-configure intl \\\n&& docker-php-ext-install intl \\\n&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \\\n&& docker-php-ext-install gd\n\n# Install composer\nRUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composerzip\n\nRUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj \"/C=AT/ST=Vienna/L=Vienna/O=Security/OU=Development/CN=example.com\"\n\nRUN a2enmod rewrite\nRUN a2ensite default-ssl\nRUN a2enmod ssl\n\nEXPOSE 80\nEXPOSE 443',2,13781,NULL,'root','QkT84aQ2LUzyIfCJ',1,15477,1,'sample_project','XFmjenRzPpwFnFlP',13120,'version: \'2\'\n\nservices:\n sftp-5d825a304fcf7:\n image: atmoz/sftp\n restart: always\n volumes:\n - ./src:/home/sample_project/www/sample_project/src\n - ./logs:/home/sample_project/www/sample_project/logs\n ports:\n - \"13120:22\"\n command: sample_project:XFmjenRzPpwFnFlP:::www\n mysql-5d825a304fcf7:\n restart: always\n image: mysql:5.7\n ports:\n - 13781:3306\n volumes:\n - mysql_dir-5d825a304fcf7:/var/lib/mysql\n environment:\n MYSQL_ROOT_PASSWORD: <PASSWORD>CJ\n\n php-5d825a304fcf7:\n restart: always\n build: docker/image/php\n depends_on:\n - mysql-5d825a304fcf7\n ports:\n - 11018:80\n - 16149:443\n links:\n - mysql-5d825a304fcf7:db-server\n volumes:\n - \"./src:/var/www/html\"\n - \"./logs/apache:/var/log/apache2\"\n\n phpmyadmin-5d825a304fcf7:\n restart: always\n image: phpmyadmin/phpmyadmin\n ports:\n - 15477:80\n depends_on:\n - mysql-5d825a304fcf7\n environment:\n PMA_HOST: mysql\n PMA_PORT: 3306\n links:\n - mysql-5d825a304fcf7:mysql\n\nvolumes:\n mysql_dir-5d825a304fcf7:\n driver: local\n','2019-09-18 16:24:17'); /*!40000 ALTER TABLE `environments` ENABLE KEYS */; UNLOCK TABLES; # Affichage de la table ion_auth_groups # ------------------------------------------------------------ DROP TABLE IF EXISTS `ion_auth_groups`; CREATE TABLE `ion_auth_groups` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL, `description` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `ion_auth_groups` WRITE; /*!40000 ALTER TABLE `ion_auth_groups` DISABLE KEYS */; INSERT INTO `ion_auth_groups` (`id`, `name`, `description`) VALUES (1,'Admin','Administrators'), (2,'Devs','Developers'); /*!40000 ALTER TABLE `ion_auth_groups` ENABLE KEYS */; UNLOCK TABLES; # Affichage de la table ion_auth_login_attempts # ------------------------------------------------------------ DROP TABLE IF EXISTS `ion_auth_login_attempts`; CREATE TABLE `ion_auth_login_attempts` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `ip_address` varchar(45) NOT NULL, `login` varchar(100) NOT NULL, `time` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Affichage de la table ion_auth_users # ------------------------------------------------------------ DROP TABLE IF EXISTS `ion_auth_users`; CREATE TABLE `ion_auth_users` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `ip_address` varchar(45) NOT NULL, `username` varchar(100) DEFAULT NULL, `password` varchar(255) NOT NULL, `email` varchar(254) NOT NULL, `activation_selector` varchar(255) DEFAULT NULL, `activation_code` varchar(255) DEFAULT NULL, `forgotten_password_selector` varchar(255) DEFAULT NULL, `forgotten_password_code` varchar(255) DEFAULT NULL, `forgotten_password_time` int(11) unsigned DEFAULT NULL, `remember_selector` varchar(255) DEFAULT NULL, `remember_code` varchar(255) DEFAULT NULL, `created_on` int(11) unsigned NOT NULL, `last_login` int(11) unsigned DEFAULT NULL, `active` tinyint(1) unsigned DEFAULT NULL, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(50) DEFAULT NULL, `company` varchar(100) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uc_email` (`email`), UNIQUE KEY `uc_activation_selector` (`activation_selector`), UNIQUE KEY `uc_forgotten_password_selector` (`forgotten_password_selector`), UNIQUE KEY `uc_remember_selector` (`remember_selector`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `ion_auth_users` WRITE; /*!40000 ALTER TABLE `ion_auth_users` DISABLE KEYS */; INSERT INTO `ion_auth_users` (`id`, `ip_address`, `username`, `password`, `email`, `activation_selector`, `activation_code`, `forgotten_password_selector`, `forgotten_password_code`, `forgotten_password_time`, `remember_selector`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES (1,'127.0.0.1','administrator','$<PASSWORD>','<EMAIL>',NULL,'',NULL,NULL,NULL,'73182769550457b9fc9395d9fc7d80c013f8f3fc','$2y$10$K1f69MNqI9yGXTyz0/O4ruzQR3K1x7teRwFpGEm/jXBtpQEx/rjM.',1268889823,1557224142,1,'Test','Test','Test','0'), (3,'127.0.0.1','administrator','$2y$10$YomuP2G0lmUNcL8PZg8xreurDy41LJpwFqHn5JHkroQzIGs8ARbsi','<EMAIL>',NULL,'',NULL,NULL,NULL,'a25928c17c1ecdd12914fb9ca3e5185cb8d8c43f','$2y$10$nWzuN5BIvx8DHq0vAXeplObmspSVxBL/CC29nXHQQKkMWFqUaomou',1268889823,1555662590,1,'Test','Test','Test','0'); /*!40000 ALTER TABLE `ion_auth_users` ENABLE KEYS */; UNLOCK TABLES; # Affichage de la table ion_auth_users_groups # ------------------------------------------------------------ DROP TABLE IF EXISTS `ion_auth_users_groups`; CREATE TABLE `ion_auth_users_groups` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) unsigned NOT NULL, `group_id` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`), KEY `fk_users_groups_users1_idx` (`user_id`), KEY `fk_users_groups_groups1_idx` (`group_id`), CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `ion_auth_groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `ion_auth_users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `ion_auth_users_groups` WRITE; /*!40000 ALTER TABLE `ion_auth_users_groups` DISABLE KEYS */; INSERT INTO `ion_auth_users_groups` (`id`, `user_id`, `group_id`) VALUES (3,1,1), (4,3,2); /*!40000 ALTER TABLE `ion_auth_users_groups` ENABLE KEYS */; UNLOCK TABLES; # Affichage de la table mysql_versions # ------------------------------------------------------------ DROP TABLE IF EXISTS `mysql_versions`; CREATE TABLE `mysql_versions` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `version` text NOT NULL, `tag` text NOT NULL, `is_active` tinyint(2) DEFAULT 1, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `mysql_versions` WRITE; /*!40000 ALTER TABLE `mysql_versions` DISABLE KEYS */; INSERT INTO `mysql_versions` (`id`, `version`, `tag`, `is_active`) VALUES (1,'MySQL 5.5.58','mysql:5.5.58',1), (2,'MySQL 5.7','mysql:5.7',1), (3,'MariaDB 5.7','mariadb:5.5',1), (4,'MariaDB 10.4','mariadb:10.4',1), (5,'MySQL 8','mysql:8',0); /*!40000 ALTER TABLE `mysql_versions` ENABLE KEYS */; UNLOCK TABLES; # Affichage de la table php_versions # ------------------------------------------------------------ DROP TABLE IF EXISTS `php_versions`; CREATE TABLE `php_versions` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `version` text NOT NULL, `tag` text NOT NULL, `env` enum('apache','nginx','both') DEFAULT NULL, `is_active` tinyint(4) DEFAULT 1, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; LOCK TABLES `php_versions` WRITE; /*!40000 ALTER TABLE `php_versions` DISABLE KEYS */; INSERT INTO `php_versions` (`id`, `version`, `tag`, `env`, `is_active`) VALUES (1,'7.1','php:7.1-apache','apache',1), (2,'5.6','php:5.6-apache','apache',1); /*!40000 ALTER TABLE `php_versions` ENABLE KEYS */; UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<filename>store-master.sql -- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 01, 2017 at 03:58 PM -- Server version: 10.1.21-MariaDB -- PHP Version: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `store` -- -- -------------------------------------------------------- -- -- Table structure for table `brands` -- CREATE TABLE `brands` ( `id` int(10) UNSIGNED NOT NULL, `brand_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `brands` -- INSERT INTO `brands` (`id`, `brand_name`, `created_at`, `updated_at`) VALUES (1, 'Apple', '2016-04-26 20:26:53', '2016-04-26 20:26:53'), (2, 'ASUS', '2016-04-26 20:27:39', '2016-04-26 20:27:39'), (3, 'Beats by Dr. Dre', '2016-04-26 20:27:56', '2016-04-26 20:27:56'), (4, 'Bose', '2016-04-26 20:28:10', '2016-04-26 20:28:10'), (5, 'Blackberry', '2016-04-26 20:28:22', '2016-04-26 20:28:22'), (6, 'Canon', '2016-04-26 20:28:38', '2016-04-26 20:28:38'), (7, 'DELL', '2016-04-26 20:28:53', '2016-04-26 20:28:53'), (8, 'GoPro', '2016-04-26 20:29:09', '2016-04-26 20:29:09'), (9, 'HP', '2016-04-26 20:29:20', '2016-04-26 20:29:20'), (10, 'Lenovo', '2016-04-26 20:29:44', '2016-04-26 20:29:44'), (11, 'LG', '2016-04-26 20:29:52', '2016-04-26 20:29:52'), (12, 'Logitech', '2016-04-26 20:30:18', '2016-04-26 20:30:18'), (13, 'Microsoft', '2016-04-26 20:30:28', '2016-04-26 20:30:28'), (14, 'Nikon Cameras', '2016-04-26 20:31:01', '2016-04-26 20:31:01'), (15, 'Panasonic', '2016-04-26 20:31:24', '2016-04-26 20:31:24'), (16, 'Samsung', '2016-04-26 20:31:44', '2016-04-26 20:31:44'), (17, 'Sony', '2016-04-26 20:32:01', '2016-04-26 20:32:01'), (18, 'Toshiba', '2016-04-26 20:32:15', '2016-04-26 20:32:15'), (19, 'Turtle Beach', '2016-04-26 20:32:26', '2016-04-26 20:32:26'), (20, 'CyberPowerPC', '2016-04-26 23:01:31', '2016-04-26 23:01:31'), (21, 'Astro', '2016-04-27 04:18:37', '2016-04-27 04:18:37'), (22, 'EA', '2016-04-27 21:13:07', '2016-04-27 21:13:07'), (23, 'Other', '2016-04-27 21:15:27', '2016-04-27 21:15:27'); -- -------------------------------------------------------- -- -- Table structure for table `carts` -- CREATE TABLE `carts` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `qty` int(10) UNSIGNED NOT NULL, `total` decimal(10,2) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `carts` -- INSERT INTO `carts` (`id`, `user_id`, `product_id`, `qty`, `total`, `created_at`, `updated_at`) VALUES (16, 13, 63, 4, '1799.96', '2017-05-30 13:46:40', '2017-05-30 13:46:44'); -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(10) UNSIGNED NOT NULL, `category` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `parent_id` int(11) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `category`, `parent_id`, `created_at`, `updated_at`) VALUES (1, 'TV', NULL, '2016-04-26 20:24:49', '2016-04-26 20:24:49'), (2, 'Computers & Tablets', NULL, '2016-04-26 20:25:26', '2016-04-26 20:35:58'), (3, 'Cell Phones', NULL, '2016-04-26 20:25:38', '2016-04-26 20:25:38'), (4, 'Cameras', NULL, '2016-04-26 20:25:47', '2016-04-26 20:25:47'), (5, 'Audio', NULL, '2016-04-26 20:26:09', '2016-04-26 20:26:09'), (6, 'Video Games', NULL, '2016-04-26 20:26:21', '2016-04-26 20:26:21'), (7, '4K Ultra HD TVs', 1, '2016-04-26 20:33:50', '2016-04-26 20:33:50'), (8, 'Smart TVs', 1, '2016-04-26 20:34:02', '2016-04-26 20:34:02'), (9, 'Curved TVs', 1, '2016-04-26 20:34:15', '2016-04-26 20:34:15'), (10, 'LED TVs', 1, '2016-04-26 20:34:26', '2016-04-26 20:34:26'), (11, 'OLED TVs', 1, '2016-04-26 20:34:40', '2016-04-26 20:34:40'), (12, 'Desktops', 2, '2016-04-26 20:35:03', '2016-04-26 20:35:03'), (13, 'Laptops', 2, '2016-04-26 20:35:10', '2016-04-26 20:35:10'), (14, 'Monitors', 2, '2016-04-26 20:35:34', '2016-04-26 20:35:34'), (15, 'iPads', 2, '2016-04-26 20:36:05', '2016-04-26 20:36:05'), (16, 'Tablets', 2, '2016-04-26 20:36:20', '2016-04-26 20:36:20'), (17, 'iPhones', 3, '2016-04-26 20:36:34', '2016-04-26 20:36:34'), (18, 'Samsung Galaxy', 3, '2016-04-26 20:37:00', '2016-04-26 20:37:00'), (19, 'Blackberries ', 3, '2016-04-26 20:37:11', '2016-04-26 20:37:11'), (20, 'Digital SLR Cameras', 4, '2016-04-26 20:37:39', '2016-04-26 20:37:39'), (21, 'Mirrorless Cameras', 4, '2016-04-26 20:38:03', '2016-04-26 20:38:03'), (22, 'Point & Shoot Cameras', 4, '2016-04-26 20:38:38', '2016-04-26 20:38:38'), (23, 'GoPros', 4, '2016-04-26 20:39:27', '2016-04-26 20:39:27'), (25, 'Xbox One Headsets', 5, '2016-04-26 20:40:01', '2016-04-26 20:40:01'), (26, 'PlayStation 4 Headsets', 5, '2016-04-26 20:40:11', '2016-04-26 20:40:11'), (27, 'HeadPhones', 5, '2016-04-26 20:40:29', '2016-04-26 20:40:29'), (28, 'Xbox One', 6, '2016-04-26 20:41:01', '2016-04-26 20:41:01'), (29, 'Xbox One Games', 6, '2016-04-26 20:41:13', '2016-04-26 20:41:13'), (30, 'Xbox One Accessories', 6, '2016-04-26 20:41:26', '2016-04-26 20:41:26'), (31, 'PlayStation 4', 6, '2016-04-26 20:41:37', '2016-04-26 20:41:37'), (32, 'PlayStation 4 Accessories', 6, '2016-04-26 20:41:51', '2016-04-26 20:41:51'), (33, 'PlayStation 4 Games', 6, '2016-04-26 20:42:00', '2016-04-26 20:42:00'), (34, 'PC Games', 6, '2016-04-26 20:42:12', '2016-04-26 20:42:12'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`migration`, `batch`) VALUES ('2014_10_12_000000_create_users_table', 1), ('2014_10_12_100000_create_password_resets_table', 1), ('2016_04_01_225427_create_categories_table', 1), ('2016_04_04_235728_create_products_table', 1), ('2016_04_08_172826_create_brands_table', 1), ('2016_04_09_201921_create_product_images_table', 1), ('2016_04_17_181302_create_carts_table', 1), ('2016_04_18_183841_create_orders_table', 1), ('2016_04_18_232109_create_order_product_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(11) NOT NULL, `first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `city` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `state` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `zip` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `total` decimal(10,2) NOT NULL, `full_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`id`, `user_id`, `first_name`, `last_name`, `address`, `phone`, `city`, `state`, `zip`, `total`, `full_name`, `created_at`, `updated_at`) VALUES (1, 1, 'Jane ', 'Smith', '415 Jackson Avenue', '', 'Astoria', 'NY', '11102', '3399.98', '<NAME>', '2016-04-27 21:36:28', '2016-04-27 21:36:28'), (2, 2, 'Dave', 'Colin', '712 Pheasant Run', '', 'Vicksburg', 'MS', '39180', '499.99', '<NAME>', '2016-04-27 21:39:48', '2016-04-27 21:39:48'), (3, 2, 'Jenny', 'Larun', '129 Cedar Court ', '', '<NAME>', 'NY', '11372', '699.99', '<NAME>', '2016-04-27 21:40:49', '2016-04-27 21:40:49'), (4, 2, 'Myers', 'Setph', '636 Monroe Drive', '', 'La Vergne', 'TN', '37086', '124.98', '<NAME>', '2016-04-27 21:42:11', '2016-04-27 21:42:11'), (5, 2, 'John', 'Zehn', '305 Route 202 ', '', 'Findlay', 'OH', '45840', '1999.99', '<NAME>', '2016-04-27 21:43:15', '2016-04-27 21:43:15'), (6, 2, 'Joile', 'Hanna', '977 Homestead Drive ', '', 'West Des Moines', 'IA', '50265', '219.99', '<NAME>', '2016-04-27 21:44:25', '2016-04-27 21:44:25'), (7, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '11999.96', '', '2017-05-24 08:16:15', '2017-05-24 08:16:15'), (8, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Gombe', '', '6099.94', '', '2017-05-24 08:20:37', '2017-05-24 08:20:37'), (9, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Imo', '', '1299.99', '', '2017-05-24 08:24:29', '2017-05-24 08:24:29'), (10, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Kano', '', '6499.95', '', '2017-05-24 08:35:04', '2017-05-24 08:35:04'), (11, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Ekiti', '', '6499.95', '', '2017-05-24 08:46:16', '2017-05-24 08:46:16'), (12, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Ebonyi', '', '6499.95', '', '2017-05-24 08:47:35', '2017-05-24 08:47:35'), (13, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '6499.95', '', '2017-05-24 08:49:27', '2017-05-24 08:49:27'), (14, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Gombe', '', '6499.95', '', '2017-05-24 08:55:03', '2017-05-24 08:55:03'), (15, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Imo', '', '6499.95', '', '2017-05-24 09:03:51', '2017-05-24 09:03:51'), (16, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Delta', '', '6499.95', '', '2017-05-24 09:04:49', '2017-05-24 09:04:49'), (17, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Edo', '', '6499.95', '', '2017-05-24 09:07:46', '2017-05-24 09:07:46'), (18, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Edo', '', '7849.93', '', '2017-05-24 19:48:10', '2017-05-24 19:48:10'), (19, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Ebonyi', '', '7849.93', '', '2017-05-24 19:51:28', '2017-05-24 19:51:28'), (20, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Gombe', '', '7849.93', '', '2017-05-24 19:53:38', '2017-05-24 19:53:38'), (21, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Enugu', '', '7849.93', '', '2017-05-24 19:54:34', '2017-05-24 19:54:34'), (22, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Ebonyi', '', '7849.93', '', '2017-05-24 19:55:39', '2017-05-24 19:55:39'), (23, 1, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Ebonyi', '', '10849.92', '', '2017-05-29 04:37:20', '2017-05-29 04:37:20'), (24, 13, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '1799.96', '', '2017-05-30 13:37:52', '2017-05-30 13:37:52'), (25, 13, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '2249.95', '', '2017-05-30 13:38:50', '2017-05-30 13:38:50'), (26, 13, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '2249.95', '', '2017-05-30 13:42:16', '2017-05-30 13:42:16'), (27, 13, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '1799.96', '', '2017-05-30 13:47:02', '2017-05-30 13:47:02'), (28, 2, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '1009.98', '', '2017-05-31 06:01:13', '2017-05-31 06:01:13'), (29, 2, 'Adedeji', 'Kadri', '10, Ogunfunmi street', '', 'Surulere', 'Lagos', '', '1009.98', '', '2017-05-31 06:01:59', '2017-05-31 06:01:59'), (30, 2, '<NAME>', 'Kadri', '10, Ogunfunmi street, Off Akobi Crescent', '', 'Surulere', 'Lagos', '', '1799.96', '', '2017-05-31 06:16:12', '2017-05-31 06:16:12'); -- -------------------------------------------------------- -- -- Table structure for table `order_product` -- CREATE TABLE `order_product` ( `id` int(10) UNSIGNED NOT NULL, `order_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `qty` int(11) NOT NULL, `price` decimal(10,2) NOT NULL, `reduced_price` decimal(10,2) NOT NULL, `total` decimal(10,2) NOT NULL, `total_reduced` decimal(10,2) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `order_product` -- INSERT INTO `order_product` (`id`, `order_id`, `product_id`, `qty`, `price`, `reduced_price`, `total`, `total_reduced`, `created_at`, `updated_at`) VALUES (1, 1, 5, 1, '2999.99', '0.00', '2999.99', '0.00', NULL, NULL), (2, 1, 16, 1, '399.99', '0.00', '399.99', '0.00', NULL, NULL), (3, 2, 29, 1, '499.99', '0.00', '499.99', '0.00', NULL, NULL), (4, 3, 21, 1, '699.99', '0.00', '699.99', '0.00', NULL, NULL), (5, 4, 33, 1, '24.99', '0.00', '24.99', '0.00', NULL, NULL), (6, 4, 48, 1, '99.99', '0.00', '99.99', '0.00', NULL, NULL), (7, 5, 11, 1, '1999.99', '0.00', '1999.99', '0.00', NULL, NULL), (8, 6, 14, 1, '219.99', '0.00', '219.99', '0.00', NULL, NULL), (9, 7, 3, 4, '1999.99', '2999.99', '7999.96', '11999.96', NULL, NULL), (10, 8, 63, 4, '449.99', '0.00', '1799.96', '0.00', NULL, NULL), (11, 8, 3, 1, '1999.99', '2999.99', '1999.99', '2999.99', NULL, NULL), (12, 8, 2, 1, '899.99', '1299.99', '899.99', '1299.99', NULL, NULL), (13, 9, 2, 1, '899.99', '1299.99', '899.99', '1299.99', NULL, NULL), (14, 10, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (15, 11, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (16, 12, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (17, 13, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (18, 14, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (19, 15, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (20, 16, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (21, 17, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (22, 18, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (23, 19, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (24, 20, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (25, 21, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (26, 22, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (27, 23, 2, 5, '899.99', '1299.99', '4499.95', '6499.95', NULL, NULL), (28, 24, 63, 4, '449.99', '0.00', '1799.96', '0.00', NULL, NULL), (29, 25, 62, 5, '449.99', '0.00', '2249.95', '0.00', NULL, NULL), (30, 26, 64, 5, '449.99', '0.00', '2249.95', '0.00', NULL, NULL), (31, 29, 27, 1, '449.99', '0.00', '449.99', '0.00', NULL, NULL), (32, 29, 8, 1, '449.99', '0.00', '449.99', '0.00', NULL, NULL), (33, 30, 65, 4, '449.99', '0.00', '1799.96', '0.00', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(10) UNSIGNED NOT NULL, `product_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `product_qty` int(10) UNSIGNED NOT NULL, `product_sku` int(10) UNSIGNED NOT NULL, `price` decimal(10,2) UNSIGNED NOT NULL, `reduced_price` decimal(10,2) UNSIGNED DEFAULT NULL, `cat_id` int(10) UNSIGNED NOT NULL, `brand_id` int(10) UNSIGNED NOT NULL, `featured` int(11) NOT NULL DEFAULT '0', `description` text COLLATE utf8_unicode_ci NOT NULL, `product_spec` text COLLATE utf8_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `product_name`, `product_qty`, `product_sku`, `price`, `reduced_price`, `cat_id`, `brand_id`, `featured`, `description`, `product_spec`, `created_at`, `updated_at`) VALUES (1, 'Sony - 55\" Class - LED - 2160p - Smart - 4K Ultra HD', 8, 260478281, '999.99', '899.99', 7, 17, 0, '<h3><strong><span style=\"font-size: 18px;\">Enjoy greater clarity, color, and contrast with the new 4K Processor X1</span></strong></h3><p>The powerful 4K Processor X1 brings stunning picture quality to whatever you\'re watching. Every source is intelligently analyzed and upscaled to our best 4K resolution, from TV broadcasts, Blu-ray Discs™ and DVDs, to 4K Internet videos. Enjoy incredible 4K images with stunning clarity, more lifelike colors and sparkling contrast.</p><h3><strong><span style=\"font-size: 18px;\">Whatever you’re watching, watch it in our true 4K</span></strong></h3><p>No matter the source, every pixel is upscaled beautifully by our most powerful 4K picture processing technology ever. Scenes are analyzed and matched with a special image database for supremely lifelike detail, whatever you\'re watching.</p><h3><strong><span style=\"font-size: 18px;\">Dynamic Contrast Enhancer improves contrast for everything you watch</span></strong></h3><p>The 4K Processor X1 ensures that the dynamic range of brightness on screen is continually optimized frame by frame.</p>', '<h4><strong><span style=\"font-size: 18px;\">54.6\" screen (measured diagonally from corner to corner)</span></strong></h4><p>A great size for a living room or mid-sized home theater space.</p><p><br></p><h4><strong><span style=\"font-size: 18px;\">LED TVs perform well in all lighting conditions</span></strong></h4><p>They also deliver plasma-like deep blacks and rich colors.</p><p><br></p><h4><strong><span style=\"font-size: 18px;\">2160p resolution for breathtaking HD images</span></strong></h4><p>Watch 4K movies and TV shows at 4x the resolution of Full HD, and upscale your current HD content to gorgeous, Ultra HD-level picture quality.</p><p><br></p><h4><strong><span style=\"font-size: 18px;\">Smart TV brings a world of entertainment to your living room</span></strong></h4><p>Stream your favorite movies, TV shows and music with Google Play.</p><p><br></p><h4><strong><span style=\"font-size: 18px;\">4 HDMI inputs for the best home theater connection</span></strong></h4><p>High-speed HDMI delivers a full 1080p picture and digital surround sound in one convenient cable. HDMI cable not included.</p><p><br></p><h4><strong><span style=\"font-size: 18px;\">3 USB inputs</span></strong></h4><p>Easily connect your digital camera, camcorder or other USB device.</p><p><br></p><p>Web-based services and content require high-speed Internet service. Some services may require a subscription.</p><p><br></p><p><br></p>', '2016-04-26 21:26:52', '2016-04-26 23:12:51'), (2, 'Samsung - 50\" Class - LED - 2160p - Smart - 4K Ultra HD TV', 3, 441716796, '899.99', '1299.99', 8, 16, 0, '<p><span>This SUHD TV offers 4K picture quality — 4x the resolution of Full HD — and a wide variety of Web options via Smart TV and apps. Stream music and video and surf the Internet with the multitasking power of a quad-core processor. Plus, with Briefing on TV, you can sync this SUHD TV with a Samsung smartphone or tablet to display time, weather and schedule updates on the TV screen.</span></p>', '<p><span style=\"font-size: 18px;\"><strong>49-1/2\" screen (measured diagonally from corner to corner)</strong></span></p><p>A great size for a living room or mid-sized home theater space.</p><p><br></p><p><span style=\"font-size: 18px;\"><strong>2160p resolution for breathtaking HD images</strong></span></p><p>Watch 4K movies and TV shows at 4x the resolution of Full HD, and upscale your current HD content to gorgeous, Ultra HD-level picture quality.*</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Motion Rate 120</span></strong></p><p>Enjoy high-speed action with good motion clarity.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Smart TV means a huge world of entertainment</span></strong></p><p>Stream content using Smart Hub and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Rapid Web browsing and downloading</span></strong></p><p>Multitask, browse the Web, and download apps faster with a quad-core processor.</p><p><br></p><p><span style=\"font-size: 18px;\">Reduced glare from any viewing angle</span></p><p>Ultra Clear Panel screen absorbs ambient light to reduce reflections, for clear viewing no matter where the TV is positioned.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Increased sense of depth</span></strong></p><p>Contrast enhancer automatically optimizes contrast across multiple zones of the screen for realistic foregrounds and backgrounds.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Nano-crystal color technology brings your entertainment to life in vivid detail</span></strong></p><p>Reveal brilliant colors and details you never knew were there.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Watch your smartphone content on your TV, and vice versa</span></strong></p><p>Smart View 2.0 lets you watch your mobile media on the TV display, or mirror TV titles on your compatible mobile device.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">ConnectShare Movie</span></strong></p><p>Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Briefing on TV lets you display important information and schedule your day</span></strong></p><p>Have the TV act as an alarm, and sync up with Samsung mobile devices to display important items such as the time, weather, and your daily schedule on the TV screen.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Advanced TV sound</span></strong></p><p>This TV includes two 10W speakers, DTS Premium Sound and DTS Studio Sound.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">4 HDMI inputs for the best home theater connection</span></strong></p><p>High-speed HDMI delivers an HD picture and digital surround sound in one convenient cable. HDMI cable sold separately.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">3 USB inputs</span></strong></p><p><br></p><p><br></p>', '2016-04-26 21:33:54', '2016-04-26 23:15:06'), (3, 'Sony - 65\" Class - LED - 2160p - Smart - 4K Ultra HD TV ', 8, 710509134, '1999.99', '2999.99', 7, 17, 0, '<p><span>Enjoy streaming content with a clear picture and bright colors, use your smartphone or tablet as a remote control, or stream PlayStation 3 games to your TV. Plus, the Android TV function lets you download a wide array of apps and games.</span></p>', '<p><strong><span style=\"font-size: 18px;\">64-1/2\" screen (measured diagonally from corner to corner)</span></strong></p><p>Provides an immersive experience for everyone in the room.</p><p><br></p><p><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></p><p>They also deliver plasma-like deep blacks and rich colors.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">2160p resolution for breathtaking HD images</span></strong></p><p>Watch 4K movies and TV shows at 4x the resolution of Full HD, and upscale your current HD content to gorgeous, Ultra HD-level picture quality.*</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Crisp, clear images, even at high speed</span></strong></p><p>You\'ll get impressive clarity during sporting events and action movies with Motionflow XR 960 technology.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Smart TV delivers a huge world of entertainment</span></strong></p><p>Stream movies, music and more through the Sony Entertainment Network, and surf your favorite websites with the included Opera Web browser.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Built-in Wi-Fi</span></strong></p><p>Connect to your wireless home network.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Android TV</span></strong></p><p>The power of Android on your television screen. Enjoy an array of apps, games and personalization features. Supports voice search and Google Cast.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">HDR compatible for next-level color and contrast</span></strong></p><p>HDR (High Dynamic Range) reproduces a wide range of brightness levels, bringing greater color and contrast to the screen.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">More color, depth and realism</span></strong></p><p>Colors come alive from the wide color gamut and heightened color depth of TRILUMINOS + X1 technology.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Upscaled clarity and color</span></strong></p><p>X-Reality PRO analyzes and refines clarity and contrast from your favorite shows, movies and clips in real time, creating crisp images and vibrant colors.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Stream PlayStation 3 games to your TV</span></strong></p><p>Choose from an exciting selection of PS3 games and stream them the same way you stream movies and TV shows. DualShock 4 controller sold separately.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Use your smartphone or tablet as a remote control</span></strong></p><p>Access Android TV or TV SideView on your compatible device to easily navigate using a keyboard, voice search, and quick access buttons.</p><p><br></p><p><strong><span style=\"font-size: 18px;\">Dolby Digital Plus and Dolby Pulse</span></strong></p><p>Optimizes the sound for TV from sources like Internet movies and music, connected PCs, smartphones and tablets.</p><p><br></p><p><br></p>', '2016-04-26 21:43:52', '2016-04-26 21:43:52'), (4, 'Samsung - 48\" Class - LED - 1080p - Smart - HDTV', 18, 785282706, '449.99', '0.00', 8, 16, 1, '<p><span>Discover new programs, stream movies and create a network of connected Samsung devices with this smart TV\'s advanced features. Color- and sound-enhancing options help bring your favorite shows and video clips to life.</span></p>', '<ul><li><h4><span style=\"font-size: 18px;\"><strong>47.6\" screen (measured diagonally from corner to corner)</strong></span></h4><p><span style=\"font-size: 18px;\">A great size for a living room or mid-sized home theater space.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></h4><p><span style=\"font-size: 18px;\">They also deliver deep blacks and rich colors.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>1080p resolution for stunning HD images</strong></span></h4><p><span style=\"font-size: 18px;\">Watch Blu-ray movies and 1080p HD content at their highest level of detail.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Motion Rate 60</strong></span></h4><p><span style=\"font-size: 18px;\">Enjoy high-speed action with basic motion clarity.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Smart TV means a huge world of entertainment</strong></span></h4><p><span style=\"font-size: 18px;\">Stream content using Smart Hub, and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Intelligent energy management</strong></span></h4><p><span style=\"font-size: 18px;\">Eco Sensor measures the intensity of light in the room and automatically adjusts the TV brightness.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Give a color boost to your picture</strong></span></h4><p><span style=\"font-size: 18px;\">Wide Color Enhancer expands the color range for rich, natural-looking images.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>ConnectShare Movie</strong></span></h4><p><span style=\"font-size: 18px;\">Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</span></p><br><br></li></ul>', '2016-04-26 21:49:18', '2016-04-26 23:14:48'), (8, 'Chaoba - 48\" Class - LED - 1080p - Smart - HDTV', 17, 785282706, '449.99', '0.00', 8, 16, 0, '<p><span>Discover new programs, stream movies and create a network of connected Samsung devices with this smart TV\'s advanced features. Color- and sound-enhancing options help bring your favorite shows and video clips to life.</span></p>', '<ul><li><h4><span style=\"font-size: 18px;\"><strong>47.6\" screen (measured diagonally from corner to corner)</strong></span></h4><p><span style=\"font-size: 18px;\">A great size for a living room or mid-sized home theater space.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></h4><p><span style=\"font-size: 18px;\">They also deliver deep blacks and rich colors.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>1080p resolution for stunning HD images</strong></span></h4><p><span style=\"font-size: 18px;\">Watch Blu-ray movies and 1080p HD content at their highest level of detail.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Motion Rate 60</strong></span></h4><p><span style=\"font-size: 18px;\">Enjoy high-speed action with basic motion clarity.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Smart TV means a huge world of entertainment</strong></span></h4><p><span style=\"font-size: 18px;\">Stream content using Smart Hub, and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Intelligent energy management</strong></span></h4><p><span style=\"font-size: 18px;\">Eco Sensor measures the intensity of light in the room and automatically adjusts the TV brightness.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Give a color boost to your picture</strong></span></h4><p><span style=\"font-size: 18px;\">Wide Color Enhancer expands the color range for rich, natural-looking images.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>ConnectShare Movie</strong></span></h4><p><span style=\"font-size: 18px;\">Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</span></p><br><br></li></ul>', '2016-04-26 21:49:18', '2016-04-26 23:14:48'), (27, 'Chaoba - 48\" Class - LED - 1080p - Smart - HDTV', 17, 785282706, '449.99', '0.00', 8, 16, 0, '<p><span>Discover new programs, stream movies and create a network of connected Samsung devices with this smart TV\'s advanced features. Color- and sound-enhancing options help bring your favorite shows and video clips to life.</span></p>', '<ul><li><h4><span style=\"font-size: 18px;\"><strong>47.6\" screen (measured diagonally from corner to corner)</strong></span></h4><p><span style=\"font-size: 18px;\">A great size for a living room or mid-sized home theater space.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></h4><p><span style=\"font-size: 18px;\">They also deliver deep blacks and rich colors.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>1080p resolution for stunning HD images</strong></span></h4><p><span style=\"font-size: 18px;\">Watch Blu-ray movies and 1080p HD content at their highest level of detail.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Motion Rate 60</strong></span></h4><p><span style=\"font-size: 18px;\">Enjoy high-speed action with basic motion clarity.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Smart TV means a huge world of entertainment</strong></span></h4><p><span style=\"font-size: 18px;\">Stream content using Smart Hub, and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Intelligent energy management</strong></span></h4><p><span style=\"font-size: 18px;\">Eco Sensor measures the intensity of light in the room and automatically adjusts the TV brightness.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Give a color boost to your picture</strong></span></h4><p><span style=\"font-size: 18px;\">Wide Color Enhancer expands the color range for rich, natural-looking images.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>ConnectShare Movie</strong></span></h4><p><span style=\"font-size: 18px;\">Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</span></p><br><br></li></ul>', '2016-04-26 21:49:18', '2016-04-26 23:14:48'), (62, 'Dell - 48\" Class - LED - 1080p - Smart - HDTV', 13, 785282706, '449.99', '0.00', 8, 16, 1, '<p><span>Discover new programs, stream movies and create a network of connected Samsung devices with this smart TV\'s advanced features. Color- and sound-enhancing options help bring your favorite shows and video clips to life.</span></p>', '<ul><li><h4><span style=\"font-size: 18px;\"><strong>47.6\" screen (measured diagonally from corner to corner)</strong></span></h4><p><span style=\"font-size: 18px;\">A great size for a living room or mid-sized home theater space.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></h4><p><span style=\"font-size: 18px;\">They also deliver deep blacks and rich colors.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>1080p resolution for stunning HD images</strong></span></h4><p><span style=\"font-size: 18px;\">Watch Blu-ray movies and 1080p HD content at their highest level of detail.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Motion Rate 60</strong></span></h4><p><span style=\"font-size: 18px;\">Enjoy high-speed action with basic motion clarity.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Smart TV means a huge world of entertainment</strong></span></h4><p><span style=\"font-size: 18px;\">Stream content using Smart Hub, and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Intelligent energy management</strong></span></h4><p><span style=\"font-size: 18px;\">Eco Sensor measures the intensity of light in the room and automatically adjusts the TV brightness.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Give a color boost to your picture</strong></span></h4><p><span style=\"font-size: 18px;\">Wide Color Enhancer expands the color range for rich, natural-looking images.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>ConnectShare Movie</strong></span></h4><p><span style=\"font-size: 18px;\">Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</span></p><br><br></li></ul>', '2016-04-26 21:49:18', '2016-04-26 23:14:48'), (63, 'Sony - 48\" Class - LED - 1080p - Smart - HDTV', 14, 785282706, '449.99', '0.00', 8, 16, 1, '<p><span>Discover new programs, stream movies and create a network of connected Samsung devices with this smart TV\'s advanced features. Color- and sound-enhancing options help bring your favorite shows and video clips to life.</span></p>', '<ul><li><h4><span style=\"font-size: 18px;\"><strong>47.6\" screen (measured diagonally from corner to corner)</strong></span></h4><p><span style=\"font-size: 18px;\">A great size for a living room or mid-sized home theater space.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></h4><p><span style=\"font-size: 18px;\">They also deliver deep blacks and rich colors.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>1080p resolution for stunning HD images</strong></span></h4><p><span style=\"font-size: 18px;\">Watch Blu-ray movies and 1080p HD content at their highest level of detail.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Motion Rate 60</strong></span></h4><p><span style=\"font-size: 18px;\">Enjoy high-speed action with basic motion clarity.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Smart TV means a huge world of entertainment</strong></span></h4><p><span style=\"font-size: 18px;\">Stream content using Smart Hub, and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Intelligent energy management</strong></span></h4><p><span style=\"font-size: 18px;\">Eco Sensor measures the intensity of light in the room and automatically adjusts the TV brightness.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Give a color boost to your picture</strong></span></h4><p><span style=\"font-size: 18px;\">Wide Color Enhancer expands the color range for rich, natural-looking images.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>ConnectShare Movie</strong></span></h4><p><span style=\"font-size: 18px;\">Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</span></p><br><br></li></ul>', '2016-04-26 21:49:18', '2016-04-26 23:14:48'), (64, 'Toshiba - 48\" Class - LED - 1080p - Smart - HDTV', 13, 785282706, '449.99', '0.00', 8, 16, 1, '<p><span>Discover new programs, stream movies and create a network of connected Samsung devices with this smart TV\'s advanced features. Color- and sound-enhancing options help bring your favorite shows and video clips to life.</span></p>', '<ul><li><h4><span style=\"font-size: 18px;\"><strong>47.6\" screen (measured diagonally from corner to corner)</strong></span></h4><p><span style=\"font-size: 18px;\">A great size for a living room or mid-sized home theater space.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></h4><p><span style=\"font-size: 18px;\">They also deliver deep blacks and rich colors.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>1080p resolution for stunning HD images</strong></span></h4><p><span style=\"font-size: 18px;\">Watch Blu-ray movies and 1080p HD content at their highest level of detail.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Motion Rate 60</strong></span></h4><p><span style=\"font-size: 18px;\">Enjoy high-speed action with basic motion clarity.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Smart TV means a huge world of entertainment</strong></span></h4><p><span style=\"font-size: 18px;\">Stream content using Smart Hub, and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Intelligent energy management</strong></span></h4><p><span style=\"font-size: 18px;\">Eco Sensor measures the intensity of light in the room and automatically adjusts the TV brightness.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Give a color boost to your picture</strong></span></h4><p><span style=\"font-size: 18px;\">Wide Color Enhancer expands the color range for rich, natural-looking images.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>ConnectShare Movie</strong></span></h4><p><span style=\"font-size: 18px;\">Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</span></p><br><br></li></ul>', '2016-04-26 21:49:18', '2016-04-26 23:14:48'), (65, 'Chaoba - 48\" Class - LED - 1080p - Smart - HDTV', 14, 785282706, '449.99', '0.00', 8, 16, 0, '<p><span>Discover new programs, stream movies and create a network of connected Samsung devices with this smart TV\'s advanced features. Color- and sound-enhancing options help bring your favorite shows and video clips to life.</span></p>', '<ul><li><h4><span style=\"font-size: 18px;\"><strong>47.6\" screen (measured diagonally from corner to corner)</strong></span></h4><p><span style=\"font-size: 18px;\">A great size for a living room or mid-sized home theater space.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>LED TVs perform well in all lighting conditions</strong></span></h4><p><span style=\"font-size: 18px;\">They also deliver deep blacks and rich colors.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>1080p resolution for stunning HD images</strong></span></h4><p><span style=\"font-size: 18px;\">Watch Blu-ray movies and 1080p HD content at their highest level of detail.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Motion Rate 60</strong></span></h4><p><span style=\"font-size: 18px;\">Enjoy high-speed action with basic motion clarity.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Smart TV means a huge world of entertainment</strong></span></h4><p><span style=\"font-size: 18px;\">Stream content using Smart Hub, and surf the Internet with the included Web browser. S-Recommendation finds the movies and shows you\'ll enjoy most. Built-in Wi-Fi connects to a wireless home network.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Intelligent energy management</strong></span></h4><p><span style=\"font-size: 18px;\">Eco Sensor measures the intensity of light in the room and automatically adjusts the TV brightness.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>Give a color boost to your picture</strong></span></h4><p><span style=\"font-size: 18px;\">Wide Color Enhancer expands the color range for rich, natural-looking images.</span></p><span style=\"font-size: 18px;\"><br></span><h4><span style=\"font-size: 18px;\"><strong>ConnectShare Movie</strong></span></h4><p><span style=\"font-size: 18px;\">Watch videos, play music and view photos from a USB connection without needing to use a PC or special equipment.</span></p><br><br></li></ul>', '2016-04-26 21:49:18', '2016-04-26 23:14:48'), (66, 'Test', 6, 111758385, '300000.00', '280000.00', 18, 1, 0, '<p>cascacsa</p>', '', '2017-05-30 04:38:01', '2017-05-30 04:38:01'); -- -------------------------------------------------------- -- -- Table structure for table `product_images` -- CREATE TABLE `product_images` ( `id` int(10) UNSIGNED NOT NULL, `product_id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `thumbnail_path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `featured` tinyint(1) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `product_images` -- INSERT INTO `product_images` (`id`, `product_id`, `name`, `path`, `thumbnail_path`, `featured`, `created_at`, `updated_at`) VALUES (1, 1, 'a372829277cab311ebfdbdc4698d404bed09c34a.jpg', 'ProductPhotos/photos/a556f4a07c2bb51be3d290b9e87fa9bc7fec0157.jpg', 'ProductPhotos/photos/th-a556f4a07c2bb51be3d290b9e87fa9bc7fec0157.jpg', 0, '2016-04-26 21:27:13', '2016-04-26 21:28:05'), (2, 1, 'b95144289cde4e7b6937ad761b39e4a7fdc77cf5.jpg', 'ProductPhotos/photos/93071fc504eec5ff96f5bc02c8f52a7ccc72a291.jpg', 'ProductPhotos/photos/th-93071fc504eec5ff96f5bc02c8f52a7ccc72a291.jpg', 0, '2016-04-26 21:27:13', '2016-04-26 21:28:05'), (6, 1, 'bffdd7ac95b53c7b22161dd5328b17292ae6b487.jpg', 'ProductPhotos/photos/5a98522f954a5e233b79783957f17794fd11cafb.jpg', 'ProductPhotos/photos/th-5a98522f954a5e233b79783957f17794fd11cafb.jpg', 0, '2016-04-26 21:27:13', '2016-04-26 21:28:05'), (8, 2, '770776ddb516f9f03b5936335eaa78f4c3f6f1d1.jpg', 'ProductPhotos/photos/f491596073e9545ed5c4a309588d3c7d78b66ad7.jpg', 'ProductPhotos/photos/th-f491596073e9545ed5c4a309588d3c7d78b66ad7.jpg', 0, '2016-04-26 21:34:05', '2016-04-26 21:36:13'), (9, 2, '8dde09c152c6eb3d3e7e9e1a2f789e078a366481.jpg', 'ProductPhotos/photos/a18963a7d4f8a0e2af4372afc40fe9fc4c6588ee.jpg', 'ProductPhotos/photos/th-a18963a7d4f8a0e2af4372afc40fe9fc4c6588ee.jpg', 0, '2016-04-26 21:34:06', '2016-04-26 21:36:13'), (11, 2, 'ba30e96844d51d88fe5cea492cd9a6af2dd10293.jpg', 'ProductPhotos/photos/ded66b1a238384cd9c9249d91877dedf8d3c78a8.jpg', 'ProductPhotos/photos/th-ded66b1a238384cd9c9249d91877dedf8d3c78a8.jpg', 1, '2016-04-26 21:36:07', '2016-04-26 21:36:13'), (12, 3, 'f85a61c67c17f31938c4426f186da98370225823.jpg', 'ProductPhotos/photos/3d18779c672c56e3a23a0f119c50952c9b09879f.jpg', 'ProductPhotos/photos/th-3d18779c672c56e3a23a0f119c50952c9b09879f.jpg', 1, '2016-04-26 21:44:08', '2016-04-26 21:44:21'), (19, 3, 'dd7eb0e593561fa197776c8fbd9f3243bff5ddf9.jpg', 'ProductPhotos/photos/dd7eb0e593561fa197776c8fbd9f3243bff5ddf9.jpg', 'ProductPhotos/photos/th-dd7eb0e593561fa197776c8fbd9f3243bff5ddf9.jpg', 0, '2016-04-26 21:44:10', '2016-04-26 21:44:21'), (20, 4, '920a961555bb9c7bd12ad259f0f9cc3b0bb0f855.jpg', 'ProductPhotos/photos/077301b80bb7b81f23f6ee7c7f2fef22e987e649.jpg', 'ProductPhotos/photos/th-077301b80bb7b81f23f6ee7c7f2fef22e987e649.jpg', 1, '2016-04-26 21:49:37', '2016-04-26 21:49:42'), (21, 62, '920a961555bb9c7bd12ad259f0f9cc3b0bb0f855.jpg', 'ProductPhotos/photos/077301b80bb7b81f23f6ee7c7f2fef22e987e649.jpg', 'ProductPhotos/photos/th-077301b80bb7b81f23f6ee7c7f2fef22e987e649.jpg', 1, '2016-04-26 21:49:37', '2016-04-26 21:49:42'), (22, 63, '770776ddb516f9f03b5936335eaa78f4c3f6f1d1.jpg', 'ProductPhotos/photos/f491596073e9545ed5c4a309588d3c7d78b66ad7.jpg', 'ProductPhotos/photos/th-f491596073e9545ed5c4a309588d3c7d78b66ad7.jpg', 0, '2016-04-26 21:34:05', '2016-04-26 21:36:13'), (23, 64, 'a372829277cab311ebfdbdc4698d404bed09c34a.jpg', 'ProductPhotos/photos/a556f4a07c2bb51be3d290b9e87fa9bc7fec0157.jpg', 'ProductPhotos/photos/th-a556f4a07c2bb51be3d290b9e87fa9bc7fec0157.jpg', 0, '2016-04-26 21:27:13', '2016-04-26 21:28:05'), (24, 65, '8dde09c152c6eb3d3e7e9e1a2f789e078a366481.jpg', 'ProductPhotos/photos/a18963a7d4f8a0e2af4372afc40fe9fc4c6588ee.jpg', 'ProductPhotos/photos/th-a18963a7d4f8a0e2af4372afc40fe9fc4c6588ee.jpg', 0, '2016-04-26 21:34:06', '2016-04-26 21:36:13'), (25, 66, '<PASSWORD>1.jpg', 'ProductPhotos/photos/8442fb8987424614d29f5d3b827ddf2295f267a1.jpg', 'ProductPhotos/photos/th-8442fb8987424614d29f5d3b827ddf2295f267a1.jpg', 0, '2017-06-01 11:43:59', '2017-06-01 11:43:59'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `verified` tinyint(1) NOT NULL DEFAULT '0', `token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `admin` int(11) NOT NULL, `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `email`, `password`, `last_login`, `verified`, `token`, `admin`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'admin', '<EMAIL>', '$2y$10$qN6fnUZb9Qs4EQ5UL9KadeQ6irkBJRbxmEyUurYrJ49dLL8XpSF5i', '2017-05-30 11:29:15', 1, '', 1, 'ibEKbBdCt5muzz1MvehE6HAxSObsQmyy4aOmwA1WeYEEnRIUeJ0YDwERY8xE', '2017-05-23 07:56:08', '2017-05-30 10:29:15'), (2, 'Daygea', '<EMAIL>', '$2y$10$qN6fnUZb9Qs4EQ5UL9KadeQ6irkBJRbxmEyUurYrJ49dLL8XpSF5i', '2017-06-01 12:27:27', 1, '', 0, 'v1nyKe7YnDyZz68y8dBTRC0NE9D4o5bY9kRJoYPIlopq6pvSZfMhU6ptqTTt', '2017-05-23 07:56:08', '2017-06-01 11:27:27'), (13, 'Daygeasss', '<EMAIL>', '$2y$10$qN6fnUZb9Qs4EQ5UL9KadeQ6irkBJRbxmEyUurYrJ49dLL8XpSF5i', '2017-05-31 07:19:16', 1, '', 0, 'Y1mpvgX68g3QEIyJI61TWiIzZnE5i3eM5ca7kCCnBOEM8yD0EcoWYYW8D5Pj', '2017-05-23 07:56:08', '2017-05-31 06:19:16'); -- -- Indexes for dumped tables -- -- -- Indexes for table `brands` -- ALTER TABLE `brands` ADD PRIMARY KEY (`id`); -- -- Indexes for table `carts` -- ALTER TABLE `carts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `order_product` -- ALTER TABLE `order_product` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`), ADD KEY `password_resets_token_index` (`token`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_images` -- ALTER TABLE `product_images` ADD PRIMARY KEY (`id`), ADD KEY `product_images_product_id_foreign` (`product_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `brands` -- ALTER TABLE `brands` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `carts` -- ALTER TABLE `carts` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31; -- -- AUTO_INCREMENT for table `order_product` -- ALTER TABLE `order_product` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67; -- -- AUTO_INCREMENT for table `product_images` -- ALTER TABLE `product_images` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- Constraints for dumped tables -- -- -- Constraints for table `product_images` -- ALTER TABLE `product_images` ADD CONSTRAINT `product_images_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE; /*!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 */;
ALTER TABLE [dbo].[ProjectExecutors] ADD CONSTRAINT [ProjectExecutors_Employee_Id_ForeignKeyConstraint] FOREIGN KEY (Employee_Id) REFERENCES dbo.Employees (Id)
<reponame>pepeul1191/codeigniter-webpack-backbone<filename>db/migrations/20191012192521_create_vw_techologies_images.sql -- migrate:up CREATE VIEW vw_technologies_images AS SELECT I.id, I.alt, I.url, TI.technology_id AS technology_id FROM images I JOIN technologies_images TI ON TI.image_id = I.id LIMIT 2000 -- migrate:down DROP VIEW IF EXISTS vw_technologies_images
<filename>server/schema/tables/sets.sql create table if not exists sets ( `id` bigint(20) unsigned primary key auto_increment, `name` varchar(300) not null, `creationDate` timestamp default current_timestamp, `parentId` bigint(20) unsigned null, `childPrefix` varchar(300) null, `ignorePrefix` boolean default 0 ) engine=InnoDB default charset=utf8 auto_increment=1;
INSERT INTO `working_zones` (`id`, `parent_id`, `tier`, `name`, `slug`, `scope`, `status`, `created_at`, `updated_at`) VALUES (78, 57, 1, 'भोर्ले', '', 'vdc', 'Published', '2015-11-13 02:15:02', '2016-05-02 13:42:35'), (79, 57, 1, 'बृद्धिम', '', 'vdc', 'Published', '2015-11-13 02:16:12', '2016-05-02 13:43:03'), (80, 57, 1, 'चिलिमे', '', 'vdc', 'Published', '2015-11-13 02:28:44', '2016-05-02 13:43:28'), (81, 57, 1, 'डाडागाउ', '', 'vdc', 'Published', '2015-11-13 02:29:02', '2016-05-02 13:44:31'), (82, 57, 1, 'गत्लंग', '', 'vdc', 'Published', '2015-11-13 02:29:14', '2016-05-02 13:45:43'), (83, 57, 1, 'हाकु', '', 'vdc', 'Published', '2015-11-13 02:29:42', '2016-05-02 13:46:14'), (84, 57, 1, 'गोल्जुंग', '', 'vdc', 'Published', '2015-11-13 02:29:57', '2016-05-02 13:46:53'), (85, 57, 1, 'लांगटांग', '', 'vdc', 'Published', '2015-11-29 02:46:42', '2016-05-02 13:47:53'), (86, 57, 1, 'स्याफ्रु', '', 'vdc', 'Published', '2015-11-29 02:47:02', '2016-05-02 13:48:30'), (87, 57, 1, 'लहरेपौवा', '', 'vdc', 'Published', '2015-11-29 02:47:40', '2016-05-02 13:49:01'), (88, 57, 1, 'धुन्चे', '', 'vdc', 'Published', '2015-11-29 02:48:05', '2016-05-02 13:49:27'), (89, 57, 1, 'धैबुंग', '', 'vdc', 'Published', '2015-11-29 02:48:45', '2016-05-02 13:49:53'), (90, 57, 1, 'राम्चे', '', 'vdc', 'Published', '2015-11-29 02:48:57', '2016-05-02 13:50:30'), (91, 57, 1, 'सरमथली', '', 'vdc', 'Published', '2015-11-29 02:51:32', '2016-05-02 13:51:04'), (92, 57, 1, 'टिमुरे', '', 'vdc', 'Published', '2015-11-29 02:53:27', '2016-05-02 13:52:25'),
-- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 19, 2015 at 11:03 PM -- Server version: 5.5.24-log -- PHP Version: 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 */; -- -- Database: `pathology_lab` -- -- -------------------------------------------------------- -- -- Table structure for table `medical_test` -- CREATE TABLE IF NOT EXISTS `medical_test` ( `test_id` tinyint(4) NOT NULL AUTO_INCREMENT, `test_name` varchar(100) NOT NULL, PRIMARY KEY (`test_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; -- -- Dumping data for table `medical_test` -- INSERT INTO `medical_test` (`test_id`, `test_name`) VALUES (1, 'test 1'), (2, 'test 2'), (3, 'test 3'), (4, 'test 4'), (5, 'test 5'), (6, 'test 6'), (7, 'test 7'), (8, 'test 8'); -- -------------------------------------------------------- -- -- Table structure for table `patients` -- CREATE TABLE IF NOT EXISTS `patients` ( `patient_id` tinyint(4) NOT NULL AUTO_INCREMENT, `patient_username` varchar(10) COLLATE latin1_general_ci NOT NULL, `patient_passcode` varchar(100) COLLATE latin1_general_ci NOT NULL, `patient_firstname` varchar(100) COLLATE latin1_general_ci NOT NULL, `patient_lastname` varchar(100) COLLATE latin1_general_ci NOT NULL, PRIMARY KEY (`patient_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=17 ; -- -- Dumping data for table `patients` -- INSERT INTO `patients` (`patient_id`, `patient_username`, `patient_passcode`, `patient_firstname`, `patient_lastname`) VALUES (1, 'dawood4pk', '1<PASSWORD>', 'Dawood', 'Butt'), (5, 'd', 'b', 'David', 'Butt'), (6, 'a', 'b', 'A', 'Butt'), (7, 'b', 'b', 'B', 'Butt'), (8, 'c', 'b', 'C', 'Butt'), (9, 'e', 'b', 'E', 'Butt'), (10, 'f', 'b', 'F', 'Butt'), (11, 'g', 'b', 'G', 'Butt'), (12, 'e', 'b', 'E', 'Butt'), (13, 'f', 'b', 'F', 'Butt'), (16, 'h', 'b', 'H', 'Butt'); -- -------------------------------------------------------- -- -- Table structure for table `patient_report` -- CREATE TABLE IF NOT EXISTS `patient_report` ( `id` tinyint(4) NOT NULL AUTO_INCREMENT, `report_id` tinyint(4) NOT NULL, `test_id` tinyint(4) NOT NULL, `test_result` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=69 ; -- -- Dumping data for table `patient_report` -- INSERT INTO `patient_report` (`id`, `report_id`, `test_id`, `test_result`) VALUES (14, 2, 1, 'Normal'), (15, 2, 2, 'OK'), (58, 6, 1, 'Average'), (59, 6, 2, 'OK'), (68, 1, 1, 'Required some other tests as well'); -- -------------------------------------------------------- -- -- Table structure for table `reports` -- CREATE TABLE IF NOT EXISTS `reports` ( `report_id` tinyint(4) NOT NULL AUTO_INCREMENT, `report_name` varchar(100) NOT NULL, `patient_id` tinyint(4) NOT NULL, PRIMARY KEY (`report_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `reports` -- INSERT INTO `reports` (`report_id`, `report_name`, `patient_id`) VALUES (1, 'report 1', 6), (2, 'report 2', 1), (6, 'report 6', 1); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` tinyint(4) NOT NULL AUTO_INCREMENT, `username` varchar(10) COLLATE latin1_general_ci NOT NULL, `password` varchar(100) COLLATE latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`) VALUES (1, 'admin', '<PASSWORD>'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
use tempdb go create schema testschema go create table t (c1 int) go create procedure testschema.p_test @c int as select * from dbo.t where c1 = @c select * from dbo.t t1 join dbo.t t2 on t1.c1=t2.c1 go ---- step 2 create the plan guide EXEC sp_create_plan_guide @name = N'Guide1', @stmt = N'select * from dbo.t where c1 = @c', @type = N'OBJECT', @module_or_batch = N'testschema.p_test', @params = NULL, @hints = N'OPTION (recompile)'; go EXEC sp_create_plan_guide @name = N'Guide2', @stmt = N'select * from dbo.t t1 join dbo.t t2 on t1.c1=t2.c1', @type = N'OBJECT', @module_or_batch = N'testschema.p_test', @params = NULL, @hints = N'OPTION (hash join)'; ---step 3 verify that the plan guide is created select * from sys.plan_guides /* step 4 verify the stored procedure actually uses plan a) set your SSMS using grid mode b) execute the following query */ set statistics xml on go testschema.p_test 2 go set statistics xml off go /* c) click on the two xml plans in the results. You should see PlanGuideName="Guide1" for first plan and PlangGuideName="Guide2" for second plan */ /*********************************** DROP OBJECTS **************************/ exec sp_control_plan_guide 'DROP','Guide1' exec sp_control_plan_guide 'DROP','Guide2' drop procedure testschema.p_test drop table t drop schema testschema /********************************** PLAN GUIDE FROM CACHE ****************************************/ USE AdventureWorks; GO SELECT WorkOrderID, p.Name, OrderQty, DueDate FROM Production.WorkOrder AS w JOIN Production.Product AS p ON w.ProductID = p.ProductID WHERE p.ProductSubcategoryID > 4 ORDER BY p.Name, DueDate; GO -- Inspect the query plan by using dynamic management views. SELECT * FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(sql_handle) CROSS APPLY sys.dm_exec_text_query_plan(qs.plan_handle, qs.statement_start_offset, qs.statement_end_offset) AS qp WHERE text LIKE N'SELECT WorkOrderID, p.Name, OrderQty, DueDate%'; GO -- Create a plan guide for the query by specifying the query plan in the plan cache. DECLARE @plan_handle varbinary(64); DECLARE @offset int; SELECT @plan_handle = plan_handle, @offset = qs.statement_start_offset FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS st CROSS APPLY sys.dm_exec_text_query_plan(qs.plan_handle, qs.statement_start_offset, qs.statement_end_offset) AS qp WHERE text LIKE N'SELECT WorkOrderID, p.Name, OrderQty, DueDate%'; EXECUTE sp_create_plan_guide_from_handle @name = N'Guide_From_Cache', @plan_handle = @plan_handle, @statement_start_offset = @offset; GO -- Verify that the plan guide is created. SELECT * FROM sys.plan_guides WHERE scope_batch LIKE N'SELECT WorkOrderID, p.Name, OrderQty, DueDate%'; GO exec sp_control_plan_guide 'DROP','Guide_From_Cache'
<reponame>genekuo/fight-churn<gh_stars>100-1000 set search_path = '%schema'; with date_vals AS ( select i::timestamp as metric_date from generate_series('%from_date', '%to_date', '7 day'::interval) i ) insert into metric (account_id,metric_name_id,metric_time,metric_value) select account_id, %metric_name_id, metric_date, max(bill_period_months) from subscription inner join date_vals on start_date <= metric_date and (end_date > metric_date or end_date is null) group by account_id, metric_date
-- Script: Get-Table.sql -- Description: Returns a list of tables for the current database. -- Reference: https://msdn.microsoft.com/en-us/library/ms186224.aspx SELECT TABLE_CATALOG AS [DATABASE_NAME], TABLE_SCHEMA AS [SCHEMA_NAME], TABLE_NAME,TABLE_TYPE FROM [INFORMATION_SCHEMA].[TABLES]
delimiter / INSERT INTO SEQ_PROTO_CORRESP_TEMPL VALUES (null) / INSERT INTO PROTO_CORRESP_TEMPL (PROTO_CORRESP_TEMPL_ID,PROTO_CORRESP_TYPE_CODE,COMMITTEE_ID,FILE_NAME,CORRESPONDENCE_TEMPLATE,UPDATE_USER,UPDATE_TIMESTAMP,OBJ_ID,VER_NBR) VALUES ((SELECT MAX(ID) FROM SEQ_PROTO_CORRESP_TEMPL),(SELECT PROTO_CORRESP_TYPE_CODE FROM PROTO_CORRESP_TYPE WHERE DESCRIPTION = 'Reminder to IRB Notification #1'),'DEFAULT','DEFAULT-23-ReminderToIrbNotification#1.xsl', '<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:n1="http://irb.mit.edu/irbnamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:variable name="fo:layout-master-set"> <fo:layout-master-set> <fo:simple-page-master master-name="default-page" page-height="11in" page-width="8.5in" margin-left="0.8in" margin-right="0.8in"> <fo:region-body margin-top="0.45in" margin-bottom="0.45in" /> <fo:region-before extent="0.79in" /> </fo:simple-page-master> </fo:layout-master-set> </xsl:variable> <xsl:output version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="no" media-type="text/html" /> <xsl:template match="/"> <fo:root> <xsl:copy-of select="$fo:layout-master-set" /> <fo:page-sequence master-reference="default-page" initial-page-number="1" format="1"> <fo:flow flow-name="xsl-region-body"> <fo:block> <xsl:for-each select="n1:RenewalReminder"> <fo:table width="100%" space-before.optimum="1pt" space-after.optimum="2pt"> <fo:table-column column-width="43pt" /> <fo:table-column column-width="281pt" /> <fo:table-column column-width="100pt" /> <fo:table-column column-width="99pt" /> <fo:table-body> <fo:table-row> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" number-columns-spanned="4" text-align="right" width="43pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block> <fo:external-graphic space-before.optimum="4pt" space-after.optimum="4pt"> <xsl:attribute name="src">url(''<xsl:text disable-output-escaping="yes">/export/home/www/https/tomcat5.0.25/webapps/coeus/images/couhes_byline2.gif</xsl:text>'')</xsl:attribute> </fo:external-graphic> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" text-align="right" width="43pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block> <fo:inline font-weight="bold">To:</fo:inline> </fo:block> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" width="281pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt" text-align="start"> <fo:block> <xsl:for-each select="n1:Protocol"> <xsl:for-each select="n1:Investigator"> <xsl:for-each select="n1:Person"> <xsl:for-each select="n1:Fullname"> <xsl:if test="../../n1:PI_flag =&apos;true&apos;"> <fo:inline font-size="10pt"> <xsl:apply-templates /> </fo:inline> </xsl:if> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:for-each> </fo:block> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" text-align="right" width="100pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block> <fo:inline font-weight="bold">Date:</fo:inline> </fo:block> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" height="15pt" width="99pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt" display-align="center" text-align="start"> <fo:block> <xsl:for-each select="n1:CurrentDate"> <fo:inline font-size="10pt"> <xsl:value-of select="format-number(number(substring(string(.), 6, 2)), ''00'')" /> <xsl:text>/</xsl:text> <xsl:value-of select="format-number(number(substring(string(.), 9, 2)), ''00'')" /> <xsl:text>/</xsl:text> <xsl:value-of select="format-number(number(substring(string(.), 1, 4)), ''0000'')" /> </fo:inline> </xsl:for-each> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" text-align="right" width="43pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block /> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" width="281pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt" text-align="start"> <fo:block> <xsl:for-each select="n1:Protocol"> <xsl:for-each select="n1:Investigator"> <xsl:for-each select="n1:Person"> <xsl:for-each select="n1:OfficeLocation"> <xsl:if test="../../n1:PI_flag =&apos;true&apos;"> <xsl:apply-templates /> </xsl:if> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:for-each> </fo:block> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" text-align="right" width="100pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block /> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" width="99pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt" text-align="start"> <fo:block /> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" text-align="right" width="43pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block> <fo:inline font-weight="bold">From:</fo:inline> </fo:block> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" width="281pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt" text-align="start"> <fo:block> <xsl:for-each select="n1:CommitteeMasterData"> <xsl:for-each select="n1:CommitteeName"> <fo:inline font-size="10pt"> <xsl:apply-templates /> </fo:inline> </xsl:for-each> </xsl:for-each> </fo:block> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" text-align="right" width="100pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block> <fo:inline font-weight="bold">Action Date:</fo:inline> </fo:block> </fo:table-cell> <fo:table-cell line-height="10pt" border-style="solid" border-width="1pt" border-color="white" display-align="before" height="15pt" width="99pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt" text-align="start"> <fo:block> <xsl:for-each select="n1:Protocol"> <xsl:for-each select="n1:ProtocolMasterData"> <xsl:for-each select="n1:ExpirationDate"> <fo:inline font-size="10pt"> <xsl:value-of select="format-number(number(substring(string(.), 6, 2)), ''00'')" /> <xsl:text>/</xsl:text> <xsl:value-of select="format-number(number(substring(string(.), 9, 2)), ''00'')" /> <xsl:text>/</xsl:text> <xsl:value-of select="format-number(number(substring(string(.), 1, 4)), ''0000'')" /> </fo:inline> </xsl:for-each> </xsl:for-each> </xsl:for-each> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> <fo:table font-size="10pt" width="100%" space-before.optimum="1pt" space-after.optimum="2pt"> <fo:table-column column-width="43pt" /> <fo:table-column column-width="281pt" /> <fo:table-body> <fo:table-row> <fo:table-cell border-style="solid" border-width="1pt" border-color="white" display-align="before" text-align="right" width="43pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt"> <fo:block> <fo:inline font-weight="bold">Re:</fo:inline> </fo:block> </fo:table-cell> <fo:table-cell border-style="solid" border-width="1pt" border-color="white" display-align="before" width="281pt" padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt" text-align="start"> <fo:block>Protocol #: <xsl:for-each select="n1:Protocol"> <xsl:for-each select="n1:ProtocolMasterData"> <xsl:for-each select="n1:ProtocolNumber"> <xsl:apply-templates /> </xsl:for-each>: <xsl:for-each select="n1:ProtocolTitle"> <xsl:apply-templates /> </xsl:for-each> </xsl:for-each> </xsl:for-each> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> <fo:inline font-size="10pt">This letter serves as an IRB notification reminder by the </fo:inline> <xsl:for-each select="n1:CommitteeMasterData"> <xsl:for-each select="n1:CommitteeName"> <fo:inline font-size="10pt"> <xsl:apply-templates /> </fo:inline> </xsl:for-each> </xsl:for-each> <fo:inline font-size="10pt">.&#160; Recently a protocol was returned to you with a request for revision.&#160; It is the primary responsibility of the Principal Investigator to ensure that the protocol is resubmitted with the necessary changes.&#160; </fo:inline> <fo:block> <fo:leader leader-pattern="space" /> </fo:block> <fo:inline font-size="10pt">P</fo:inline> <fo:inline font-size="10pt">lease note that the level of scrutiny given to the resubmitted protocol is the same as that of any new protocol.&#160; All requests for approval must be reviewed at a convened IRB meeting, except for those protocols that meet the criteria for expedited review.&#160;</fo:inline> <fo:block> <xsl:text>&#xA;</xsl:text> </fo:block> </xsl:for-each> </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet> ','admin',NOW(),UUID(),1) / delimiter ;
<gh_stars>0 DROP DATABASE IF EXISTS tech_no_blog_db; CREATE DATABASE tech_no_blog_db; USE tech_no_blog_db;
<filename>internal/permission/schema.sql CREATE TABLE IF NOT EXISTS permission_principals ( user_id TEXT COLLATE BINARY NOT NULL, principal TEXT NOT NULL, PRIMARY KEY (user_id, principal) ); CREATE TABLE IF NOT EXISTS permission_paths ( path TEXT COLLATE BINARY NOT NULL, permission TEXT NOT NULL, principal TEXT NOT NULL, PRIMARY KEY (path, permission, principal) ); CREATE INDEX IF NOT EXISTS idx_permission_paths_permission ON permission_paths(permission); CREATE INDEX IF NOT EXISTS idx_permission_paths_principal ON permission_paths(principal); -- Same table as exists in the storage backend, but used to track -- migration status for both. Only one schema actually has to create -- it. CREATE TABLE IF NOT EXISTS metainfo ( name TEXT NOT NULL, value TEXT NOT NULL, PRIMARY KEY (name) ); INSERT INTO metainfo VALUES ('permission_schema_version', '1') ON CONFLICT (name) DO NOTHING;
create sequence hibernate_sequence start with 1 increment by 1; create table commission ( commission_id bigint not null, commission_request varchar(200) not null, timestamp timestamp not null, waitlist_position integer not null, commissioner_id bigint not null, product_id bigint, seller_id bigint, primary key (commission_id) ); create table image ( image_id bigint not null, created timestamp not null, image_description varchar(255), image_file_name varchar(255) not null, product_id bigint not null, primary key (image_id) ); create table placed_order ( order_id bigint not null, placed_date timestamp not null, buyer_id bigint not null, seller_id bigint not null, primary key (order_id) ); create table product ( product_id bigint not null, description varchar(255), product_name varchar(255) not null, posted_date timestamp not null, price integer not null, stock integer not null, profile_id bigint not null, primary key (product_id) ); create table product_on_order ( product_on_order_id bigint not null, item_quantity integer not null, unit_price integer not null, order_id bigint not null, product_id bigint not null, primary key (product_on_order_id) ); create table profile ( profile_id bigint not null, address varchar(255), email varchar(255) not null, oauth varchar(255) not null, username varchar(255) not null, primary key (profile_id) ); create table profile_picture ( id bigint not null, content_type varchar(255) not null, created timestamp not null, name varchar(255) not null, path varchar(255) not null, user_id bigint not null, primary key (id) ); create index IDXfujtkp830qt7of6ucsl110vmv on commission (waitlist_position); alter table image add constraint UK_axg5ixbh7tye8lc9xwtgm1a32 unique (image_file_name); alter table profile add constraint UK_9d5dpsf2ufa6rjbi3y0elkdcd unique (email); alter table profile add constraint UK_msh3rg1xuru67t2npsqfs15ee unique (oauth); alter table profile add constraint UK_5em4hwqp4woqsf49dru7fjo80 unique (username); alter table commission add constraint FKd9e3j53kls0ybp4yq7wm5dcy foreign key (commissioner_id) references profile; alter table commission add constraint FKqhgrwcqymr2ks1dh4kqmy6vbo foreign key (product_id) references product; alter table commission add constraint FKc7m7nwjhiyy39v8g17m1sutpq foreign key (seller_id) references profile; alter table image add constraint FKgpextbyee3uk9u6o2381m7ft1 foreign key (product_id) references product; alter table placed_order add constraint FKn1oh4nkp5uo29mulkjsda0mcy foreign key (buyer_id) references profile; alter table placed_order add constraint FKd83vq7n4l3pmc27abqltqq55w foreign key (seller_id) references profile; alter table product add constraint FK2oc85d5p2pu4ia3tjbx4c25w4 foreign key (profile_id) references profile; alter table product_on_order add constraint FKr0ss54m4f51wnykkd14ue3bv foreign key (order_id) references placed_order; alter table product_on_order add constraint FKdujqh9ogotyjn2u6c4bu4g778 foreign key (product_id) references product; alter table profile_picture add constraint FKe1u9y03jwhjpiebosk7hrax7d foreign key (user_id) references profile;
USE TestDb GO SELECT * FROM [dbo].['12 Jan 13$'] ORDER BY [No.] -- Delete acid information rows ALTER TABLE [dbo].['12 Jan 13$'] DROP COLUMN [F18],[F19],[F20],[F21],[F22],[F23],[F24],[F25] -- Delete rows between balance and location ALTER TABLE [dbo].['12 Jan 13$'] DROP COLUMN [F7],[F11],[F12],[F13],[F14],[F15],[F16] -- Delete All rows that do not have an ID number DELETE FROM [dbo].['12 Jan 13$'] WHERE [No.] IS NULL -- Add columns for date loaded ALTER TABLE [dbo].['12 Jan 13$'] ADD DateLoadedUZ44 date ALTER TABLE [dbo].['12 Jan 13$'] ADD DateLoadedUZ229 date ALTER TABLE [dbo].['12 Jan 13$'] ADD DateLoadedUZ226 date ALTER TABLE [dbo].['12 Jan 13$'] ADD DateLoadedVessel date --Add date to table UPDATE [dbo].['12 Jan 13$'] SET [DateLoadedUZ44] = '01-18-2013' WHERE [DateLoadedUZ44] IS NULL; UPDATE [dbo].['12 Jan 13$'] SET [DateLoadedUZ229] = '01-19-2013' WHERE [DateLoadedUZ229] IS NULL; UPDATE [dbo].['12 Jan 13$'] SET [DateLoadedUZ226] = '01-20-2013' WHERE [DateLoadedUZ226] IS NULL; UPDATE [dbo].['12 Jan 13$'] SET [DateLoadedVessel] = '01-12-2013' WHERE [DateLoadedVessel] IS NULL;
drop index if exists data_info_log_2018_idx; drop index if exists data_info_log_2019_idx; drop index if exists data_info_log_2020_idx; drop index if exists data_info_log_2021_idx; drop index if exists data_info_log_2022_idx; drop index if exists data_info_log_2023_idx; drop index if exists data_info_log_2024_idx; drop index if exists data_info_log_2025_idx; drop index if exists data_info_log_2026_idx; drop index if exists data_info_log_2027_idx; drop index if exists data_info_log_2028_idx; drop index if exists data_info_log_2029_idx; drop index if exists data_info_log_2030_idx; drop index if exists data_info_log_2031_idx; create index data_info_log_2018_idx on data_info_log_2018 using btree(insert_date desc); create index data_info_log_2019_idx on data_info_log_2019 using btree(insert_date desc); create index data_info_log_2020_idx on data_info_log_2020 using btree(insert_date desc); create index data_info_log_2021_idx on data_info_log_2021 using btree(insert_date desc); create index data_info_log_2022_idx on data_info_log_2022 using btree(insert_date desc); create index data_info_log_2023_idx on data_info_log_2023 using btree(insert_date desc); create index data_info_log_2024_idx on data_info_log_2024 using btree(insert_date desc); create index data_info_log_2025_idx on data_info_log_2025 using btree(insert_date desc); create index data_info_log_2026_idx on data_info_log_2026 using btree(insert_date desc); create index data_info_log_2027_idx on data_info_log_2027 using btree(insert_date desc); create index data_info_log_2028_idx on data_info_log_2028 using btree(insert_date desc); create index data_info_log_2029_idx on data_info_log_2029 using btree(insert_date desc); create index data_info_log_2030_idx on data_info_log_2030 using btree(insert_date desc); create index data_info_log_2031_idx on data_info_log_2031 using btree(insert_date desc);
-- Create SessionEntry CREATE TABLE ofGojaraSessions( username VARCHAR2(255) NOT NULL, transport VARCHAR2(255) NOT NULL, lastActivity NUMBER(10) NOT NULL, PRIMARY KEY (username, transport) ); CREATE INDEX ofGojara_lastActivity_idx ON ofGojaraSessions(lastActivity); -- Update database version UPDATE ofVersion SET version=1 WHERE name = 'gojara';
<gh_stars>1000+ -- Note: the INSERT query works only with cassandra 2.0.7+! -- -- Queries --=========== -- SELECT * FROM auditlog WHERE application_name = '' [AND time ...]; -- PrimaryKey: (application_name), time -- -- INSERT INTO auditlog (event_id, time, action, user_firstname, user_lastname, user_email, user_username, -- application_name, experiment_id, experiment_label, bucket_label, changed_property, -- property_before, property_after) -- VALUES (uuid(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); -- -- 'null' values for primary keys: -- application_name must not be null but will be null for actions not affecting any applications. In that case we use -- a special value instead of null: -- dGhpcyBpcyBhIG51bGwgZmllbGQ -- -- 'original' AuditLog table CREATE TABLE auditlog ( time timestamp, event_id uuid, action varchar, user_firstname varchar, user_lastname varchar, user_email varchar, user_username varchar, user_userid varchar, application_name varchar, experiment_id uuid, experiment_label varchar, bucket_label varchar, changed_property varchar, property_before varchar, property_after varchar, PRIMARY KEY ( (application_name), time, event_id ) ) WITH CLUSTERING ORDER BY ( time DESC, event_id ASC ) AND COMMENT = 'Holds AuditLogEntries partitioned by application_name.';
-- // CLOUD-67249 Introduce recoverymode for cluster -- Migration SQL that makes the change goes here. ALTER TABLE cluster ADD COLUMN recoverymode varchar(255) DEFAULT 'MANUAL'; -- //@UNDO -- SQL to undo the change goes here. ALTER TABLE cluster DROP COLUMN recoverymode;
<reponame>meobilivang/crunchy-containers<filename>examples/kube/pgbench-custom/configs/transactions95.sql /* * Copyright 2019 - 2021 Crunchy Data Solutions, Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ \set nbranches :scale \set ntellers 10 * :scale \set naccounts 100000 * :scale \setrandom aid 1 :naccounts \setrandom bid 1 :nbranches \setrandom tid 1 :ntellers \setrandom delta -5000 5000 BEGIN; UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; SELECT abalance FROM pgbench_accounts WHERE aid = :aid; UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); END;
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [Profile.Import].[PRNSWebservice.Funding.GetPersonInfoForDisambiguation] @Job varchar(55), @BatchID varchar(100) AS BEGIN SET NOCOUNT ON; CREATE TABLE #tmp (LogID INT, BatchID VARCHAR(100), RowID INT, HttpMethod VARCHAR(10), URL VARCHAR(500), PostData xml) DECLARE --@search XML, @batchcount INT, --@threshold FLOAT, @baseURI NVARCHAR(max), @orcidNodeID NVARCHAR(max), @BatchSize int, @URL varchar(500), @logLevel int, @rows int, @rowsCount int select @URL = URL, @BatchSize = batchSize, @logLevel = logLevel from [Profile.Import].[PRNSWebservice.Options] where job = @Job SELECT @baseURI = [Value] FROM [Framework.].[Parameter] WHERE [ParameterID] = 'baseURI' SELECT @orcidNodeID = NodeID from [RDF.].Node where Value = 'http://vivoweb.org/ontology/core#orcidId' SELECT personID, ROW_NUMBER() OVER (ORDER BY personID) AS rownum INTO #personIDs FROM [Profile.Data].Person p WHERE IsActive = 1 and not exists (select 1 from [Profile.Data].[Funding.DisambiguationSettings] s where s.PersonID = p.PersonID and enabled = 0) SELECT @rows = count(*) FROM #personIDs insert into #tmp(LogID, BatchID, RowID, HttpMethod, URL, PostData) select -1, @batchID batchID, n, 'POST', @URL, ( SELECT ( select p2.personid as PersonID, ISNULL(RTRIM(firstname),'') "Name/First", ISNULL(RTRIM(middlename),'') "Name/Middle", ISNULL(RTRIM(p2.lastname),'') "Name/Last", ISNULL(RTRIM(suffix),'') "Name/Suffix", d.cnt "LocalDuplicateNames", (SELECT DISTINCT ISNULL(LTRIM(ISNULL(emailaddress,p2.emailaddr)),'') Email FROM [Profile.Data].[Person.Affiliation] pa WHERE pa.personid = p2.personid FOR XML PATH(''),TYPE) AS "EmailList", (SELECT distinct Organization as Org FROM [Profile.Data].[Funding.DisambiguationOrganizationMapping] m JOIN [Profile.Data].[Person.Affiliation] pa on m.InstitutionID = pa.InstitutionID or m.InstitutionID is null where pa.PersonID = p2.PersonID FOR XML PATH(''),ROOT('OrgList'),TYPE), (SELECT PMID FROM [Profile.Data].[Publication.Person.Add] WHERE personid =p2.personid FOR XML PATH(''),ROOT('PMIDAddList'),TYPE), (SELECT PMID FROM [Profile.Data].[Publication.Person.Include] WHERE personid =p2.personid FOR XML PATH(''),ROOT('PMIDIncludeList'),TYPE), (SELECT PMID FROM [Profile.Data].[Publication.Person.Exclude] WHERE personid =p2.personid FOR XML PATH(''),ROOT('PMIDExcludeList'),TYPE), (SELECT FundingID FROM [Profile.Data].[Funding.Add] ad join [Profile.Data].[Funding.Agreement] ag on ad.FundingAgreementID = ag.FundingAgreementID and ag.Source = 'NIH' WHERE ad.PersonID = p2.PersonID FOR XML PATH(''),ROOT('GrantsAddList'),TYPE), (SELECT FundingID FROM [Profile.Data].[Funding.Add] ad join [Profile.Data].[Funding.Agreement] ag on ad.FundingAgreementID = ag.FundingAgreementID and ag.Source = 'NIH' WHERE ad.PersonID = p2.PersonID FOR XML PATH(''),ROOT('GrantsAddList'),TYPE), (SELECT FundingID FROM [Profile.Data].[Funding.Delete] WHERE Source = 'NIH' and PersonID = p2.PersonID FOR XML PATH(''),ROOT('GrantsDeleteList'),TYPE), (SELECT @baseURI + CAST(i.NodeID AS VARCHAR) FOR XML PATH(''),ROOT('URI'),TYPE), (select n.Value as '*' from [RDF.].Node n join [RDF.].Triple t on n.NodeID = t.Object and t.Subject = i.NodeID and t.Predicate = @orcidNodeID FOR XML PATH(''),ROOT('ORCID'),TYPE) FROM [Profile.Data].Person p2 LEFT JOIN ( SELECT [Utility.NLP].[fnNamePart1](firstname)F, lastname, COUNT(*)cnt FROM [Profile.Data].Person GROUP BY [Utility.NLP].[fnNamePart1](firstname), lastname )d ON d.f = [Utility.NLP].[fnNamePart1](p2.firstname) AND d.lastname = p2.lastname AND p2.IsActive = 1 LEFT JOIN [RDF.Stage].[InternalNodeMap] i ON [InternalType] = 'Person' AND [Class] = 'http://xmlns.com/foaf/0.1/Person' AND [InternalID] = CAST(p2.personid AS VARCHAR(50)) JOIN #personIDs p3 on p2.personID = p3.personID order by p3.PersonID offset n * @BatchSize ROWS FETCH NEXT @BatchSize ROWS ONLY for xml path('Person'), root('FindFunding'), type) as X ) x from [Utility.Math].N where n <= @rows / @BatchSize select @rowsCount = @@ROWCOUNT Update [Profile.Import].[PRNSWebservice.Log.Summary] set RecordsCount = @rows, RowsCount = @rowsCount where BatchID = @BatchID DECLARE @LogIDTable TABLE (LogID int, RowID int) IF @logLevel = 1 BEGIN INSERT INTO [Profile.Import].[PRNSWebservice.Log] (Job, BatchID, RowID, HttpMethod, URL) OUTPUT inserted.LogID, Inserted.RowID into @LogIDTable SELECT @job, BatchID, RowID, HttpMethod, URL FROM #tmp UPDATE t SET t.LogID = l.LogID FROM #tmp t JOIN @LogIDTable l ON t.RowID = l.RowID END ELSE IF @logLevel = 2 BEGIN INSERT INTO [Profile.Import].[PRNSWebservice.Log] (Job, BatchID, RowID, HttpMethod, URL, PostData) OUTPUT inserted.LogID, Inserted.RowID into @LogIDTable SELECT @job, BatchID, RowID, HttpMethod, URL, convert(varchar(max), PostData) FROM #tmp UPDATE t SET t.LogID = l.LogID FROM #tmp t JOIN @LogIDTable l ON t.RowID = l.RowID END Truncate table [Profile.Data].[Funding.DisambiguationResults] SELECT LogID, BatchID, RowID, HttpMethod, URL, convert(varchar(max), PostData) FROM #tmp END GO
<reponame>LuGeorgiev/SoftUniDBBasicMSSQL CREATE TABLE Deleted_Employees( EmployeeId INT PRIMARY KEY IDENTITY, FirstName VARCHAR(50) NOT NULL, LastName VARCHAR(50) NOT NULL, MiddleName VARCHAR(50) , JobTitle VARCHAR(50) NOT NULL, DepartmentId INT FOREIGN KEY REFERENCES Departments(DepartmentID), Salary DECIMAL (15,4) ) GO --P09 CREATE TRIGGER t_FiredEmpoylees ON Employees AFTER DELETE AS BEGIN INSERT INTO Deleted_Employees(FirstName, LastName, MiddleName, JobTitle, DepartmentId, Salary) SELECT FirstName,LastName,MiddleName,JobTitle,DepartmentID,Salary FROM deleted END
<reponame>Gamer-Grad/whdbx_web DROP TABLE IF EXISTS signature_oregas; CREATE TABLE signature_oregas ( sig_id INT, oregas TEXT ); -- ore sites INSERT INTO signature_oregas VALUES (49, 'ark:3,bis:3,cro:20,dar:4,gne:5,hed:10,hem:20,jas:10,ker:20,mer:0,omb:15,pla:10,pyr:1,sco:6,spo:10,vel:30'); -- Average Frontier Deposit INSERT INTO signature_oregas VALUES (50, 'ark:1,bis:1,cro:1,dar:1,gne:1,hed:1,hem:1,jas:1,ker:1,mer:0,omb:1,pla:3,pyr:2,sco:2,spo:2,vel:0'); -- Common Perimeter Deposit INSERT INTO signature_oregas VALUES (51, 'ark:4,bis:5,cro:5,dar:5,gne:6,hed:7,hem:10,jas:11,ker:12,mer:1,omb:12,pla:10,pyr:10,sco:8,spo:8,vel:11'); -- Exceptional Core Deposit INSERT INTO signature_oregas VALUES (52, 'ark:2,bis:2,cro:2,dar:4,gne:4,hed:4,hem:4,jas:4,ker:11,mer:1,omb:11,pla:12,pyr:11,sco:13,spo:4,vel:14'); -- Infrequent Core Deposit INSERT INTO signature_oregas VALUES (53, 'ark:6,bis:6,cro:6,dar:6,gne:6,hed:6,hem:6,jas:6,ker:6,mer:0,omb:6,pla:0,pyr:0,sco:0,spo:6,vel:8'); -- Isolated Core Deposit INSERT INTO signature_oregas VALUES (54, 'ark:1,bis:1,cro:1,dar:1,gne:1,hed:3,hem:3,jas:3,ker:4,mer:0,omb:5,pla:0,pyr:13,sco:7,spo:1,vel:15'); -- Ordinary Perimeter Deposit INSERT INTO signature_oregas VALUES (55, 'ark:1,bis:1,cro:1,dar:1,gne:1,hed:2,hem:3,jas:0,ker:4,mer:1,omb:3,pla:0,pyr:1,sco:0,spo:1,vel:0'); -- Rarified Core Deposit INSERT INTO signature_oregas VALUES (56, 'ark:1,bis:1,cro:1,dar:1,gne:1,hed:1,hem:1,jas:1,ker:4,mer:1,omb:3,pla:0,pyr:0,sco:1,spo:1,vel:0'); -- Unusual Core Deposit INSERT INTO signature_oregas VALUES (57, 'ark:4,bis:6,cro:2,dar:1,gne:1,hed:6,hem:9,jas:5,ker:7,mer:0,omb:5,pla:5,pyr:5,sco:0,spo:1,vel:6'); -- Uncommon Core Deposit INSERT INTO signature_oregas VALUES (58, 'ark:1,bis:1,cro:1,dar:1,gne:1,hed:1,hem:1,jas:1,ker:1,mer:0,omb:1,pla:2,pyr:0,sco:0,spo:1,vel:4'); -- Unexceptional Frontier Deposit -- gas clouds INSERT INTO signature_oregas VALUES (59, 'c50:3000,c60:1500'); -- Barren Perimeter Reservoir INSERT INTO signature_oregas VALUES (60, 'c28:5000,c32:1000'); -- Bountiful Frontier Reservoir INSERT INTO signature_oregas VALUES (61, 'c320:6000,c540:500'); -- Instrumental Core Reservoir INSERT INTO signature_oregas VALUES (62, 'c70:3000,c72:1500'); -- Minor Perimeter Reservoir INSERT INTO signature_oregas VALUES (63, 'c72:3000,c84:1500'); -- Ordinary Perimeter Reservoir INSERT INTO signature_oregas VALUES (64, 'c50:1500,c84:3000'); -- Sizeable Perimeter Reservoir INSERT INTO signature_oregas VALUES (65, 'c60:3000,c70:1500'); -- Token Perimeter Reservoir INSERT INTO signature_oregas VALUES (66, 'c28:1000,c32:5000'); -- Vast Frontier Reservoir INSERT INTO signature_oregas VALUES (67, 'c320:500,c540:6000'); -- Vital Core Reservoir
-- Erases (drops) database if in existence DROP DATABASE IF EXISTS bamazon_DB; -- Creates a new database called bamazonDB CREATE database bamazon_DB; -- Call to use the bamazonDB database USE bamazon_DB; -- creates tables called "products" that contains the inventory CREATE TABLE products ( item_id INTEGER(11) AUTO_INCREMENT NOT NULL, product_name VARCHAR(30) NOT NULL, department_name VARCHAR(20) NOT NULL, price DECIMAL(10,2) NOT NULL, stock_quantity INTEGER(11) NOT NULL, PRIMARY KEY (item_id) ); -- Data for our products table INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ('Nike Shoes', 'Shoes', 69.99, 35), ('Adidas Shoes', 'Shoes', 59.99, 45), ('Samsung Notebook', 'Electronics', 1509.99, 92), ('Tenis Raquets', 'Sports', 59.40, 95), ('Nintendo Zelda', 'Games', 39.95, 241), ('Polo RL Shirt', 'Clothing', 119.50, 100), ('Instant Pot', 'Kitchen', 99.95, 350), ('Nintendo Switch', 'Electronics', 299.00, 60), ('Tennis balls', 'Sports', 3.99, 525), ('Uno Cards', 'Games', 7.99, 100), ('Adidas Jacket', 'Clothing', 89.99, 70), ('Kitchenaide Mixer', 'Kitchen', 259.00, 210);
<reponame>Oreder/DBProjectFinal USE Airlines; GO /********************************* TABLE AIRPLANES *********************************/ IF OBJECT_ID('fnGetNumberOfSeats') IS NOT NULL DROP FUNCTION dbo.fnGetNumberOfSeats; GO CREATE FUNCTION [dbo].[fnGetNumberOfSeats](@AirplaneID int) RETURNS int BEGIN RETURN (SELECT [NumberOfSeats] FROM [dbo].[Airplanes] WHERE [dbo].[Airplanes].[AirplaneID] = @AirplaneID ) END GO /********************************* TABLE BOOKINGS *********************************/ IF OBJECT_ID('FilterBookingPassAge') IS NOT NULL DROP PROC dbo.FilterBookingPassAge; GO CREATE PROC dbo.FilterBookingPassAge(@from INT, @to INT) AS BEGIN SELECT * FROM dbo.Bookings WHERE (PassAge >= @from) AND (PassAge <= @to) ORDER BY PassAge ASC, PassName ASC END -- TESTS EXEC dbo.FilterBookingPassAge @from = 18, @to = 30 EXEC dbo.FilterBookingPassAge @from = 20, @to = 20 GO IF OBJECT_ID('FilterBookingCreateDate') IS NOT NULL DROP PROC dbo.FilterBookingCreateDate; GO CREATE PROC dbo.FilterBookingCreateDate(@from DATETIME, @to DATETIME) AS BEGIN SELECT * FROM dbo.Bookings WHERE (CreateDate >= @from) AND (CreateDate <= @to) ORDER BY CreateDate ASC, PassAge ASC, PassName ASC END -- TESTS EXEC dbo.FilterBookingCreateDate @from = '2016-03-18', @to = '2016-03-18' GO /********************************* TABLE FLIGHTS *********************************/ IF OBJECT_ID('GetAirportName') IS NOT NULL DROP FUNCTION dbo.GetAirportName; GO CREATE FUNCTION [dbo].[GetAirportName](@id INT) RETURNS NVARCHAR(60) AS BEGIN RETURN (SELECT Title FROM dbo.Airports WHERE AirportID = @id ) END GO IF OBJECT_ID('GetAirportLocation') IS NOT NULL DROP FUNCTION dbo.GetAirportLocation; GO CREATE FUNCTION [dbo].[GetAirportLocation](@id INT) RETURNS NVARCHAR(60) AS BEGIN RETURN (SELECT City FROM dbo.Airports WHERE AirportID = @id ) END GO IF OBJECT_ID('GetAirportIATA') IS NOT NULL DROP FUNCTION dbo.GetAirportIATA; GO CREATE FUNCTION [dbo].[GetAirportIATA](@id INT) RETURNS NVARCHAR(10) AS BEGIN RETURN (SELECT IATA FROM dbo.Airports WHERE AirportID = @id ) END GO IF OBJECT_ID('GetAirlineTitle') IS NOT NULL DROP FUNCTION dbo.GetAirlineTitle; GO CREATE FUNCTION [dbo].[GetAirlineTitle](@id INT) RETURNS NVARCHAR(60) AS BEGIN RETURN (SELECT Title FROM dbo.Airlines WHERE AirlineID = @id ) END GO -- TESTS SELECT dbo.GetAirportName(12) AS [Name] SELECT dbo.GetAirportLocation(2) AS [Location], dbo.GetAirportIATA(2) AS [Code] SELECT dbo.GetAirlineTitle(5) AS [Airline] GO IF OBJECT_ID('GetFullFlightInfor') IS NOT NULL DROP PROC dbo.GetFullFlightInfor; GO CREATE PROCEDURE dbo.GetFullFlightInfor AS BEGIN SELECT FlightID, dbo.GetAirlineTitle(Flights.AirlineID) AS [Airline Title], FlightNumber, dbo.GetAirportName(Flights.Origin) + ' (' + dbo.GetAirportIATA(Flights.Origin) + ')' AS [Departure], dbo.GetAirportLocation(Flights.Origin) AS [Departure Location], dbo.GetAirportName(Flights.Destination) + ' (' + dbo.GetAirportIATA(Flights.Destination) + ')' AS [Arrival], dbo.GetAirportLocation(Flights.Destination) AS [Arrival Location], DepartureTime [Departure Time (GMT)], ArrivalTime AS [Arrival Time (GMT)], ROUND((DATEDIFF(MINUTE, DepartureTime, ArrivalTime) / 60.0), 2) AS [Flight Time (hours)] FROM dbo.Flights; END GO EXEC dbo.GetFullFlightInfor; GO
USE [qichacha] GO /****** Object: Table [dbo].[QichachaCertificate] Script Date: 2016/4/19 21:57:30 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[QichachaCertificate]( [Id] [varchar](100) NOT NULL, [CertificateId] [varchar](50) NULL, [CertificateType] [varchar](50) NULL, [Applicant] [nvarchar](500) NULL, [Content] [nvarchar](max) NULL, [CreatedAt] [datetime] NULL, [UpdatedAt] [datetime] NULL, [ProcessedAt] [datetime] NULL, CONSTRAINT [PK_QichachaCertificate] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO
<gh_stars>1-10 INSERT INTO `LineItemCategories` (`Description`) VALUES ('Additional Funds From Deans Office'); INSERT INTO `LineItemCategories` (`Description`) VALUES ('Buyout Lecturer Replacement Funds'); INSERT INTO `LineItemCategories` (`Description`) VALUES ('Class Cancelled - Funds no longer needed'); INSERT INTO `LineItemCategories` (`Description`) VALUES ('TA Range Adjustment Funds'); INSERT INTO `LineItemCategories` (`Description`) VALUES ('Work-Life Balance Funds'); INSERT INTO `LineItemCategories` (`Description`) VALUES ('Other Funds');
CREATE ROLE fa WITH PASSWORD '<PASSWORD>'; ALTER ROLE fa WITH LOGIN; ALTER ROLE fa WITH SUPERUSER; CREATE DATABASE fullaux; ALTER DATABASE fullaux owner to fa; GRANT ALL PRIVILEGES ON SCHEMA public TO fa;
/* Warnings: - Added the required column `avatar_url` to the `users` table without a default value. This is not possible if the table is not empty. */ -- AlterTable ALTER TABLE "users" ADD COLUMN "avatar_url" TEXT NOT NULL; -- AddForeignKey ALTER TABLE "posts" ADD FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;