sql
stringlengths 6
1.05M
|
|---|
<filename>src/test/resources/fts3aa.test_12.sql
-- fts3aa.test
--
-- execsql {SELECT rowid FROM t1 WHERE content MATCH ' ONE Two three '}
SELECT rowid FROM t1 WHERE content MATCH ' ONE Two three '
|
<gh_stars>10-100
-- Add ContractCode to SIT Origin/Destination Additional Days (DOASIT/DDASIT)
INSERT INTO service_params(id, service_id, service_item_param_key_id, created_at, updated_at)
VALUES ('8d2e4d5b-69da-4f9a-b8a9-82b7234f6a76', (SELECT id from re_services WHERE code = 'DOASIT'),
(SELECT id FROM service_item_param_keys WHERE key = 'ContractCode'), now(), now()),
('87750084-dab2-4578-b48e-78c875e0c06c', (SELECT id from re_services WHERE code = 'DDASIT'),
(SELECT id FROM service_item_param_keys WHERE key = 'ContractCode'), now(), now());
|
<reponame>JuanPablooo/dryve<gh_stars>1-10
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE brand (
id uuid DEFAULT uuid_generate_v4 () UNIQUE,
name VARCHAR (255) NOT NULL UNIQUE,
PRIMARY KEY (id)
);
CREATE TABLE model (
id uuid DEFAULT uuid_generate_v4 () UNIQUE,
name VARCHAR (255) NOT NULL,
brand_id uuid NOT NULL,
CONSTRAINT brand_to_model_fk
FOREIGN KEY (brand_id)
REFERENCES brand(id),
PRIMARY KEY (id)
);
CREATE TABLE model_year (
id uuid DEFAULT uuid_generate_v4 () UNIQUE,
model_id uuid NOT NULL,
year INT NOT NULL,
kbb_id INT NOT NULL,
CONSTRAINT model_to_model_year_fk
FOREIGN KEY (model_id)
REFERENCES model(id),
PRIMARY KEY (id)
);
CREATE TABLE vehicle (
id uuid DEFAULT uuid_generate_v4 () UNIQUE,
ad_price NUMERIC (19, 2),
kbb_price NUMERIC (19, 2),
license_plate VARCHAR (50) UNIQUE,
model_year_id uuid NOT NULL,
CONSTRAINT model_year_to_vehicle_fk
FOREIGN KEY (model_year_id)
REFERENCES model_year(id),
PRIMARY KEY (id)
);
|
<reponame>emacslisp/IonicExample
CREATE TABLE IF NOT EXISTS 'User' (
'UserId' INTEGER NOT NULL,
'UserName' TEXT,
'Password' TEXT NOT NULL,
'Status' TEXT NOT NULL,
PRIMARY KEY(UserId)
);
|
with performance as (
select * from {{ref('outbrain_campaign_performance')}}
),
campaigns as (
select * from {{ref('outbrain_campaigns')}}
),
joined as (
select
performance.*,
campaigns.utm_medium,
campaigns.utm_source,
campaigns.utm_campaign,
campaigns.utm_content,
campaigns.utm_term
from performance
inner join campaigns on performance.campaign_id = campaigns.id
)
select * from joined
|
<gh_stars>1-10
-- Verify ggircs-portal:computer_columns/form_result_requested_change_comments on pg
begin;
select pg_get_functiondef('ggircs_portal.form_result_requested_change_comments(ggircs_portal.form_result)'::regprocedure);
rollback;
|
/*
Copyright 2020-2021 Snowplow Analytics Ltd. All rights reserved.
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.
*/
DROP TABLE IF EXISTS {{.scratch_schema}}.pv_addon_yauaa{{.entropy}};
CREATE TABLE IF NOT EXISTS {{.scratch_schema}}.pv_addon_yauaa{{.entropy}} (
page_view_id CHAR(36),
device_class VARCHAR,
agent_class VARCHAR,
agent_name VARCHAR,
agent_name_version VARCHAR,
agent_name_version_major VARCHAR,
agent_version VARCHAR,
agent_version_major VARCHAR,
device_brand VARCHAR,
device_name VARCHAR,
device_version VARCHAR,
layout_engine_class VARCHAR,
layout_engine_name VARCHAR,
layout_engine_name_version VARCHAR,
layout_engine_name_version_major VARCHAR,
layout_engine_version VARCHAR,
layout_engine_version_major VARCHAR,
operating_system_class VARCHAR,
operating_system_name VARCHAR,
operating_system_name_version VARCHAR,
operating_system_version VARCHAR
)
DISTSTYLE KEY
DISTKEY (page_view_id)
SORTKEY (page_view_id);
{{if eq .yauaa true}}
INSERT INTO {{.scratch_schema}}.pv_addon_yauaa{{.entropy}} (
SELECT
pv.page_view_id,
ya.device_class,
ya.agent_class,
ya.agent_name,
ya.agent_name_version,
ya.agent_name_version_major,
ya.agent_version,
ya.agent_version_major,
ya.device_brand,
ya.device_name,
ya.device_version,
ya.layout_engine_class,
ya.layout_engine_name,
ya.layout_engine_name_version,
ya.layout_engine_name_version_major,
ya.layout_engine_version,
ya.layout_engine_version_major,
ya.operating_system_class,
ya.operating_system_name,
ya.operating_system_name_version,
ya.operating_system_version
FROM {{.input_schema}}.nl_basjes_yauaa_context_1 ya
INNER JOIN {{.scratch_schema}}.pv_page_view_events{{.entropy}} pv
ON ya.root_id = pv.event_id
AND ya.root_tstamp = pv.collector_tstamp
WHERE ya.root_tstamp >= (SELECT lower_limit FROM {{.scratch_schema}}.pv_run_limits{{.entropy}})
AND ya.root_tstamp <= (SELECT upper_limit FROM {{.scratch_schema}}.pv_run_limits{{.entropy}})
);
{{end}}
|
startcode PostgreSql_OutboxSetAsDispatchedSql
update "public"."EndpointNameOutboxData"
set
"Dispatched" = true,
"DispatchedAt" = @DispatchedAt,
"Operations" = '[]'
where "MessageId" = @MessageId
endcode
|
<reponame>Tiamat-Tech/sourcegraph<filename>migrations/frontend/1528395860_remove_repo_table_policy.up.sql
BEGIN;
-- This removes the row-level security policy (if present), and disables RLS on
-- the repo table. Both operations are idempotent.
DROP POLICY IF EXISTS sg_repo_access_policy ON repo;
ALTER TABLE repo DISABLE ROW LEVEL SECURITY;
COMMIT;
|
<reponame>bclennox/pg_partman
-- ########## NATIVE TIME WEEKLY EPOCH TESTS ##########
-- Other tests: combination of start_partition & constraint_cols/optimize_constraint. Requires manually running apply_constraint to set other old partitions
-- No need to test optimize trigger with native
-- Leaving pk/fk test out of this one so it can be used to test the native support in 11+
\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP true
BEGIN;
SELECT set_config('search_path','partman, public',false);
SELECT plan(54);
CREATE SCHEMA partman_test;
CREATE SCHEMA partman_retention_test;
-- Add back when primary key is supported in native partitioning
--CREATE TABLE partman_test.time_taptest_table (col1 int primary key, col2 text, col3 int NOT NULL DEFAULT extract('epoch' from CURRENT_TIMESTAMP)::int);
CREATE TABLE partman_test.time_taptest_table (
col1 int,
col2 text,
col3 int NOT NULL DEFAULT extract('epoch' from CURRENT_TIMESTAMP)::int)
PARTITION BY RANGE (col3);
CREATE TABLE partman_test.undo_taptest (LIKE partman_test.time_taptest_table INCLUDING ALL);
SELECT create_parent('partman_test.time_taptest_table', 'col3', 'native', 'weekly', '{"col1"}', p_epoch := 'seconds'
, p_premake := 2, p_start_partition := to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'YYYY-MM-DD HH24:MI:SS'));
SELECT has_partition('partman_test', 'time_taptest_table', 'Check that time_taptest_table is natively partitioned');
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(1,10), extract('epoch' from CURRENT_TIMESTAMP - '8 weeks'::interval)::int);
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP, 'IYYY"w"IW'), 'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP, 'IYYY"w"IW')||' exists');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW')||' exists (+1 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'2 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'2 weeks'::interval, 'IYYY"w"IW')||' exists (+2 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'5 weeks'::interval, 'IYYY"w"IW')||' does not exist (+3 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW')||' exists (-1 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW')||' exists (-2 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW')||' exists (-3 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW')||' exists (-4 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW')||' exists (-5 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW')||' exists (-6 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW')||' exists (-7 weeks)');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW')||' exists (-8 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'9 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'9 weeks'::interval, 'IYYY"w"IW')||' does not exist (-9 weeks)');
-- Add back when index support is available
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP, 'IYYY"w"IW'));
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW')||' (+1 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'2 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'2 weeks'::interval, 'IYYY"w"IW')||' (+2 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW')||' (-1 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW')||' (-2 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW')||' (-3 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW')||' (-4 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW')||' (-5 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW')||' (-6 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW')||' (-7 weeks)');
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW')||' (-8 weeks)');
-- END pk check
SELECT is_empty('SELECT * FROM ONLY partman_test.time_taptest_table', 'Check that parent table has had data moved to partition');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table', ARRAY[10], 'Check count from parent table');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP - '8 weeks'::interval, 'IYYY"w"IW'),
ARRAY[10], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW')||' (-8 weeks)');
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(11,20), extract('epoch' from CURRENT_TIMESTAMP - '7 weeks'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(21,25), extract('epoch' from CURRENT_TIMESTAMP - '6 weeks'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(26,30), extract('epoch' from CURRENT_TIMESTAMP - '5 weeks'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(31,37), extract('epoch' from CURRENT_TIMESTAMP - '4 week'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(38,49), extract('epoch' from CURRENT_TIMESTAMP - '3 week'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(50,70), extract('epoch' from CURRENT_TIMESTAMP - '2 weeks'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(71,85), extract('epoch' from CURRENT_TIMESTAMP - '1 week'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(86,100), extract('epoch' from CURRENT_TIMESTAMP + '1 week'::interval)::int);
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(101,110), extract('epoch' from CURRENT_TIMESTAMP + '2 weeks'::interval)::int);
SELECT is_empty('SELECT * FROM ONLY partman_test.time_taptest_table', 'Check that parent table has had no data inserted to it');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW'),
ARRAY[10], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW')||' (-7 weeks)');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW'),
ARRAY[5], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW')||' (-6 weeks)');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW'),
ARRAY[5], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW')||' (-5 weeks)');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW'),
ARRAY[7], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW')||' (-4 weeks)');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW'),
ARRAY[12], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW')||' (-3 weeks)');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW'),
ARRAY[21], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW')||' (-2 weeks)');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW'),
ARRAY[15], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW')||' (-1 weeks)');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW'),
ARRAY[15], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW')||' (+1 weeks)');
-- Default optimize_constraint is 30, so set it to a value that will trigger it to work for given conditions of this partition set
-- Set optimize_trigger higher than premake to ensure this works as intended
UPDATE part_config SET premake = 3, optimize_constraint = 5, optimize_trigger = 8 WHERE parent_table = 'partman_test.time_taptest_table';
SELECT run_maintenance();
-- Automatic run of apply_constraints due to run_maintenance will put constraint on "now() - 4 weeks" partition with an optimize_constraint value of 5
-- This is due to values "now() + 2 weeks" being inserted above.
-- Ex: Current week is 39. +2 weeks is 41. Going back 5 weeks is 36, but constraint is applied to the table OLDER than that value. Hence constraint will be on week 35
SELECT col_has_check('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW'), 'col1'
, 'Check for additional constraint on col1 on time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW')||' (-4 weeks)');
-- Must run apply_constraints() to manually set the other older constraints
SELECT apply_constraints('partman_test.time_taptest_table', 'partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW'));
SELECT apply_constraints('partman_test.time_taptest_table', 'partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW'));
SELECT apply_constraints('partman_test.time_taptest_table', 'partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW'));
SELECT apply_constraints('partman_test.time_taptest_table', 'partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW'));
SELECT col_has_check('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW'), 'col1'
, 'Check for additional constraint on col1 on time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW'));
SELECT col_has_check('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW'), 'col1'
, 'Check for additional constraint on col1 on time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW'));
SELECT col_has_check('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW'), 'col1'
, 'Check for additional constraint on col1 on time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW'));
SELECT col_has_check('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW'), 'col1'
, 'Check for additional constraint on col1 on time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW'));
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(111,120), extract('epoch' from CURRENT_TIMESTAMP + '3 weeks'::interval)::int);
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW')||' exists (+3 weeks');
-- Cannot test for next week not existing. Different lengths of months will sometimes cause an extra partition.
-- Add back when index support is available
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW')||' (+3 weeks)');
SELECT is_empty('SELECT * FROM ONLY partman_test.time_taptest_table', 'Check that parent table has had no data inserted to it');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW'),
ARRAY[10], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW')||' (+3 weeks)');
UPDATE part_config SET premake = 4 WHERE parent_table = 'partman_test.time_taptest_table';
SELECT run_maintenance();
INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(121,130), extract('epoch' from CURRENT_TIMESTAMP + '4 weeks'::interval)::int);
SELECT is_empty('SELECT * FROM ONLY partman_test.time_taptest_table', 'Check that parent table has had no data inserted to it');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table', ARRAY[130], 'Check count from parent table');
SELECT results_eq('SELECT count(*)::int FROM partman_test.time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW'),
ARRAY[10], 'Check count from time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW')||' (+4 weeks)');
SELECT col_has_check('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW'), 'col1'
, 'Check for additional constraint on col1 on time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW'));
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW')||' exists (+4 weeks)');
-- Cannot test for next week not existing. Different lengths of months will sometimes cause an extra partition.
-- Add back when index support is available
--SELECT col_is_pk('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW'), ARRAY['col1'],
-- 'Check for primary key in time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW')||' (+4 weeks)');
-- Add back when default partition is supported
--INSERT INTO partman_test.time_taptest_table (col1, col3) VALUES (generate_series(200,210), extract('epoch' from CURRENT_TIMESTAMP + '20 weeks'::interval)::int);
--SELECT results_eq('SELECT count(*)::int FROM ONLY partman_test.time_taptest_table', ARRAY[11], 'Check that data outside trigger scope goes to parent');
SELECT drop_partition_time('partman_test.time_taptest_table', '3 weeks', p_keep_table := false);
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'4 weeks'::interval, 'IYYY"w"IW')||' does not exist (-4 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'5 weeks'::interval, 'IYYY"w"IW')||' does not exist (-5 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'6 weeks'::interval, 'IYYY"w"IW')||' does not exist (-6 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'7 weeks'::interval, 'IYYY"w"IW')||' does not exist (-7 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'8 weeks'::interval, 'IYYY"w"IW')||' does not exist (-8 weeks)');
UPDATE part_config SET retention = '2 weeks'::interval WHERE parent_table = 'partman_test.time_taptest_table';
SELECT drop_partition_time('partman_test.time_taptest_table', p_retention_schema := 'partman_retention_test');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW')||' does not exist (-3 weeks)');
SELECT has_table('partman_retention_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'3 weeks'::interval, 'IYYY"w"IW')||' got moved to new schema (-3 weeks)');
SELECT undo_partition_native('partman_test.time_taptest_table', 'partman_test.undo_taptest', 20, p_keep_table := false);
SELECT results_eq('SELECT count(*)::int FROM ONLY partman_test.undo_taptest', ARRAY[81], 'Check count from target table after undo');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP, 'IYYY"w"IW')||' does not exist (now)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'1 week'::interval, 'IYYY"w"IW')||' does not exist (+1 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'2 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'2 weeks'::interval, 'IYYY"w"IW')||' does not exist (+2 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'3 weeks'::interval, 'IYYY"w"IW')||' does not exist (+3 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP+'4 weeks'::interval, 'IYYY"w"IW')||' does not exist (+4 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'1 week'::interval, 'IYYY"w"IW')||' does not exist (-1 weeks)');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW'),
'Check time_taptest_table_'||to_char(CURRENT_TIMESTAMP-'2 weeks'::interval, 'IYYY"w"IW')||' does not exist (-2 weeks)');
SELECT * FROM finish();
ROLLBACK;
|
use leilao_md;
/*delete from t011;
delete from t010;
delete from t009;
delete from t008;
delete from t007;
*/
delete from t005;
delete from t004;
delete from t003;
delete from t002;
delete from t001;
|
<reponame>atalman/test-infra<gh_stars>0
with c as (
SELECT
*
from
"GitHub-Actions".classification c
where
c.captures = :captures
AND c._event_time > (CURRENT_TIMESTAMP() - INTERVAL 14 day)
ORDER BY
c._event_time DESC
)
SELECT
job._event_time as time,
w.name as workflowName,
job.name as jobName,
CONCAT(w.name, ' / ', job.name) as name,
w.head_commit.id as sha,
job.id as id,
CASE
when job.conclusion is NULL then 'pending'
else job.conclusion
END as conclusion,
job.html_url as htmlUrl,
CONCAT(
'https://ossci-raw-job-status.s3.amazonaws.com/log/',
CAST(job.id as string)
) as logUrl,
DATE_DIFF(
'SECOND',
PARSE_TIMESTAMP_ISO8601(job.started_at),
PARSE_TIMESTAMP_ISO8601(job.completed_at)
) as durationS,
c.line as failureLine,
c.line_num as failureLineNumber,
c.context as failureContext,
c.captures AS failureCaptures,
from
workflow_run w
INNER JOIN (
workflow_job job
INNER JOIN c on job.id = c.job_id
) ON w.id = job.run_id
where
c.captures = :captures
ORDER BY
c._event_time DESC
|
<reponame>amankapoor/pkgsite
-- Copyright 2021 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
DROP INDEX package_symbols_package_path_id_module_path_id_symbol_name_id_s;
CREATE UNIQUE INDEX package_symbols_package_path_id_module_path_id_symbol_name_id_parent_symbol_name_id_synopsis_key
ON package_symbols(
package_path_id,
module_path_id,
symbol_name_id,
parent_symbol_name_id,
uuid_generate_v5(uuid_nil(),
synopsis));
END;
|
-- @testpoint:opengauss关键字Inline(非保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists explain_test cascade;
--关键字不带引号-合理报错
create table explain_test(id int,name Inline);
--关键字带双引号-合理报错
create table explain_test(id int,name "Inline");
--关键字带单引号-合理报错
create table explain_test(id int,name 'Inline');
--关键字带反引号-合理报错
create table explain_test(id int,name `Inline`);
|
-- migrate:up
create table if not exists users (
id serial not null
constraint users_pkey
primary key,
username varchar(64) unique,
password varchar(255)
);
create table if not exists instruments (
id serial not null
constraint instruments_pkey
primary key,
tiker varchar(8) unique,
type varchar(255)
);
create table if not exists trading_logs
(
id serial not null
constraint trading_logs_pkey
primary key,
datetime timestamptz not null default now(),
tiker varchar(8),
type varchar(16),
is_open boolean default true not null,
price decimal not null,
count integer not null,
lot integer not null,
amount decimal not null,
commission decimal not null,
commission_amount decimal not null
);
create index if not exists trading_logs_datetime_idx on trading_logs(datetime);
create table if not exists commissions (
id serial not null
constraint commissions_pkey
primary key,
value decimal not null,
type varchar(32)
);
INSERT INTO commissions (value, type)
VALUES (0.9, 'fixPrice'),
(0.3, 'percent');
-- migrate:down
|
<gh_stars>0
ALTER TABLE census_zipcodes
ADD COLUMN race_asian_estimate numeric,
ADD COLUMN race_asian_estimate_moe numeric,
ADD COLUMN race_asian_pct numeric,
ADD COLUMN race_asian_pct_moe numeric,
ADD COLUMN race_aian_estimate numeric,
ADD COLUMN race_aian_estimate_moe numeric,
ADD COLUMN race_aian_pct numeric,
ADD COLUMN race_aian_pct_moe numeric,
ADD COLUMN race_black_estimate numeric,
ADD COLUMN race_black_estimate_moe numeric,
ADD COLUMN race_black_pct numeric,
ADD COLUMN race_black_pct_moe numeric,
ADD COLUMN race_hispanic_estimate numeric,
ADD COLUMN race_hispanic_estimate_moe numeric,
ADD COLUMN race_hispanic_pct numeric,
ADD COLUMN race_hispanic_pct_moe numeric,
ADD COLUMN race_nhpi_estimate numeric,
ADD COLUMN race_nhpi_estimate_moe numeric,
ADD COLUMN race_nhpi_pct numeric,
ADD COLUMN race_nhpi_pct_moe numeric,
ADD COLUMN race_white_estimate numeric,
ADD COLUMN race_white_estimate_moe numeric,
ADD COLUMN race_white_pct numeric,
ADD COLUMN race_white_pct_moe numeric,
ADD COLUMN race_other_estimate numeric,
ADD COLUMN race_other_estimate_moe numeric,
ADD COLUMN race_other_pct numeric,
ADD COLUMN race_other_pct_moe numeric,
ADD COLUMN population_total_estimate numeric,
ADD COLUMN population_total_estimate_moe numeric,
ADD COLUMN population_total_pct numeric,
ADD COLUMN population_total_pct_moe numeric
;
|
SELECT
p.id,
p.pkey AS 'Project Key',
p.pname AS 'Project Name',
MAX(i.updated) AS 'Latest activity',
COUNT(*) AS 'Number of Issues'
FROM
jiraissue AS i,
project AS p
WHERE
i.project = p.id
GROUP BY p.id
HAVING MAX(i.updated) < '2013-01-01 00:00:00'
ORDER BY MAX(i.updated);
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 08, 2022 at 09:11 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.3.30
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: `paypark`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`adminId` int(11) NOT NULL,
`adminusername` varchar(20) NOT NULL,
`adminpassword` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`adminId`, `adminusername`, `adminpassword`) VALUES
(1, 'admin', '<PASSWORD>');
-- --------------------------------------------------------
--
-- Table structure for table `reservation`
--
CREATE TABLE `reservation` (
`reserveId` int(11) NOT NULL,
`reserveDate` date NOT NULL,
`reservePark` varchar(255) NOT NULL,
`reserveEnd` varchar(255) NOT NULL,
`reserveVehicle` varchar(255) NOT NULL,
`reserveLocation` varchar(255) NOT NULL,
`reserveUser` varchar(255) NOT NULL,
`reserveStatus` enum('Open','Closed') NOT NULL DEFAULT 'Open'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`user_status` varchar(10) NOT NULL DEFAULT 'Active',
`user_id` int(11) NOT NULL,
`user_firstname` varchar(255) NOT NULL,
`user_lastname` varchar(255) NOT NULL,
`user_email` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`user_pwd` varchar(255) NOT NULL,
`user_pwdrepeat` varchar(255) NOT NULL,
`user_address` varchar(255) NOT NULL,
`user_cpnumber` varchar(255) NOT NULL,
`user_gender` enum('Male','Female') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `uservehicle`
--
CREATE TABLE `uservehicle` (
`vehicle_id` int(11) NOT NULL,
`vehicle_type` varchar(255) NOT NULL,
`vehicle_model` varchar(255) NOT NULL,
`plate_no` varchar(255) NOT NULL,
`user_account` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`adminId`);
--
-- Indexes for table `reservation`
--
ALTER TABLE `reservation`
ADD PRIMARY KEY (`reserveId`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`user_id`);
--
-- Indexes for table `uservehicle`
--
ALTER TABLE `uservehicle`
ADD PRIMARY KEY (`vehicle_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `adminId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `reservation`
--
ALTER TABLE `reservation`
MODIFY `reserveId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `uservehicle`
--
ALTER TABLE `uservehicle`
MODIFY `vehicle_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 */;
|
INSERT INTO burgers (burger_name)
VALUES ("Flamethrower"), ("Brekkie Burg"), ("Cheeseburg"), ("ChikkiNuggi");
|
<reponame>kreako/soklaki
DROP table "public"."eval_observation_template_competency";
|
<filename>boost/install.sql
-- @author <NAME> <<EMAIL>>
-- @version $Id$
CREATE TABLE rss_channel (
id INT NOT NULL default 0,
module varchar(40) NOT NULL,
title varchar(100) NOT NULL,
description text NULL,
pub_date int NOT NULL default 0,
ttl smallint NOT NULL default 0,
image_id int NOT NULL default 0,
active smallint NOT NULL default 1,
PRIMARY KEY ( id )
);
CREATE TABLE rss_feeds (
id int NOT NULL default 0,
title varchar(100) NOT NULL,
address varchar(255) NOT NULL,
display smallint NOT NULL default 0,
refresh_time smallint NOT NULL default 0,
item_limit smallint NOT NULL default 0,
PRIMARY KEY (id)
);
|
CREATE TABLE [dbo].[Project] (
[ProjectID] INT IDENTITY (1, 1) NOT NULL,
[VehicleID] INT NOT NULL,
[Name] NVARCHAR (MAX) NULL,
[Description] NVARCHAR (MAX) NULL,
[UserCategoryID] INT NULL,
[TargetCost] DECIMAL (10, 2) NULL,
[ActualCost] DECIMAL (10, 2) NULL,
[StartDate] DATETIME2 (7) NULL,
[TargetEndDate] DATETIME2 (7) NULL,
[ActualEndDate] DATETIME2 (7) NULL,
[IsPublic] BIT NOT NULL,
[IsCostPublic] BIT NOT NULL,
[IsDeleted] BIT NOT NULL,
[ParentProjectID] INT NULL,
[ProjectStatusID] INT DEFAULT ((1)) NOT NULL,
[InstallationNotes] NVARCHAR (MAX) NULL,
[LastUpdate] DATETIME2 (7) DEFAULT (getdate()) NOT NULL,
CONSTRAINT [PK_Project] PRIMARY KEY CLUSTERED ([ProjectID] ASC),
CONSTRAINT [FK_Project_Project_ParentProjectID] FOREIGN KEY ([ParentProjectID]) REFERENCES [dbo].[Project] ([ProjectID]),
CONSTRAINT [FK_Project_ProjectStatus_ProjectStatusID] FOREIGN KEY ([ProjectStatusID]) REFERENCES [dbo].[ProjectStatus] ([ProjectStatusID]) ON DELETE CASCADE,
CONSTRAINT [FK_Project_UserCategory_UserCategoryID] FOREIGN KEY ([UserCategoryID]) REFERENCES [dbo].[UserCategory] ([UserCategoryID]),
CONSTRAINT [FK_Project_Vehicle_VehicleID] FOREIGN KEY ([VehicleID]) REFERENCES [dbo].[Vehicle] ([VehicleID]) ON DELETE CASCADE
);
GO
CREATE NONCLUSTERED INDEX [IX_Project_ProjectStatusID]
ON [dbo].[Project]([ProjectStatusID] ASC);
GO
CREATE NONCLUSTERED INDEX [IX_Project_ParentProjectID]
ON [dbo].[Project]([ParentProjectID] ASC);
GO
CREATE NONCLUSTERED INDEX [IX_Project_VehicleID]
ON [dbo].[Project]([VehicleID] ASC);
GO
CREATE NONCLUSTERED INDEX [IX_Project_UserCategoryID]
ON [dbo].[Project]([UserCategoryID] ASC);
|
<gh_stars>0
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE `chop_list_db`.`credentials_table`;
TRUNCATE `chop_list_db`.`lists2users_table`;
TRUNCATE `chop_list_db`.`lists_table`;
TRUNCATE `chop_list_db`.`categories_table`;
TRUNCATE `chop_list_db`.`items_table`;
SET FOREIGN_KEY_CHECKS = 1;
/* <NAME> */
INSERT INTO `chop_list_db`.`users_table` (`first_name`, `last_name`, `email`, `status`) VALUES ('John', 'Doe', '<EMAIL>', 'active');
INSERT INTO `chop_list_db`.`credentials_table` (`primary`, `type`, `username`, `password`, `user_id`) VALUES (TRUE, 'USER/PASSWORD', '<PASSWORD>', '12345678', '1');
INSERT INTO `chop_list_db`.`lists_table` (`name`) VALUES ('Mercadona');
INSERT INTO `chop_list_db`.`lists_table` (`name`) VALUES ('Vacaciones');
INSERT INTO `chop_list_db`.`lists2users_table` (`role`, `user_id`, `list_id`) VALUES ('owner', 1, 1);
INSERT INTO `chop_list_db`.`lists2users_table` (`role`, `user_id`, `list_id`) VALUES ('owner', 1, 2);
INSERT INTO `chop_list_db`.`categories_table` (`name`, `list_id`) VALUES
('Carniceria', '1'),
('Polleria', '1'),
('Limpieza', '1'),
('Desayuno', '1'),
('Fruta y Verdura', '1'),
('Higiene personal', '1'),
('Bebidas', '1');
INSERT INTO `chop_list_db`.`items_table` (`name`, `category_id`) VALUES
('Lomo adobado', '1'),
('Chuletas de cordero', '1'),
('Entrecot', '1'),
('Filete ternera', '1'),
('Redondo de ternera', '1'),
('Filetes de pechuga de pollo', '2'),
('Fregasuelos', '3'),
('Fregona', '3'),
('Quitagrasas', '3'),
('Leche', '4'),
('Galletas','4'),
('Manzanas', '5'),
('Naranjas', '5'),
('Puerros', '5'),
('Tomates', '5'),
('Champú', '6');
INSERT INTO `chop_list_db`.`users_table` (`first_name`, `last_name`, `email`, `status`) VALUES ('Jane', 'Fonda', '<EMAIL>', 'active');
INSERT INTO `chop_list_db`.`lists2users_table` (`role`, `user_id`, `list_id`) VALUES ('invitee', 2, 1);
INSERT INTO `chop_list_db`.`credentials_table` (`primary`, `type`, `username`, `password`, `user_id`) VALUES (TRUE, 'USER/PASSWORD', '<PASSWORD>', '<PASSWORD>', '2');
INSERT INTO `chop_list_db`.`users_table` (`first_name`, `last_name`, `email`, `status`) VALUES ('Alan', 'Parsons', '<EMAIL>', 'active');
INSERT INTO `chop_list_db`.`credentials_table` (`primary`, `type`, `username`, `password`, `user_id`) VALUES (TRUE, 'USER/PASSWORD', '<PASSWORD>', '<PASSWORD>', '3');
INSERT INTO `chop_list_db`.`users_table` (`first_name`, `last_name`, `email`, `status`) VALUES ('Michael', 'Moore', '<EMAIL>','registered');
INSERT INTO `chop_list_db`.`credentials_table` (`primary`, `type`, `username`, `password`, `user_id`) VALUES (TRUE, 'USER/PASSWORD', '<PASSWORD>', '12345678', '4');
|
<filename>lnbits/data/schema.sql
CREATE TABLE IF NOT EXISTS accounts (
id TEXT PRIMARY KEY,
email TEXT,
pass TEXT
);
CREATE TABLE IF NOT EXISTS extensions (
user TEXT NOT NULL,
extension TEXT NOT NULL,
active BOOLEAN DEFAULT 0,
UNIQUE (user, extension)
);
CREATE TABLE IF NOT EXISTS wallets (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
user TEXT NOT NULL,
adminkey TEXT NOT NULL,
inkey TEXT
);
CREATE TABLE IF NOT EXISTS apipayments (
payhash TEXT NOT NULL,
amount INTEGER NOT NULL,
fee INTEGER NOT NULL DEFAULT 0,
wallet TEXT NOT NULL,
pending BOOLEAN NOT NULL,
memo TEXT,
time TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now')),
UNIQUE (wallet, payhash)
);
CREATE VIEW IF NOT EXISTS balances AS
SELECT wallet, COALESCE(SUM(s), 0) AS balance FROM (
SELECT wallet, SUM(amount) AS s -- incoming
FROM apipayments
WHERE amount > 0 AND pending = 0 -- don't sum pending
GROUP BY wallet
UNION ALL
SELECT wallet, SUM(amount + fee) AS s -- outgoing, sum fees
FROM apipayments
WHERE amount < 0 -- do sum pending
GROUP BY wallet
)
GROUP BY wallet;
|
<gh_stars>1-10
DROP FUNCTION IF EXISTS spatiotemporal_filter_all(text[],character varying, character varying,
timestamp, timestamp, real, real, real, real, text);
CREATE OR REPLACE FUNCTION spatiotemporal_filter_all(tnames text[],
t_pred character varying,
s_pred character varying,
tstart timestamp,
tend timestamp,
xmin real,
ymin real,
xmax real,
ymax real,
order_by_col text
)
RETURNS TABLE(kb_archivid text, col timestamp without time zone) AS
$BODY$
DECLARE
tname TEXT;
st_query TEXT;
BEGIN
--Usage example: -- select spatiotemporal_filter_all(ARRAY['ar_spt', 'ch_spt']::TEXT[], 'GreaterThan', 'Intersects', '2015-12-01 21:36:23', '2015-12-03 01:36:23', 10, 10, 300, 300, 'event_starttime);
--Allowed temporal predicates are following:
--'Equals', 'LessThan', 'GreaterThan', 'Contains', 'ContainedBy',
--'Overlaps', 'Precedes', 'PrecededBy'
--Allowed spatial predicates are following:
--'Intersects', 'Disjoint', 'Within', 'CoveredBy', 'Covers',
--'Overlaps', 'Contains', 'Disjoint', 'Equals', 'Touches'
FOREACH tname IN ARRAY tnames
LOOP
st_query = 'select * from spatiotemporal_filter_order( ''' || tname ||''', ''' || t_pred ||''', ''' || s_pred || ''', '''|| tstart||''', '''|| tend|| ''', ' || xmin|| ', '|| ymin ||', ' || xmax || ', ' ||ymax || ', ''' ||order_by_col ||''')';
RAISE NOTICE '%', tname;
RAISE NOTICE '%', st_query;
RETURN QUERY EXECUTE st_query; --returns multiple times from different tables
END LOOP;
END;
$BODY$
LANGUAGE plpgsql;
|
select round(long_w,4) from station where lat_n =(select min(lat_n) from station where lat_n>38.7780 );
|
<filename>migrations/0001_create_users.up.sql
CREATE TABLE users (
user_id integer unique primary key,
name varchar(40),
email varchar(40)
);
|
<filename>src/main/resources/db/postgresql/V1_41__UPDATE_PROFILE_TABLE_ADD_SUMMARY_DEADLINES_ENBLED.sql<gh_stars>1-10
ALTER TABLE profile
ADD COLUMN summary_deadlines_enabled BOOLEAN NOT NULL DEFAULT TRUE;
|
-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 09, 2013 at 10:47 AM
-- Server version: 5.5.32
-- PHP Version: 5.4.19
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: `p`
--
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
CREATE TABLE IF NOT EXISTS `comments` (
`comment_id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`comment_date` varchar(10) COLLATE utf8_persian_ci NOT NULL,
`comment_text` varchar(5000) COLLATE utf8_persian_ci NOT NULL,
PRIMARY KEY (`comment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci AUTO_INCREMENT=1 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- enc2.test
--
-- db eval {PRAGMA encoding=UTF8}
PRAGMA encoding=UTF8
|
<filename>src/test/resources/io.test_13.sql
-- io.test
--
-- execsql { INSERT INTO abc VALUES(3, 4) }
INSERT INTO abc VALUES(3, 4)
|
<gh_stars>10-100
-- SQL Server 2016 SP2 Diagnostic Information Queries
-- <NAME>
-- Last Modified: September 1, 2020
-- Last Modified: September 13, 2020
-- https://glennsqlperformance.com/
-- https://sqlserverperformance.wordpress.com/
-- YouTube: https://bit.ly/2PkoAM1
-- Twitter: GlennAlanBerry
-- Diagnostic Queries are available here
-- https://glennsqlperformance.com/resources/
-- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server
-- If you like PowerShell, there is a very useful community solution for running these queries in an automated fashion
-- https://dbatools.io/
-- Invoke-DbaDiagnosticQuery
-- https://dbatools.io/functions/invoke-dbadiagnosticquery/
--******************************************************************************
--* Copyright (C) 2020 <NAME>
--* All rights reserved.
--*
--*
--* You may alter this code for your own *non-commercial* purposes. You may
--* republish altered code as long as you include this copyright and give due credit.
--*
--*
--* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
--* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
--* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
--* PARTICULAR PURPOSE.
--*
--******************************************************************************
-- Check the major product version to see if it is SQL Server 2016 SP2 or greater
IF EXISTS (SELECT * WHERE CONVERT(varchar(128), SERVERPROPERTY('ProductVersion')) LIKE '13%')
BEGIN
IF CONVERT(int, SERVERPROPERTY('ProductBuild')) >= 5026
PRINT N'You have the correct Service Pack of SQL Server 2016 for this diagnostic information script';
IF CONVERT(int, SERVERPROPERTY('ProductBuild')) < 5026
PRINT N'You do NOT have the correct Service Pack of SQL Server 2016 for this diagnostic information script';
END
ELSE
BEGIN
DECLARE @ProductVersion varchar(128) = CONVERT(varchar(128), SERVERPROPERTY('ProductVersion'));
RAISERROR ('Script does not match the ProductVersion [%s] of this instance. Many of these queries may not work on this version.' , 18 , 16 , @ProductVersion);
END
-- Instance level queries *******************************
-- SQL and OS Version information for current instance (Query 1) (Version Info)
SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version Info];
------
-- SQL Server 2016 Builds
-- Build Description Release Date URL to KB Article
-- 13.0.5026.0 SP2 RTM 4/24/2018 https://bit.ly/2FEvN2q
-- 13.0.5149.0 SP2 CU1 5/30/2018 https://support.microsoft.com/en-us/help/4135048/cumulative-update-1-for-sql-server-2016-sp2
-- 13.0.5153.0 SP2 CU2 7/16/2018 https://support.microsoft.com/en-us/help/4340355
-- 13.0.5216.0 SP2 CU3 9/20/2018 https://support.microsoft.com/en-us/help/4458871
-- 13.0.5233.0 SP2 CU4 11/13/2018 https://support.microsoft.com/en-us/help/4464106/cumulative-update-4-for-sql-server-2016-sp2
-- 13.0.5264.1 SP2 CU5 1/23/2019 https://support.microsoft.com/en-us/help/4475776/cumulative-update-5-for-sql-server-2016-sp2
-- 13.0.5292.0 SP2 CU6 3/19/2019 https://support.microsoft.com/en-us/help/4488536/cumulative-update-6-for-sql-server-2016-sp2
-- 13.0.5337.0 SP2 CU7 5/22/2019 https://support.microsoft.com/en-us/help/4495256/cumulative-update-7-for-sql-server-2016-sp2
-- 13.0.5366.0 SP2 CU7 + Security Update 7/9/2019 https://support.microsoft.com/en-us/help/4505222/security-update-for-sql-server-2016-sp2-cu7-gdr-july-9-2019
-- 13.0.5426.0 SP2 CU8 7/31/2019 https://support.microsoft.com/en-us/help/4505830/cumulative-update-8-for-sql-server-2016-sp2
-- 13.0.5470.0 SP2 CU9 9/30/2019 https://support.microsoft.com/en-us/help/4515435/cumulative-update-9-for-sql-server-2016-sp2
-- 13.0.5492.2 SP2 CU10 10/8/2019 https://support.microsoft.com/en-us/help/4524334/cumulative-update-10-for-sql-server-2016-sp2
-- 13.0.5598.27 SP2 CU11 12/9/2019 https://support.microsoft.com/en-us/help/4527378/cumulative-update-11-for-sql-server-2016-sp2
-- 13.0.5622.0 SP2 CU11 + Security Update 2/11/2010 https://support.microsoft.com/en-us/help/4535706/description-of-the-security-update-for-sql-server-2016-sp2-cu11-februa
-- 13.0.5698.0 SP2 CU12 2/25/2020 https://support.microsoft.com/en-us/help/4536648/cumulative-update-12-for-sql-server-2016-sp2
-- 13.0.5820.21 SP2 CU13 5/38/2020 https://support.microsoft.com/en-us/help/4549825/cumulative-update-13-for-sql-server-2016-sp2
-- 13.0.5830.85 SP2 CU14 8/6/2020 https://support.microsoft.com/en-us/help/4564903/cumulative-update-14-for-sql-server-2016-sp2
-- How to determine the version, edition and update level of SQL Server and its components
-- https://bit.ly/2oAjKgW
-- How to obtain the latest Service Pack for SQL Server 2016
-- https://bit.ly/2egtfzK
-- SQL Server 2016 build versions
-- https://bit.ly/2epkTDT
-- Recommended updates and configuration options for SQL Server 2017 and 2016 with high-performance workloads
-- https://bit.ly/2JsReue
-- Where to find information about the latest SQL Server builds
-- https://bit.ly/2IGHbfY
-- Performance and Stability Related Fixes in Post-SQL Server 2016 SP2 Builds
-- https://bit.ly/2K3LoPf
-- Update Center for Microsoft SQL Server
-- https://bit.ly/2pZptuQ
-- Download SQL Server Management Studio (SSMS)
-- https://bit.ly/1OcupT9
-- Download and install Azure Data Studio
-- https://bit.ly/2vgke1A
-- SQL Server 2016 Configuration Manager is SQLServerManager13.msc
-- Get socket, physical core and logical core count from the SQL Server Error log. (Query 2) (Core Counts)
-- This query might take a few seconds depending on the size of your error log
EXEC sys.xp_readerrorlog 0, 1, N'detected', N'socket';
------
-- This can help you determine the exact core counts used by SQL Server and whether HT is enabled or not
-- It can also help you confirm your SQL Server licensing model
-- Be on the lookout for this message "using 40 logical processors based on SQL Server licensing"
-- (when you have more than 40 logical cores) which means grandfathered Server/CAL licensing
-- This query will return no results if your error log has been recycled since the instance was last started
-- Get selected server properties (Query 3) (Server Properties)
SELECT SERVERPROPERTY('MachineName') AS [MachineName],
SERVERPROPERTY('ServerName') AS [ServerName],
SERVERPROPERTY('InstanceName') AS [Instance],
SERVERPROPERTY('IsClustered') AS [IsClustered],
SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS [ComputerNamePhysicalNetBIOS],
SERVERPROPERTY('Edition') AS [Edition],
SERVERPROPERTY('ProductLevel') AS [ProductLevel], -- What servicing branch (RTM/SP/CU)
SERVERPROPERTY('ProductUpdateLevel') AS [ProductUpdateLevel], -- Within a servicing branch, what CU# is applied
SERVERPROPERTY('ProductVersion') AS [ProductVersion],
SERVERPROPERTY('ProductMajorVersion') AS [ProductMajorVersion],
SERVERPROPERTY('ProductMinorVersion') AS [ProductMinorVersion],
SERVERPROPERTY('ProductBuild') AS [ProductBuild],
SERVERPROPERTY('ProductBuildType') AS [ProductBuildType], -- Is this a GDR or OD hotfix (NULL if on a CU build)
SERVERPROPERTY('ProductUpdateReference') AS [ProductUpdateReference], -- KB article number that is applicable for this build
SERVERPROPERTY('ProcessID') AS [ProcessID],
SERVERPROPERTY('Collation') AS [Collation],
SERVERPROPERTY('IsFullTextInstalled') AS [IsFullTextInstalled],
SERVERPROPERTY('IsIntegratedSecurityOnly') AS [IsIntegratedSecurityOnly],
SERVERPROPERTY('FilestreamConfiguredLevel') AS [FilestreamConfiguredLevel],
SERVERPROPERTY('IsHadrEnabled') AS [IsHadrEnabled],
SERVERPROPERTY('HadrManagerStatus') AS [HadrManagerStatus],
SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath],
SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath],
SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version],
SERVERPROPERTY('IsXTPSupported') AS [IsXTPSupported],
SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], -- New for SQL Server 2016
SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; -- New for SQL Server 2016
------
-- This gives you a lot of useful information about your instance of SQL Server,
-- such as the ProcessID for SQL Server and your collation
-- Note: Some columns will be NULL on older SQL Server builds
-- SERVERPROPERTY (Transact-SQL)
-- https://bit.ly/2eeaXeI
-- Get instance-level configuration values for instance (Query 4) (Configuration Values)
SELECT name, value, value_in_use, minimum, maximum, [description], is_dynamic, is_advanced
FROM sys.configurations WITH (NOLOCK)
ORDER BY name OPTION (RECOMPILE);
------
-- Focus on these settings:
-- automatic soft-NUMA disabled (should be 0 in most cases)
-- backup checksum default (should be 1)
-- backup compression default (should be 1 in most cases)
-- clr enabled (only enable if it is needed)
-- cost threshold for parallelism (depends on your workload)
-- lightweight pooling (should be zero)
-- max degree of parallelism (depends on your workload and hardware)
-- max server memory (MB) (set to an appropriate value, not the default)
-- optimize for ad hoc workloads (should be 1)
-- priority boost (should be zero)
-- remote admin connections (should be 1)
-- sys.configurations (Transact-SQL)
-- https://bit.ly/2HsyDZI
-- Returns a list of all global trace flags that are enabled (Query 5) (Global Trace Flags)
DBCC TRACESTATUS (-1);
------
-- If no global trace flags are enabled, no results will be returned.
-- It is very useful to know what global trace flags are currently enabled as part of the diagnostic process.
-- Common trace flags that should be enabled in most cases
-- TF 460 - Improvement: Optional replacement for "String or binary data would be truncated" message with extended information in SQL Server 2017
-- https://bit.ly/2sboMli (added in SP2 CU6)
-- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log
-- https://bit.ly/38zDNAK
-- TF 6534 - Enables use of native code to improve performance with spatial data
-- https://bit.ly/2HrQUpU
-- TF 7745 - Prevents Query Store data from being written to disk in case of a failover or shutdown command
-- https://bit.ly/2GU69Km
-- TF 7752 - Enables asynchronous load of Query Store
-- This allows a database to become online and queries to be executed before the Query Store has been fully recovered
-- The behavior of TF 1117, 1118 are enabled for tempdb in SQL Server 2016 by default
-- SQL 2016 It Just Runs Faster: -T1117 and -T1118 changes for TEMPDB and user databases
-- https://bit.ly/2lbNWxK
-- The behavior of TF 2371 is enabled by default in SQL Server 2016 and newer (in compat level 130 and higher)
-- DBCC TRACEON - Trace Flags (Transact-SQL)
-- https://bit.ly/2FuSvPg
-- Recommended updates and configuration options for SQL Server 2017 and 2016 with high-performance workloads
-- https://bit.ly/2VVRGTY
-- SQL Server Process Address space info (Query 6) (Process Memory)
-- (shows whether locked pages is enabled, among other things)
SELECT physical_memory_in_use_kb/1024 AS [SQL Server Memory Usage (MB)],
locked_page_allocations_kb/1024 AS [SQL Server Locked Pages Allocation (MB)],
large_page_allocations_kb/1024 AS [SQL Server Large Pages Allocation (MB)],
page_fault_count, memory_utilization_percentage, available_commit_limit_kb,
process_physical_memory_low, process_virtual_memory_low
FROM sys.dm_os_process_memory WITH (NOLOCK) OPTION (RECOMPILE);
------
-- You want to see 0 for process_physical_memory_low
-- You want to see 0 for process_virtual_memory_low
-- This indicates that you are not under internal memory pressure
-- If locked_page_allocations_kb > 0, then LPIM is enabled
-- How to enable the "locked pages" feature in SQL Server 2012
-- https://bit.ly/2F5UjOA
-- Memory Management Architecture Guide
-- https://bit.ly/2JKkadC
-- SQL Server Services information (Query 7) (SQL Server Services Info)
SELECT servicename, process_id, startup_type_desc, status_desc,
last_startup_time, service_account, is_clustered, cluster_nodename, [filename],
instant_file_initialization_enabled
FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE);
------
-- Tells you the account being used for the SQL Server Service and the SQL Agent Service
-- Shows the process_id, when they were last started, and their current status
-- Also shows whether you are running on a failover cluster instance, and what node you are running on
-- Also shows whether IFI is enabled
-- sys.dm_server_services (Transact-SQL)
-- https://bit.ly/2oKa1Un
-- Last backup information by database (Query 8) (Last Backup By Database)
SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model],
d.log_reuse_wait_desc AS [Log Reuse Wait Desc],
MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup],
MAX(CASE WHEN [type] = 'D' THEN bmf.physical_device_name ELSE NULL END) AS [Last Full Backup Location],
MAX(CASE WHEN [type] = 'I' THEN bs.backup_finish_date ELSE NULL END) AS [Last Differential Backup],
MAX(CASE WHEN [type] = 'I' THEN bmf.physical_device_name ELSE NULL END) AS [Last Differential Backup Location],
MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup],
MAX(CASE WHEN [type] = 'L' THEN bmf.physical_device_name ELSE NULL END) AS [Last Log Backup Location]
FROM sys.databases AS d WITH (NOLOCK)
LEFT OUTER JOIN msdb.dbo.backupset AS bs WITH (NOLOCK)
ON bs.[database_name] = d.[name]
LEFT OUTER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK)
ON bs.media_set_id = bmf.media_set_id
AND bs.backup_finish_date > GETDATE()- 30
WHERE d.name <> N'tempdb'
GROUP BY ISNULL(d.[name], bs.[database_name]), d.recovery_model_desc, d.log_reuse_wait_desc, d.[name]
ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE);
------
-- This helps you spot runaway transaction logs and other issues with your backup schedule
-- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs)
SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], SUSER_SNAME(sj.owner_sid) AS [Job Owner],
sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled],
sj.notify_email_operator_id, sj.notify_level_email, sc.name AS [CategoryName],
s.[enabled] AS [Sched Enabled], js.next_run_date, js.next_run_time
FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK)
INNER JOIN msdb.dbo.syscategories AS sc WITH (NOLOCK)
ON sj.category_id = sc.category_id
LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK)
ON sj.job_id = js.job_id
LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK)
ON js.schedule_id = s.schedule_id
ORDER BY sj.name OPTION (RECOMPILE);
------
-- Gives you some basic information about your SQL Server Agent jobs, who owns them and how they are configured
-- Look for Agent jobs that are not owned by sa
-- Look for jobs that have a notify_email_operator_id set to 0 (meaning no operator)
-- Look for jobs that have a notify_level_email set to 0 (meaning no e-mail is ever sent)
--
-- MSDN sysjobs documentation
-- https://bit.ly/2paDEOP
-- SQL Server Maintenance Solution
-- https://bit.ly/1pgchQu
-- You can use this script to add default schedules to the standard Ola Hallengren Maintenance Solution jobs
-- https://bit.ly/3ane0gN
-- Get SQL Server Agent Alert Information (Query 10) (SQL Server Agent Alerts)
SELECT name, event_source, message_id, severity, [enabled], has_notification,
delay_between_responses, occurrence_count, last_occurrence_date, last_occurrence_time
FROM msdb.dbo.sysalerts WITH (NOLOCK)
ORDER BY name OPTION (RECOMPILE);
------
-- Gives you some basic information about your SQL Server Agent Alerts
-- (which are different from SQL Server Agent jobs)
-- Read more about Agent Alerts here: https://bit.ly/2v5YR37
-- Windows information (Query 11) (Windows Info)
SELECT windows_release, windows_service_pack_level,
windows_sku, os_language_version
FROM sys.dm_os_windows_info WITH (NOLOCK) OPTION (RECOMPILE);
------
-- Gives you major OS version, Service Pack, Edition, and language info for the operating system
-- 10.0 is either Windows 10 or Windows Server 2016
-- 6.3 is either Windows 8.1 or Windows Server 2012 R2
-- 6.2 is either Windows 8 or Windows Server 2012
-- Windows SKU codes
-- 4 is Enterprise Edition
-- 7 is Standard Server Edition
-- 8 is Datacenter Server Edition
-- 10 is Enterprise Server Edition
-- 48 is Professional Edition
-- 161 is Pro for Workstations
-- 1033 for os_language_version is US-English
-- SQL Server 2016 requires Windows Server 2012 or newer
-- Quick-Start Installation of SQL Server 2016
-- https://bit.ly/2qtxQ3G
-- Hardware and Software Requirements for Installing SQL Server 2016
-- https://bit.ly/2JJIUTl
-- Using SQL Server in Windows 8 and later versions of Windows operating system
-- https://bit.ly/2F7Ax0P
-- SQL Server NUMA Node information (Query 12) (SQL Server NUMA Info)
SELECT node_id, node_state_desc, memory_node_id, processor_group, cpu_count, online_scheduler_count,
idle_scheduler_count, active_worker_count, avg_load_balance, resource_monitor_state
FROM sys.dm_os_nodes WITH (NOLOCK)
WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE);
------
-- Gives you some useful information about the composition and relative load on your NUMA nodes
-- You want to see an equal number of schedulers on each NUMA node
-- Watch out if SQL Server 2016 Standard Edition has been installed
-- on a physical or virtual machine with more than four sockets or more than 24 physical cores
-- sys.dm_os_nodes (Transact-SQL)
-- https://bit.ly/2pn5Mw8
-- How to Balance SQL Server Core Licenses Across NUMA Nodes
-- https://bit.ly/3i4TyVR
-- Good basic information about OS memory amounts and state (Query 13) (System Memory)
SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)],
available_physical_memory_kb/1024 AS [Available Memory (MB)],
total_page_file_kb/1024 AS [Page File Commit Limit (MB)],
total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)],
available_page_file_kb/1024 AS [Available Page File (MB)],
system_cache_kb/1024 AS [System Cache (MB)],
system_memory_state_desc AS [System Memory State]
FROM sys.dm_os_sys_memory WITH (NOLOCK) OPTION (RECOMPILE);
------
-- You want to see "Available physical memory is high" for System Memory State
-- This indicates that you are not under external memory pressure
-- Possible System Memory State values:
-- Available physical memory is high
-- Physical memory usage is steady
-- Available physical memory is low
-- Available physical memory is running low
-- Physical memory state is transitioning
-- sys.dm_os_sys_memory (Transact-SQL)
-- https://bit.ly/2pcV0xq
-- You can skip the next two queries if you know you don't have a clustered instance
-- Get information about your cluster nodes and their status (Query 14) (Cluster Node Properties)
-- (if your database server is in a failover cluster)
SELECT NodeName, status_description, is_current_owner
FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE);
------
-- Knowing which node owns the cluster resources is critical
-- Especially when you are installing Windows or SQL Server updates
-- You will see no results if your instance is not clustered
-- Recommended hotfixes and updates for Windows Server 2012 R2-based failover clusters
-- https://bit.ly/1z5BfCw
-- Get information about any AlwaysOn AG cluster this instance is a part of (Query 15) (AlwaysOn AG Cluster)
SELECT cluster_name, quorum_type_desc, quorum_state_desc
FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE);
------
-- You will see no results if your instance is not using AlwaysOn AGs
-- Good overview of AG health and status (Query 16) (AG Status)
SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name],
drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant,
drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn,
drs.last_sent_time, drs.last_received_lsn, drs.last_received_time, drs.last_hardened_lsn,
drs.last_hardened_time, drs.last_redone_lsn, drs.last_redone_time, drs.log_send_queue_size,
drs.log_send_rate, drs.redo_queue_size, drs.redo_rate, drs.filestream_send_rate,
drs.end_of_log_lsn, drs.last_commit_lsn, drs.last_commit_time, drs.database_state_desc
FROM sys.dm_hadr_database_replica_states AS drs WITH (NOLOCK)
INNER JOIN sys.availability_databases_cluster AS adc WITH (NOLOCK)
ON drs.group_id = adc.group_id
AND drs.group_database_id = adc.group_database_id
INNER JOIN sys.availability_groups AS ag WITH (NOLOCK)
ON ag.group_id = drs.group_id
INNER JOIN sys.availability_replicas AS ar WITH (NOLOCK)
ON drs.group_id = ar.group_id
AND drs.replica_id = ar.replica_id
ORDER BY ag.name, ar.replica_server_name, adc.[database_name] OPTION (RECOMPILE);
-- You will see no results if your instance is not using AlwaysOn AGs
-- SQL Server 2016 It Just Runs Faster: Always On Availability Groups Turbocharged
-- https://bit.ly/2dn1H6r
-- Hardware information from SQL Server 2016 SP2 (Query 17) (Hardware Info)
SELECT cpu_count AS [Logical CPU Count], scheduler_count,
(socket_count * cores_per_socket) AS [Physical Core Count],
socket_count AS [Socket Count], cores_per_socket, numa_node_count,
physical_memory_kb/1024 AS [Physical Memory (MB)],
max_workers_count AS [Max Workers Count],
affinity_type_desc AS [Affinity Type],
sqlserver_start_time AS [SQL Server Start Time],
DATEDIFF(hour, sqlserver_start_time, GETDATE()) AS [SQL Server Up Time (hrs)],
virtual_machine_type_desc AS [Virtual Machine Type],
softnuma_configuration_desc AS [Soft NUMA Configuration],
sql_memory_model_desc
FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE);
------
-- Gives you some good basic hardware information about your database server
-- Note: virtual_machine_type_desc of HYPERVISOR does not automatically mean you are running SQL Server inside of a VM
-- It merely indicates that you have a hypervisor running on your host
-- sys.dm_os_sys_info (Transact-SQL)
-- https://bit.ly/2pczOYs
-- Soft NUMA configuration was a new column for SQL Server 2016
-- OFF = Soft-NUMA feature is OFF
-- ON = SQL Server automatically determines the NUMA node sizes for Soft-NUMA
-- MANUAL = Manually configured soft-NUMA
-- Configure SQL Server to Use Soft-NUMA (SQL Server)
-- https://bit.ly/2HTpKJt
-- sql_memory_model_desc values (Added in SQL Server 2016 SP1)
-- CONVENTIONAL
-- LOCK_PAGES
-- LARGE_PAGES
-- Get System Manufacturer and model number from SQL Server Error log (Query 18) (System Manufacturer)
EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer';
------
-- This can help you determine the capabilities and capacities of your database server
-- Can also be used to confirm if you are running in a VM
-- This query might take a few seconds if you have not recycled your error log recently
-- This query will return no results if your error log has been recycled since the instance was started
-- Get BIOS date from Windows Registry (Query 19) (BIOS Date)
EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate';
------
-- Helps you understand whether the main system BIOS is up to date, and the possible age of the hardware
-- Not as useful for virtualization
-- Get processor description from Windows Registry (Query 20) (Processor Description)
EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\CentralProcessor\0', N'ProcessorNameString';
------
-- Gives you the model number and rated clock speed of your processor(s)
-- Your processors may be running at less than the rated clock speed due
-- to the Windows Power Plan or hardware power management
-- You can use CPU-Z to get your actual CPU core speed and a lot of other useful information
-- https://bit.ly/QhR6xF
-- You can learn more about processor selection for SQL Server by following this link
-- https://bit.ly/2F3aVlP
-- Get information on location, time and size of any memory dumps from SQL Server (Query 21) (Memory Dump Info)
SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)]
FROM sys.dm_server_memory_dumps WITH (NOLOCK)
ORDER BY creation_time DESC OPTION (RECOMPILE);
------
-- This will not return any rows if you have
-- not had any memory dumps (which is a good thing)
-- sys.dm_server_memory_dumps (Transact-SQL)
-- https://bit.ly/2elwWll
-- Look at Suspect Pages table (Query 22) (Suspect Pages)
SELECT DB_NAME(database_id) AS [Database Name], [file_id], page_id,
event_type, error_count, last_update_date
FROM msdb.dbo.suspect_pages WITH (NOLOCK)
ORDER BY database_id OPTION (RECOMPILE);
------
-- event_type value descriptions
-- 1 = 823 error caused by an operating system CRC error
-- or 824 error other than a bad checksum or a torn page (for example, a bad page ID)
-- 2 = Bad checksum
-- 3 = Torn page
-- 4 = Restored (The page was restored after it was marked bad)
-- 5 = Repaired (DBCC repaired the page)
-- 7 = Deallocated by DBCC
-- Ideally, this query returns no results. The table is limited to 1000 rows.
-- If you do get results here, you should do further investigation to determine the root cause
-- Manage the suspect_pages Table
-- https://bit.ly/2Fvr1c9
-- Get number of data files in tempdb database (Query 23) (TempDB Data Files)
EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has';
------
-- Get the number of data files in the tempdb database
-- 4-8 data files that are all the same size is a good starting point
-- This query will return no results if your error log has been recycled since the instance was last started
-- File names and paths for all user and system databases on instance (Query 24) (Database Filenames and Paths)
SELECT DB_NAME([database_id]) AS [Database Name],
[file_id], [name], physical_name, [type_desc], state_desc,
is_percent_growth, growth,
CONVERT(bigint, growth/128.0) AS [Growth in MB],
CONVERT(bigint, size/128.0) AS [Total Size in MB], max_size
FROM sys.master_files WITH (NOLOCK)
ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE);
------
-- Things to look at:
-- Are data files and log files on different drives?
-- Is everything on the C: drive?
-- Is tempdb on dedicated drives?
-- Is there only one tempdb data file?
-- Are all of the tempdb data files the same size?
-- Are there multiple data files for user databases?
-- Is percent growth enabled for any files (which is bad)?
-- Volume info for all LUNS that have database files on the current instance (Query 25) (Volume Info)
SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, vs.logical_volume_name,
CONVERT(DECIMAL(18,2), vs.total_bytes/1073741824.0) AS [Total Size (GB)],
CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)],
CONVERT(DECIMAL(18,2), vs.available_bytes * 1. / vs.total_bytes * 100.) AS [Space Free %],
vs.supports_compression, vs.is_compressed,
vs.supports_sparse_files, vs.supports_alternate_streams
FROM sys.master_files AS f WITH (NOLOCK)
CROSS APPLY sys.dm_os_volume_stats(f.database_id, f.[file_id]) AS vs
ORDER BY vs.volume_mount_point OPTION (RECOMPILE);
------
-- Shows you the total and free space on the LUNs where you have database files
-- Being low on free space can negatively affect performance
-- sys.dm_os_volume_stats (Transact-SQL)
-- https://bit.ly/2oBPNNr
-- Drive level latency information (Query 26) (Drive Level Latency)
SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point],
CASE
WHEN num_of_reads = 0 THEN 0
ELSE (io_stall_read_ms/num_of_reads)
END AS [Read Latency],
CASE
WHEN num_of_writes = 0 THEN 0
ELSE (io_stall_write_ms/num_of_writes)
END AS [Write Latency],
CASE
WHEN (num_of_reads = 0 AND num_of_writes = 0) THEN 0
ELSE (io_stall/(num_of_reads + num_of_writes))
END AS [Overall Latency],
CASE
WHEN num_of_reads = 0 THEN 0
ELSE (num_of_bytes_read/num_of_reads)
END AS [Avg Bytes/Read],
CASE
WHEN num_of_writes = 0 THEN 0
ELSE (num_of_bytes_written/num_of_writes)
END AS [Avg Bytes/Write],
CASE
WHEN (num_of_reads = 0 AND num_of_writes = 0) THEN 0
ELSE ((num_of_bytes_read + num_of_bytes_written)/(num_of_reads + num_of_writes))
END AS [Avg Bytes/Transfer]
FROM (SELECT LEFT(UPPER(mf.physical_name), 2) AS Drive, SUM(num_of_reads) AS num_of_reads,
SUM(io_stall_read_ms) AS io_stall_read_ms, SUM(num_of_writes) AS num_of_writes,
SUM(io_stall_write_ms) AS io_stall_write_ms, SUM(num_of_bytes_read) AS num_of_bytes_read,
SUM(num_of_bytes_written) AS num_of_bytes_written, SUM(io_stall) AS io_stall, vs.volume_mount_point
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS vfs
INNER JOIN sys.master_files AS mf WITH (NOLOCK)
ON vfs.database_id = mf.database_id AND vfs.file_id = mf.file_id
CROSS APPLY sys.dm_os_volume_stats(mf.database_id, mf.[file_id]) AS vs
GROUP BY LEFT(UPPER(mf.physical_name), 2), vs.volume_mount_point) AS tab
ORDER BY [Overall Latency] OPTION (RECOMPILE);
------
-- Shows you the drive-level latency for reads and writes, in milliseconds
-- Latency above 30-40ms is usually a problem
-- These latency numbers include all file activity against all SQL Server
-- database files on each drive since SQL Server was last started
-- sys.dm_io_virtual_file_stats (Transact-SQL)
-- https://bit.ly/3bRWUc0
-- sys.dm_os_volume_stats (Transact-SQL)
-- https://bit.ly/33thz2j
-- Calculates average stalls per read, per write, and per total input/output for each database file (Query 27) (IO Latency by File)
SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms],
CAST(fs.io_stall_write_ms/(1.0 + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_write_latency_ms],
CAST((fs.io_stall_read_ms + fs.io_stall_write_ms)/(1.0 + fs.num_of_reads + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_io_latency_ms],
CONVERT(DECIMAL(18,2), mf.size/128.0) AS [File Size (MB)], mf.physical_name, mf.type_desc, fs.io_stall_read_ms, fs.num_of_reads,
fs.io_stall_write_ms, fs.num_of_writes, fs.io_stall_read_ms + fs.io_stall_write_ms AS [io_stalls], fs.num_of_reads + fs.num_of_writes AS [total_io],
io_stall_queued_read_ms AS [Resource Governor Total Read IO Latency (ms)], io_stall_queued_write_ms AS [Resource Governor Total Write IO Latency (ms)]
FROM sys.dm_io_virtual_file_stats(null,null) AS fs
INNER JOIN sys.master_files AS mf WITH (NOLOCK)
ON fs.database_id = mf.database_id
AND fs.[file_id] = mf.[file_id]
ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE);
------
-- Helps determine which database files on the entire instance have the most I/O bottlenecks
-- This can help you decide whether certain LUNs are overloaded and whether you might
-- want to move some files to a different location or perhaps improve your I/O performance
-- These latency numbers include all file activity against each SQL Server
-- database file since SQL Server was last started
-- sys.dm_io_virtual_file_stats (Transact-SQL)
-- https://bit.ly/3bRWUc0
-- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 28) (IO Warnings)
CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000));
INSERT INTO #IOWarningResults
EXEC xp_readerrorlog 0, 1, N'taking longer than 15 seconds';
INSERT INTO #IOWarningResults
EXEC xp_readerrorlog 1, 1, N'taking longer than 15 seconds';
INSERT INTO #IOWarningResults
EXEC xp_readerrorlog 2, 1, N'taking longer than 15 seconds';
INSERT INTO #IOWarningResults
EXEC xp_readerrorlog 3, 1, N'taking longer than 15 seconds';
INSERT INTO #IOWarningResults
EXEC xp_readerrorlog 4, 1, N'taking longer than 15 seconds';
INSERT INTO #IOWarningResults
EXEC xp_readerrorlog 5, 1, N'taking longer than 15 seconds';
SELECT LogDate, ProcessInfo, LogText
FROM #IOWarningResults
ORDER BY LogDate DESC;
DROP TABLE #IOWarningResults;
------
-- Finding 15 second I/O warnings in the SQL Server Error Log is useful evidence of
-- poor I/O performance (which might have many different causes)
-- Look to see if you see any patterns in the results (same files, same drives, same time of day, etc.)
-- Diagnostics in SQL Server help detect stalled and stuck I/O operations
-- https://bit.ly/2qtaw73
-- Resource Governor Resource Pool information (Query 29) (RG Resource Pools)
SELECT pool_id, [Name], statistics_start_time,
min_memory_percent, max_memory_percent,
max_memory_kb/1024 AS [max_memory_mb],
used_memory_kb/1024 AS [used_memory_mb],
target_memory_kb/1024 AS [target_memory_mb],
min_iops_per_volume, max_iops_per_volume
FROM sys.dm_resource_governor_resource_pools WITH (NOLOCK)
OPTION (RECOMPILE);
------
-- sys.dm_resource_governor_resource_pools (Transact-SQL)
-- https://bit.ly/2MVU0Vy
-- Recovery model, log reuse wait description, log file size, log usage size (Query 30) (Database Properties)
-- and compatibility level for all databases on instance
SELECT db.[name] AS [Database Name], SUSER_SNAME(db.owner_sid) AS [Database Owner], db.recovery_model_desc AS [Recovery Model],
db.state_desc, db.containment_desc, db.log_reuse_wait_desc AS [Log Reuse Wait Description],
CONVERT(DECIMAL(18,2), ls.cntr_value/1024.0) AS [Log Size (MB)], CONVERT(DECIMAL(18,2), lu.cntr_value/1024.0) AS [Log Used (MB)],
CAST(CAST(lu.cntr_value AS FLOAT) / CAST(ls.cntr_value AS FLOAT)AS DECIMAL(18,2)) * 100 AS [Log Used %],
db.[compatibility_level] AS [DB Compatibility Level],
db.is_mixed_page_allocation_on, db.page_verify_option_desc AS [Page Verify Option],
db.is_auto_create_stats_on, db.is_auto_update_stats_on, db.is_auto_update_stats_async_on, db.is_parameterization_forced,
db.snapshot_isolation_state_desc, db.is_read_committed_snapshot_on, db.is_auto_close_on, db.is_auto_shrink_on,
db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.is_published, db.is_distributor,
db.group_database_id, db.replica_id,db.is_memory_optimized_elevate_to_snapshot_on,
db.delayed_durability_desc, db.is_auto_create_stats_incremental_on,
db.is_query_store_on, db.is_sync_with_backup,
db.is_supplemental_logging_enabled, db.is_remote_data_archive_enabled,
db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length
FROM sys.databases AS db WITH (NOLOCK)
INNER JOIN sys.dm_os_performance_counters AS lu WITH (NOLOCK)
ON db.name = lu.instance_name
INNER JOIN sys.dm_os_performance_counters AS ls WITH (NOLOCK)
ON db.name = ls.instance_name
LEFT OUTER JOIN sys.dm_database_encryption_keys AS de WITH (NOLOCK)
ON db.database_id = de.database_id
WHERE lu.counter_name LIKE N'Log File(s) Used Size (KB)%'
AND ls.counter_name LIKE N'Log File(s) Size (KB)%'
AND ls.cntr_value > 0
ORDER BY db.[name] OPTION (RECOMPILE);
------
-- Things to look at:
-- How many databases are on the instance?
-- What recovery models are they using?
-- What is the log reuse wait description?
-- How full are the transaction logs?
-- What compatibility level are the databases on?
-- What is the Page Verify Option? (should be CHECKSUM)
-- Is Auto Update Statistics Asynchronously enabled?
-- Is Delayed Durability enabled
-- Make sure auto_shrink and auto_close are not enabled!
-- is_mixed_page_allocation_on is a new property for SQL Server 2016. Equivalent to TF 1118 for a user database
-- SQL Server 2016: Changes in default behavior for autogrow and allocations for tempdb and user databases
-- https://bit.ly/2evRZSR
-- A non-zero value for target_recovery_time_in_seconds means that indirect checkpoint is enabled
-- If the setting has a zero value it indicates that automatic checkpoint is enabled
-- Changes in SQL Server 2016 Checkpoint Behavior
-- https://bit.ly/2pdggk3
-- Missing Indexes for all databases by Index Advantage (Query 31) (Missing Indexes All Databases)
SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage],
FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table],
COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table],
COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table],
mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks,
CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact
FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK)
INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK)
ON migs.group_handle = mig.index_group_handle
INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK)
ON mig.index_handle = mid.index_handle
ORDER BY index_advantage DESC OPTION (RECOMPILE);
------
-- Getting missing index information for all of the databases on the instance is very useful
-- Look at last user seek time, number of user seeks to help determine source and importance
-- Also look at avg_user_impact and avg_total_user_cost to help determine importance
-- SQL Server is overly eager to add included columns, so beware
-- Do not just blindly add indexes that show up from this query!!!
-- <NAME> has given me some great suggestions for this query
-- SQL Server Index Design Guide
-- https://bit.ly/2qtZr4N
-- Get VLF Counts for all databases on the instance (Query 32) (VLF Counts)
SELECT [name] AS [Database Name], [VLF Count]
FROM sys.databases AS db WITH (NOLOCK)
CROSS APPLY (SELECT file_id, COUNT(*) AS [VLF Count]
FROM sys.dm_db_log_info(db.database_id)
GROUP BY file_id) AS li
ORDER BY [VLF Count] DESC OPTION (RECOMPILE);
------
-- High VLF counts can affect write performance to the log file
-- and they can make full database restores and crash recovery take much longer
-- Try to keep your VLF counts under 200 in most cases (depending on log file size)
-- Important change to VLF creation algorithm in SQL Server 2014
-- https://bit.ly/2Hsjbg4
-- SQL Server Transaction Log Architecture and Management Guide
-- https://bit.ly/2JjmQRZ
-- Get CPU utilization by database (Query 33) (CPU Usage by Database)
WITH DB_CPU_Stats
AS
(SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms]
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
CROSS APPLY (SELECT CONVERT(int, value) AS [DatabaseID]
FROM sys.dm_exec_plan_attributes(qs.plan_handle)
WHERE attribute = N'dbid') AS pa
GROUP BY DatabaseID)
SELECT ROW_NUMBER() OVER(ORDER BY [CPU_Time_Ms] DESC) AS [CPU Rank],
[Database Name], [CPU_Time_Ms] AS [CPU Time (ms)],
CAST([CPU_Time_Ms] * 1.0 / SUM([CPU_Time_Ms]) OVER() * 100.0 AS DECIMAL(5, 2)) AS [CPU Percent]
FROM DB_CPU_Stats
WHERE DatabaseID <> 32767 -- ResourceDB
ORDER BY [CPU Rank] OPTION (RECOMPILE);
------
-- Helps determine which database is using the most CPU resources on the instance
-- Note: This only reflects CPU usage from the currently cached query plans
-- Get I/O utilization by database (Query 34) (IO Usage By Database)
WITH Aggregate_IO_Statistics
AS (SELECT DB_NAME(database_id) AS [Database Name],
CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB],
CAST(SUM(num_of_bytes_read ) / 1048576 AS DECIMAL(12, 2)) AS [ioReadMB],
CAST(SUM(num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioWriteMB]
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS [DM_IO_STATS]
GROUP BY database_id)
SELECT ROW_NUMBER() OVER (ORDER BY ioTotalMB DESC) AS [I/O Rank],
[Database Name], ioTotalMB AS [Total I/O (MB)],
CAST(ioTotalMB / SUM(ioTotalMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Total I/O %],
ioReadMB AS [Read I/O (MB)],
CAST(ioReadMB / SUM(ioReadMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Read I/O %],
ioWriteMB AS [Write I/O (MB)],
CAST(ioWriteMB / SUM(ioWriteMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Write I/O %]
FROM Aggregate_IO_Statistics
ORDER BY [I/O Rank] OPTION (RECOMPILE);
------
-- Helps determine which database is using the most I/O resources on the instance
-- These numbers are cumulative since the last service restart
-- They include all I/O activity, not just the nominal I/O workload
-- Get total buffer usage by database for current instance (Query 35) (Total Buffer Usage by Database)
-- This make take some time to run on a busy instance
WITH AggregateBufferPoolUsage
AS
(SELECT DB_NAME(database_id) AS [Database Name],
CAST(COUNT(*) * 8/1024.0 AS DECIMAL (10,2)) AS [CachedSize]
FROM sys.dm_os_buffer_descriptors WITH (NOLOCK)
WHERE database_id <> 32767 -- ResourceDB
GROUP BY DB_NAME(database_id))
SELECT ROW_NUMBER() OVER(ORDER BY CachedSize DESC) AS [Buffer Pool Rank], [Database Name], CachedSize AS [Cached Size (MB)],
CAST(CachedSize / SUM(CachedSize) OVER() * 100.0 AS DECIMAL(5,2)) AS [Buffer Pool Percent]
FROM AggregateBufferPoolUsage
ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE);
------
-- Tells you how much memory (in the buffer pool)
-- is being used by each database on the instance
-- Get tempdb version store space usage by database (Query 36) (Version Store Space Usage)
SELECT DB_NAME(database_id) AS [Database Name],
reserved_page_count AS [Version Store Reserved Page Count],
reserved_space_kb/1024 AS [Version Store Reserved Space (MB)]
FROM sys.dm_tran_version_store_space_usage WITH (NOLOCK)
ORDER BY reserved_space_kb/1024 DESC OPTION (RECOMPILE);
------
-- sys.dm_tran_version_store_space_usage (Transact-SQL)
-- https://bit.ly/2vh3Bmk
-- Clear Wait Stats with this command
-- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR);
-- Isolate top waits for server instance since last restart or wait statistics clear (Query 37) (Top Waits)
WITH [Waits]
AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS],
(wait_time_ms - signal_wait_time_ms) / 1000.0 AS [ResourceS],
signal_wait_time_ms / 1000.0 AS [SignalS],
waiting_tasks_count AS [WaitCount],
100.0 * wait_time_ms / SUM (wait_time_ms) OVER() AS [Percentage],
ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS [RowNum]
FROM sys.dm_os_wait_stats WITH (NOLOCK)
WHERE [wait_type] NOT IN (
N'BROKER_EVENTHANDLER', N'BROKER_RECEIVE_WAITFOR', N'BROKER_TASK_STOP',
N'BROKER_TO_FLUSH', N'BROKER_TRANSMITTER', N'CHECKPOINT_QUEUE',
N'CHKPT', N'CLR_AUTO_EVENT', N'CLR_MANUAL_EVENT', N'CLR_SEMAPHORE', N'CXCONSUMER',
N'DBMIRROR_DBM_EVENT', N'DBMIRROR_EVENTS_QUEUE', N'DBMIRROR_WORKER_QUEUE',
N'DBMIRRORING_CMD', N'DIRTY_PAGE_POLL', N'DISPATCHER_QUEUE_SEMAPHORE',
N'EXECSYNC', N'FSAGENT', N'FT_IFTS_SCHEDULER_IDLE_WAIT', N'FT_IFTSHC_MUTEX',
N'HADR_CLUSAPI_CALL', N'HADR_FILESTREAM_IOMGR_IOCOMPLETION', N'HADR_LOGCAPTURE_WAIT',
N'HADR_NOTIFICATION_DEQUEUE', N'HADR_TIMER_TASK', N'HADR_WORK_QUEUE',
N'KSOURCE_WAKEUP', N'LAZYWRITER_SLEEP', N'LOGMGR_QUEUE',
N'MEMORY_ALLOCATION_EXT', N'ONDEMAND_TASK_QUEUE',
N'PARALLEL_REDO_DRAIN_WORKER', N'PARALLEL_REDO_LOG_CACHE', N'PARALLEL_REDO_TRAN_LIST',
N'PARALLEL_REDO_WORKER_SYNC', N'PARALLEL_REDO_WORKER_WAIT_WORK',
N'PREEMPTIVE_HADR_LEASE_MECHANISM', N'PREEMPTIVE_SP_SERVER_DIAGNOSTICS',
N'PREEMPTIVE_OS_LIBRARYOPS', N'PREEMPTIVE_OS_COMOPS', N'PREEMPTIVE_OS_CRYPTOPS',
N'PREEMPTIVE_OS_PIPEOPS', N'PREEMPTIVE_OS_AUTHENTICATIONOPS',
N'PREEMPTIVE_OS_GENERICOPS', N'PREEMPTIVE_OS_VERIFYTRUST',
N'PREEMPTIVE_OS_FILEOPS', N'PREEMPTIVE_OS_DEVICEOPS', N'PREEMPTIVE_OS_QUERYREGISTRY',
N'PREEMPTIVE_OS_WRITEFILE',
N'PREEMPTIVE_XE_CALLBACKEXECUTE', N'PREEMPTIVE_XE_DISPATCHER',
N'PREEMPTIVE_XE_GETTARGETSTATE', N'PREEMPTIVE_XE_SESSIONCOMMIT',
N'PREEMPTIVE_XE_TARGETINIT', N'PREEMPTIVE_XE_TARGETFINALIZE',
N'PWAIT_ALL_COMPONENTS_INITIALIZED', N'PWAIT_DIRECTLOGCONSUMER_GETNEXT',
N'QDS_PERSIST_TASK_MAIN_LOOP_SLEEP',
N'QDS_ASYNC_QUEUE',
N'QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP', N'REQUEST_FOR_DEADLOCK_SEARCH',
N'RESOURCE_QUEUE', N'SERVER_IDLE_CHECK', N'SLEEP_BPOOL_FLUSH', N'SLEEP_DBSTARTUP',
N'SLEEP_DCOMSTARTUP', N'SLEEP_MASTERDBREADY', N'SLEEP_MASTERMDREADY',
N'SLEEP_MASTERUPGRADED', N'SLEEP_MSDBSTARTUP', N'SLEEP_SYSTEMTASK', N'SLEEP_TASK',
N'SLEEP_TEMPDBSTARTUP', N'SNI_HTTP_ACCEPT', N'SP_SERVER_DIAGNOSTICS_SLEEP',
N'SQLTRACE_BUFFER_FLUSH', N'SQLTRACE_INCREMENTAL_FLUSH_SLEEP', N'SQLTRACE_WAIT_ENTRIES',
N'WAIT_FOR_RESULTS', N'WAITFOR', N'WAITFOR_TASKSHUTDOWN', N'WAIT_XTP_HOST_WAIT',
N'WAIT_XTP_OFFLINE_CKPT_NEW_LOG', N'WAIT_XTP_CKPT_CLOSE', N'WAIT_XTP_RECOVERY',
N'XE_BUFFERMGR_ALLPROCESSED_EVENT', N'XE_DISPATCHER_JOIN',
N'XE_DISPATCHER_WAIT', N'XE_LIVE_TARGET_TVF', N'XE_TIMER_EVENT')
AND waiting_tasks_count > 0)
SELECT
MAX (W1.wait_type) AS [WaitType],
CAST (MAX (W1.Percentage) AS DECIMAL (5,2)) AS [Wait Percentage],
CAST ((MAX (W1.WaitS) / MAX (W1.WaitCount)) AS DECIMAL (16,4)) AS [AvgWait_Sec],
CAST ((MAX (W1.ResourceS) / MAX (W1.WaitCount)) AS DECIMAL (16,4)) AS [AvgRes_Sec],
CAST ((MAX (W1.SignalS) / MAX (W1.WaitCount)) AS DECIMAL (16,4)) AS [AvgSig_Sec],
CAST (MAX (W1.WaitS) AS DECIMAL (16,2)) AS [Wait_Sec],
CAST (MAX (W1.ResourceS) AS DECIMAL (16,2)) AS [Resource_Sec],
CAST (MAX (W1.SignalS) AS DECIMAL (16,2)) AS [Signal_Sec],
MAX (W1.WaitCount) AS [Wait Count],
CAST (N'https://www.sqlskills.com/help/waits/' + W1.wait_type AS XML) AS [Help/Info URL]
FROM Waits AS W1
INNER JOIN Waits AS W2
ON W2.RowNum <= W1.RowNum
GROUP BY W1.RowNum, W1.wait_type
HAVING SUM (W2.Percentage) - MAX (W1.Percentage) < 99 -- percentage threshold
OPTION (RECOMPILE);
------
-- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure
-- SQL Server Wait Types Library
-- https://bit.ly/2ePzYO2
-- The SQL Server Wait Type Repository
-- https://bit.ly/1afzfjC
-- Wait statistics, or please tell me where it hurts
-- https://bit.ly/2wsQHQE
-- SQL Server 2005 Performance Tuning using the Waits and Queues
-- https://bit.ly/1o2NFoF
-- sys.dm_os_wait_stats (Transact-SQL)
-- https://bit.ly/2Hjq9Yl
-- Get a count of SQL connections by IP address (Query 38) (Connection Counts by IP Address)
SELECT ec.client_net_address, es.[program_name], es.[host_name], es.login_name,
COUNT(ec.session_id) AS [connection count]
FROM sys.dm_exec_sessions AS es WITH (NOLOCK)
INNER JOIN sys.dm_exec_connections AS ec WITH (NOLOCK)
ON es.session_id = ec.session_id
GROUP BY ec.client_net_address, es.[program_name], es.[host_name], es.login_name
ORDER BY ec.client_net_address, es.[program_name] OPTION (RECOMPILE);
------
-- This helps you figure where your database load is coming from
-- and verifies connectivity from other machines
-- Solving Connectivity errors to SQL Server
-- https://bit.ly/2EgzoD0
-- Get Average Task Counts (run multiple times) (Query 39) (Avg Task Counts)
SELECT AVG(current_tasks_count) AS [Avg Task Count],
AVG(work_queue_count) AS [Avg Work Queue Count],
AVG(runnable_tasks_count) AS [Avg Runnable Task Count],
AVG(pending_disk_io_count) AS [Avg Pending DiskIO Count]
FROM sys.dm_os_schedulers WITH (NOLOCK)
WHERE scheduler_id < 255 OPTION (RECOMPILE);
------
-- Sustained values above 10 suggest further investigation in that area
-- High Avg Task Counts are often caused by blocking/deadlocking or other resource contention
-- Sustained values above 1 suggest further investigation in that area
-- High Avg Runnable Task Counts are a good sign of CPU pressure
-- High Avg Pending DiskIO Counts are a sign of disk pressure
-- How to Do Some Very Basic SQL Server Monitoring
-- https://bit.ly/30IRla0
-- Detect blocking (run multiple times) (Query 40) (Detect Blocking)
SELECT t1.resource_type AS [lock type], DB_NAME(resource_database_id) AS [database],
t1.resource_associated_entity_id AS [blk object],t1.request_mode AS [lock req], -- lock requested
t1.request_session_id AS [waiter sid], t2.wait_duration_ms AS [wait time], -- spid of waiter
(SELECT [text] FROM sys.dm_exec_requests AS r WITH (NOLOCK) -- get sql for waiter
CROSS APPLY sys.dm_exec_sql_text(r.[sql_handle])
WHERE r.session_id = t1.request_session_id) AS [waiter_batch],
(SELECT SUBSTRING(qt.[text],r.statement_start_offset/2,
(CASE WHEN r.statement_end_offset = -1
THEN LEN(CONVERT(nvarchar(max), qt.[text])) * 2
ELSE r.statement_end_offset END - r.statement_start_offset)/2)
FROM sys.dm_exec_requests AS r WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(r.[sql_handle]) AS qt
WHERE r.session_id = t1.request_session_id) AS [waiter_stmt], -- statement blocked
t2.blocking_session_id AS [blocker sid], -- spid of blocker
(SELECT [text] FROM sys.sysprocesses AS p -- get sql for blocker
CROSS APPLY sys.dm_exec_sql_text(p.[sql_handle])
WHERE p.spid = t2.blocking_session_id) AS [blocker_batch]
FROM sys.dm_tran_locks AS t1 WITH (NOLOCK)
INNER JOIN sys.dm_os_waiting_tasks AS t2 WITH (NOLOCK)
ON t1.lock_owner_address = t2.resource_address OPTION (RECOMPILE);
------
-- Helps troubleshoot blocking and deadlocking issues
-- The results will change from second to second on a busy system
-- You should run this query multiple times when you see signs of blocking
-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 41) (CPU Utilization History)
DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK));
SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization],
SystemIdle AS [System Idle Process],
100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization],
DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time]
FROM (SELECT record.value('(./Record/@id)[1]', 'int') AS record_id,
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int')
AS [SystemIdle],
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int')
AS [SQLProcessUtilization], [timestamp]
FROM (SELECT [timestamp], CONVERT(xml, record) AS [record]
FROM sys.dm_os_ring_buffers WITH (NOLOCK)
WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'
AND record LIKE N'%<SystemHealth>%') AS x) AS y
ORDER BY record_id DESC OPTION (RECOMPILE);
------
-- Look at the trend over the entire period
-- Also look at high sustained 'Other Process' CPU Utilization values
-- Note: This query sometimes gives inaccurate results (negative values)
-- on high core count (> 64 cores) systems
-- Get top total worker time queries for entire instance (Query 42) (Top Worker Time Queries)
SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name],
REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text],
qs.total_worker_time AS [Total Worker Time], qs.min_worker_time AS [Min Worker Time],
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
qs.max_worker_time AS [Max Worker Time],
qs.min_elapsed_time AS [Min Elapsed Time],
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
qs.max_elapsed_time AS [Max Elapsed Time],
qs.min_logical_reads AS [Min Logical Reads],
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
qs.max_logical_reads AS [Max Logical Reads],
qs.execution_count AS [Execution Count],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
qs.creation_time AS [Creation Time]
--,t.[text] AS [Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp
ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE);
------
-- Helps you find the most expensive queries from a CPU perspective across the entire instance
-- Can also help track down parameter sniffing issues
-- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 43) (PLE by NUMA Node)
SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name],
instance_name, cntr_value AS [Page Life Expectancy]
FROM sys.dm_os_performance_counters WITH (NOLOCK)
WHERE [object_name] LIKE N'%Buffer Node%' -- Handles named instances
AND counter_name = N'Page life expectancy' OPTION (RECOMPILE);
------
-- PLE is a good measurement of internal memory pressure
-- Higher PLE is better. Watch the trend over time, not the absolute value
-- This will only return one row for non-NUMA systems
-- Page Life Expectancy isnt what you think
-- https://bit.ly/2EgynLa
-- Memory Grants Pending value for current instance (Query 44) (Memory Grants Pending)
SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], cntr_value AS [Memory Grants Pending]
FROM sys.dm_os_performance_counters WITH (NOLOCK)
WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances
AND counter_name = N'Memory Grants Pending' OPTION (RECOMPILE);
------
-- Run multiple times, and run periodically if you suspect you are under memory pressure
-- Memory Grants Pending above zero for a sustained period is a very strong indicator of internal memory pressure
-- Memory Clerk Usage for instance (Query 45) (Memory Clerk Usage)
-- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans)
SELECT TOP(10) mc.[type] AS [Memory Clerk Type],
CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)]
FROM sys.dm_os_memory_clerks AS mc WITH (NOLOCK)
GROUP BY mc.[type]
ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE);
------
-- MEMORYCLERK_SQLBUFFERPOOL was new for SQL Server 2012. It should be your highest consumer of memory
-- CACHESTORE_SQLCP SQL Plans
-- These are cached SQL statements or batches that aren't in stored procedures, functions and triggers
-- Watch out for high values for CACHESTORE_SQLCP
-- Enabling 'optimize for ad hoc workloads' at the instance level can help reduce this
-- Running DBCC FREESYSTEMCACHE ('SQL Plans') periodically may be required to better control this
-- CACHESTORE_OBJCP Object Plans
-- These are compiled plans for stored procedures, functions and triggers
-- sys.dm_os_memory_clerks (Transact-SQL)
-- https://bit.ly/2H31xDR
-- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 46) (Ad hoc Queries)
SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], t.[text] AS [Query Text],
cp.objtype AS [Object Type], cp.cacheobjtype AS [Cache Object Type],
cp.size_in_bytes/1024 AS [Plan Size in KB]
FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
WHERE cp.cacheobjtype = N'Compiled Plan'
AND cp.objtype IN (N'Adhoc', N'Prepared')
AND cp.usecounts = 1
ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE);
------
-- Gives you the text, type and size of single-use ad-hoc and prepared queries that waste space in the plan cache
-- Enabling 'optimize for ad hoc workloads' for the instance can help (SQL Server 2008 and above only)
-- Running DBCC FREESYSTEMCACHE ('SQL Plans') periodically may be required to better control this
-- Enabling forced parameterization for the database can help, but test first!
-- Plan cache, adhoc workloads and clearing the single-use plan cache bloat
-- https://bit.ly/2EfYOkl
-- Get top total logical reads queries for entire instance (Query 47) (Top Logical Reads Queries)
SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name],
REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text],
qs.total_logical_reads AS [Total Logical Reads],
qs.min_logical_reads AS [Min Logical Reads],
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
qs.max_logical_reads AS [Max Logical Reads],
qs.min_worker_time AS [Min Worker Time],
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
qs.max_worker_time AS [Max Worker Time],
qs.min_elapsed_time AS [Min Elapsed Time],
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
qs.max_elapsed_time AS [Max Elapsed Time],
qs.execution_count AS [Execution Count],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
qs.creation_time AS [Creation Time]
--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp
ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE);
------
-- Helps you find the most expensive queries from a memory perspective across the entire instance
-- Can also help track down parameter sniffing issues
-- Get top average elapsed time queries for entire instance (Query 48) (Top Avg Elapsed Time Queries)
SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name],
REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text],
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
qs.min_elapsed_time, qs.max_elapsed_time, qs.last_elapsed_time,
qs.execution_count AS [Execution Count],
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads],
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
qs.creation_time AS [Creation Time]
--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp
ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE);
------
-- Helps you find the highest average elapsed time queries across the entire instance
-- Can also help track down parameter sniffing issues
-- Look at UDF execution statistics (Query 49) (UDF Stats by DB)
SELECT TOP (25) DB_NAME(database_id) AS [Database Name],
OBJECT_NAME(object_id, database_id) AS [Function Name],
total_worker_time, execution_count, total_elapsed_time,
total_elapsed_time/execution_count AS [avg_elapsed_time],
last_elapsed_time, last_execution_time, cached_time, [type_desc]
FROM sys.dm_exec_function_stats WITH (NOLOCK)
ORDER BY total_worker_time DESC OPTION (RECOMPILE);
------
-- sys.dm_exec_function_stats (Transact-SQL)
-- https://bit.ly/2q1Q6BM
-- Showplan Enhancements for UDFs
-- https://bit.ly/2LVqiQ1
-- Database specific queries *****************************************************************
-- **** Please switch to a user database that you are interested in! *****
--USE YourDatabaseName; -- make sure to change to an actual database on your instance, not the master system database
--GO
-- Individual File Sizes and space available for current database (Query 50) (File Sizes and Space)
SELECT f.name AS [File Name] , f.physical_name AS [Physical Name],
CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB],
CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2))
AS [Available Space In MB],
CAST((f.size/128.0) AS DECIMAL(15,2)) -
CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) AS [Used Space in MB],
f.[file_id], fg.name AS [Filegroup Name],
f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only,
fg.is_autogrow_all_files
FROM sys.database_files AS f WITH (NOLOCK)
LEFT OUTER JOIN sys.filegroups AS fg WITH (NOLOCK)
ON f.data_space_id = fg.data_space_id
ORDER BY f.[file_id] OPTION (RECOMPILE);
------
-- Look at how large and how full the files are and where they are located
-- Make sure the transaction log is not full!!
-- is_autogrow_all_files is new for SQL Server 2016. Equivalent to TF 1117 for user databases
-- SQL Server 2016: Changes in default behavior for autogrow and allocations for tempdb and user databases
-- https://bit.ly/2evRZSR
-- Log space usage for current database (Query 51) (Log Space Usage)
SELECT DB_NAME(lsu.database_id) AS [Database Name], db.recovery_model_desc AS [Recovery Model],
CAST(lsu.total_log_size_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Total Log Space (MB)],
CAST(lsu.used_log_space_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space (MB)],
CAST(lsu.used_log_space_in_percent AS DECIMAL(10, 2)) AS [Used Log Space %],
CAST(lsu.log_space_in_bytes_since_last_backup/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space Since Last Backup (MB)],
db.log_reuse_wait_desc
FROM sys.dm_db_log_space_usage AS lsu WITH (NOLOCK)
INNER JOIN sys.databases AS db WITH (NOLOCK)
ON lsu.database_id = db.database_id
OPTION (RECOMPILE);
------
-- Look at log file size and usage, along with the log reuse wait description for the current database
-- sys.dm_db_log_space_usage (Transact-SQL)
-- https://bit.ly/2H4MQw9
-- Status of last VLF for current database (Query 52) (Last VLF Status)
SELECT TOP(1) DB_NAME(li.database_id) AS [Database Name], li.[file_id],
li.vlf_size_mb, li.vlf_sequence_number, li.vlf_active, li.vlf_status
FROM sys.dm_db_log_info(DB_ID()) AS li
ORDER BY vlf_sequence_number DESC OPTION (RECOMPILE);
------
-- Determine whether you will be able to shrink the transaction log file
-- vlf_status Values
-- 0 is inactive
-- 1 is initialized but unused
-- 2 is active
-- sys.dm_db_log_info (Transact-SQL)
-- https://bit.ly/2EQUU1v
-- Get database scoped configuration values for current database (Query 53) (Database-scoped Configurations)
SELECT configuration_id, name, [value] AS [value_for_primary], value_for_secondary
FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE);
------
-- This lets you see the value of these new properties for the current database
-- Clear plan cache for current database
-- ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE;
-- ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)
-- https://bit.ly/2sOH7nb
-- I/O Statistics by file for the current database (Query 54) (IO Stats By File)
SELECT DB_NAME(DB_ID()) AS [Database Name], df.name AS [Logical Name], vfs.[file_id], df.type_desc,
df.physical_name AS [Physical Name], CAST(vfs.size_on_disk_bytes/1048576.0 AS DECIMAL(16, 2)) AS [Size on Disk (MB)],
vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms,
CAST(100. * vfs.io_stall_read_ms/(vfs.io_stall_read_ms + vfs.io_stall_write_ms) AS DECIMAL(16,1)) AS [IO Stall Reads Pct],
CAST(100. * vfs.io_stall_write_ms/(vfs.io_stall_write_ms + vfs.io_stall_read_ms) AS DECIMAL(16,1)) AS [IO Stall Writes Pct],
(vfs.num_of_reads + vfs.num_of_writes) AS [Writes + Reads],
CAST(vfs.num_of_bytes_read/1048576.0 AS DECIMAL(16, 2)) AS [MB Read],
CAST(vfs.num_of_bytes_written/1048576.0 AS DECIMAL(16, 2)) AS [MB Written],
CAST(100. * vfs.num_of_reads/(vfs.num_of_reads + vfs.num_of_writes) AS DECIMAL(16,1)) AS [# Reads Pct],
CAST(100. * vfs.num_of_writes/(vfs.num_of_reads + vfs.num_of_writes) AS DECIMAL(16,1)) AS [# Write Pct],
CAST(100. * vfs.num_of_bytes_read/(vfs.num_of_bytes_read + vfs.num_of_bytes_written) AS DECIMAL(16,1)) AS [Read Bytes Pct],
CAST(100. * vfs.num_of_bytes_written/(vfs.num_of_bytes_read + vfs.num_of_bytes_written) AS DECIMAL(16,1)) AS [Written Bytes Pct]
FROM sys.dm_io_virtual_file_stats(DB_ID(), NULL) AS vfs
INNER JOIN sys.database_files AS df WITH (NOLOCK)
ON vfs.[file_id]= df.[file_id] OPTION (RECOMPILE);
------
-- This helps you characterize your workload better from an I/O perspective for this database
-- It helps you determine whether you has an OLTP or DW/DSS type of workload
-- Get most frequently executed queries for this database (Query 55) (Query Execution Counts)
SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count],
qs.total_logical_reads AS [Total Logical Reads],
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
qs.total_worker_time AS [Total Worker Time],
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
qs.total_elapsed_time AS [Total Elapsed Time],
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
qs.creation_time AS [Creation Time]
--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp
WHERE t.dbid = DB_ID()
ORDER BY qs.execution_count DESC OPTION (RECOMPILE);
------
-- Queries 56 through 62 are the "Bad Man List" for stored procedures
-- Top Cached SPs By Execution Count (Query 56) (SP Execution Counts)
SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count],
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time],
FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
FROM sys.procedures AS p WITH (NOLOCK)
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
ON p.[object_id] = qs.[object_id]
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.database_id = DB_ID()
AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0
ORDER BY qs.execution_count DESC OPTION (RECOMPILE);
------
-- Tells you which cached stored procedures are called the most often
-- This helps you characterize and baseline your workload
-- It also helps you find possible caching opportunities
-- Top Cached SPs By Avg Elapsed Time (Query 57) (SP Avg Elapsed Time)
SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count,
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
qs.total_worker_time/qs.execution_count AS [AvgWorkerTime],
qs.total_worker_time AS [TotalWorkerTime],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time],
FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
FROM sys.procedures AS p WITH (NOLOCK)
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
ON p.[object_id] = qs.[object_id]
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.database_id = DB_ID()
AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0
ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE);
------
-- This helps you find high average elapsed time cached stored procedures that
-- may be easy to optimize with standard query tuning techniques
-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 58) (SP Worker Time)
SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime],
qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count,
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time],
FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
FROM sys.procedures AS p WITH (NOLOCK)
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
ON p.[object_id] = qs.[object_id]
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.database_id = DB_ID()
AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0
ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE);
------
-- This helps you find the most expensive cached stored procedures from a CPU perspective
-- You should look at this if you see signs of CPU pressure
-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 59) (SP Logical Reads)
SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads],
qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count,
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time],
FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
FROM sys.procedures AS p WITH (NOLOCK)
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
ON p.[object_id] = qs.[object_id]
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.database_id = DB_ID()
AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0
ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE);
------
-- This helps you find the most expensive cached stored procedures from a memory perspective
-- You should look at this if you see signs of memory pressure
-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 60) (SP Physical Reads)
SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads],
qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count,
qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time],
FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
FROM sys.procedures AS p WITH (NOLOCK)
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
ON p.[object_id] = qs.[object_id]
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.database_id = DB_ID()
AND qs.total_physical_reads > 0
ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOMPILE);
------
-- This helps you find the most expensive cached stored procedures from a read I/O perspective
-- You should look at this if you see signs of I/O pressure or of memory pressure
-- Top Cached SPs By Total Logical Writes (Query 61) (SP Logical Writes)
-- Logical writes relate to both memory and disk I/O pressure
SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites],
qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count,
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time],
FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
FROM sys.procedures AS p WITH (NOLOCK)
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
ON p.[object_id] = qs.[object_id]
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.database_id = DB_ID()
AND qs.total_logical_writes > 0
AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0
ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE);
------
-- This helps you find the most expensive cached stored procedures from a write I/O perspective
-- You should look at this if you see signs of I/O pressure or of memory pressure
-- Cached SPs Missing Indexes by Execution Count (Query 62) (SP Missing Index)
SELECT TOP(25) p.name AS [SP Name], qs.execution_count AS [Execution Count],
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time],
FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
FROM sys.procedures AS p WITH (NOLOCK)
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
ON p.[object_id] = qs.[object_id]
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.database_id = DB_ID()
AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0
AND CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%'
ORDER BY qs.execution_count DESC OPTION (RECOMPILE);
------
-- This helps you find the most frequently executed cached stored procedures that have missing index warnings
-- This can often help you find index tuning candidates
-- Lists the top statements by average input/output usage for the current database (Query 63) (Top IO Statements)
SELECT TOP(50) OBJECT_NAME(qt.objectid, dbid) AS [SP Name],
(qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count AS [Avg IO], qs.execution_count AS [Execution Count],
SUBSTRING(qt.[text],qs.statement_start_offset/2,
(CASE
WHEN qs.statement_end_offset = -1
THEN LEN(CONVERT(nvarchar(max), qt.[text])) * 2
ELSE qs.statement_end_offset
END - qs.statement_start_offset)/2) AS [Query Text]
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
WHERE qt.[dbid] = DB_ID()
ORDER BY [Avg IO] DESC OPTION (RECOMPILE);
------
-- Helps you find the most expensive statements for I/O by SP
-- Possible Bad NC Indexes (writes > reads) (Query 64) (Bad NC Indexes)
SELECT SCHEMA_NAME(o.[schema_id]) AS [Schema Name],
OBJECT_NAME(s.[object_id]) AS [Table Name],
i.name AS [Index Name], i.index_id,
i.is_disabled, i.is_hypothetical, i.has_filter, i.fill_factor,
s.user_updates AS [Total Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads],
s.user_updates - (s.user_seeks + s.user_scans + s.user_lookups) AS [Difference]
FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK)
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON s.[object_id] = i.[object_id]
AND i.index_id = s.index_id
INNER JOIN sys.objects AS o WITH (NOLOCK)
ON i.[object_id] = o.[object_id]
WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1
AND s.database_id = DB_ID()
AND s.user_updates > (s.user_seeks + s.user_scans + s.user_lookups)
AND i.index_id > 1 AND i.[type_desc] = N'NONCLUSTERED'
AND i.is_primary_key = 0 AND i.is_unique_constraint = 0 AND i.is_unique = 0
ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOMPILE);
------
-- Look for indexes with high numbers of writes and zero or very low numbers of reads
-- Consider your complete workload, and how long your instance has been running
-- Investigate further before dropping an index!
-- Missing Indexes for current database by Index Advantage (Query 65) (Missing Indexes)
SELECT DISTINCT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage],
migs.last_user_seek, mid.[statement] AS [Database.Schema.Table],
mid.equality_columns, mid.inequality_columns, mid.included_columns,
migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact,
OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows]
FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK)
INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK)
ON migs.group_handle = mig.index_group_handle
INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK)
ON mig.index_handle = mid.index_handle
INNER JOIN sys.partitions AS p WITH (NOLOCK)
ON p.[object_id] = mid.[object_id]
WHERE mid.database_id = DB_ID()
AND p.index_id < 2
ORDER BY index_advantage DESC OPTION (RECOMPILE);
------
-- Look at index advantage, last user seek time, number of user seeks to help determine source and importance
-- SQL Server is overly eager to add included columns, so beware
-- Do not just blindly add indexes that show up from this query!!!
-- <NAME> has given me some great suggestions for this query
-- Find missing index warnings for cached plans in the current database (Query 66) (Missing Index Warnings)
-- Note: This query could take some time on a busy instance
SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName],
cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan
FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp
WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%'
AND dbid = DB_ID()
ORDER BY cp.usecounts DESC OPTION (RECOMPILE);
------
-- Helps you connect missing indexes to specific stored procedures or queries
-- This can help you decide whether to add them or not
-- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 67) (Buffer Usage)
-- Note: This query could take some time on a busy instance
SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name],
OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id,
CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)],
COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count],
p.data_compression_desc AS [Compression Type]
FROM sys.allocation_units AS a WITH (NOLOCK)
INNER JOIN sys.dm_os_buffer_descriptors AS b WITH (NOLOCK)
ON a.allocation_unit_id = b.allocation_unit_id
INNER JOIN sys.partitions AS p WITH (NOLOCK)
ON a.container_id = p.hobt_id
INNER JOIN sys.objects AS o WITH (NOLOCK)
ON p.object_id = o.object_id
INNER JOIN sys.database_files AS f WITH (NOLOCK)
ON b.file_id = f.file_id
INNER JOIN sys.filegroups AS fg WITH (NOLOCK)
ON f.data_space_id = fg.data_space_id
WHERE b.database_id = CONVERT(int, DB_ID())
AND p.[object_id] > 100
AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%'
AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%'
AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%'
GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id,
p.data_compression_desc, p.[Rows]
ORDER BY [BufferCount] DESC OPTION (RECOMPILE);
------
-- Tells you what tables and indexes are using the most memory in the buffer cache
-- It can help identify possible candidates for data compression
-- Get Table names, row counts, and compression status for clustered index or heap (Query 68) (Table Sizes)
SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName],
SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type]
FROM sys.partitions AS p WITH (NOLOCK)
INNER JOIN sys.objects AS o WITH (NOLOCK)
ON p.object_id = o.object_id
WHERE index_id < 2 --ignore the partitions from the non-clustered index if any
AND OBJECT_NAME(p.object_id) NOT LIKE N'sys%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'spt_%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'queue_%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'filestream_tombstone%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'fulltext%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'ifts_comp_fragment%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'filetable_updates%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'xml_index_nodes%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'sqlagent_job%'
AND OBJECT_NAME(p.object_id) NOT LIKE N'plan_persist%'
GROUP BY SCHEMA_NAME(o.Schema_ID), p.object_id, data_compression_desc
ORDER BY SUM(p.Rows) DESC OPTION (RECOMPILE);
------
-- Gives you an idea of table sizes, and possible data compression opportunities
-- Get some key table properties (Query 69) (Table Properties)
SELECT OBJECT_NAME(t.[object_id]) AS [ObjectName], p.[rows] AS [Table Rows], p.index_id,
p.data_compression_desc AS [Index Data Compression],
t.create_date, t.lock_on_bulk_load, t.is_replicated, t.has_replication_filter,
t.is_tracked_by_cdc, t.lock_escalation_desc, t.is_filetable,
t.is_memory_optimized, t.durability_desc,
t.temporal_type_desc, t.is_remote_data_archive_enabled, t.is_external -- new for SQL Server 2016
FROM sys.tables AS t WITH (NOLOCK)
INNER JOIN sys.partitions AS p WITH (NOLOCK)
ON t.[object_id] = p.[object_id]
WHERE OBJECT_NAME(t.[object_id]) NOT LIKE N'sys%'
ORDER BY OBJECT_NAME(t.[object_id]), p.index_id OPTION (RECOMPILE);
------
-- Gives you some good information about your tables
-- is_memory_optimized and durability_desc were new in SQL Server 2014
-- temporal_type_desc, is_remote_data_archive_enabled, is_external were new in SQL Server 2016
-- sys.tables (Transact-SQL)
-- https://bit.ly/2Gk7998
-- When were Statistics last updated on all indexes? (Query 70) (Statistics Update)
SELECT SCHEMA_NAME(o.Schema_ID) + N'.' + o.[NAME] AS [Object Name], o.[type_desc] AS [Object Type],
i.[name] AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date],
s.auto_created, s.no_recompute, s.user_created, s.is_incremental, s.is_temporary,
st.row_count, st.used_page_count
FROM sys.objects AS o WITH (NOLOCK)
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON o.[object_id] = i.[object_id]
INNER JOIN sys.stats AS s WITH (NOLOCK)
ON i.[object_id] = s.[object_id]
AND i.index_id = s.stats_id
INNER JOIN sys.dm_db_partition_stats AS st WITH (NOLOCK)
ON o.[object_id] = st.[object_id]
AND i.[index_id] = st.[index_id]
WHERE o.[type] IN ('U', 'V')
AND st.row_count > 0
ORDER BY STATS_DATE(i.[object_id], i.index_id) DESC OPTION (RECOMPILE);
------
-- Helps discover possible problems with out-of-date statistics
-- Also gives you an idea which indexes are the most active
-- sys.stats (Transact-SQL)
-- https://bit.ly/2GyAxrn
-- UPDATEs to Statistics (<NAME>)
-- https://bit.ly/2vhrYQy
-- Look at most frequently modified indexes and statistics (Query 71) (Volatile Indexes)
SELECT o.[name] AS [Object Name], o.[object_id], o.[type_desc], s.[name] AS [Statistics Name],
s.stats_id, s.no_recompute, s.auto_created, s.is_incremental, s.is_temporary,
sp.modification_counter, sp.[rows], sp.rows_sampled, sp.last_updated
FROM sys.objects AS o WITH (NOLOCK)
INNER JOIN sys.stats AS s WITH (NOLOCK)
ON s.object_id = o.object_id
CROSS APPLY sys.dm_db_stats_properties(s.object_id, s.stats_id) AS sp
WHERE o.[type_desc] NOT IN (N'SYSTEM_TABLE', N'INTERNAL_TABLE')
AND sp.modification_counter > 0
ORDER BY sp.modification_counter DESC, o.name OPTION (RECOMPILE);
------
-- This helps you understand your workload and make better decisions about
-- things like data compression and adding new indexes to a table
-- Get fragmentation info for all indexes above a certain size in the current database (Query 72) (Index Fragmentation)
-- Note: This query could take some time on a very large database
SELECT DB_NAME(ps.database_id) AS [Database Name], SCHEMA_NAME(o.[schema_id]) AS [Schema Name],
OBJECT_NAME(ps.OBJECT_ID) AS [Object Name], i.[name] AS [Index Name], ps.index_id,
ps.index_type_desc, ps.avg_fragmentation_in_percent,
ps.fragment_count, ps.page_count, i.fill_factor, i.has_filter,
i.filter_definition, i.[allow_page_locks]
FROM sys.dm_db_index_physical_stats(DB_ID(),NULL, NULL, NULL , N'LIMITED') AS ps
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON ps.[object_id] = i.[object_id]
AND ps.index_id = i.index_id
INNER JOIN sys.objects AS o WITH (NOLOCK)
ON i.[object_id] = o.[object_id]
WHERE ps.database_id = DB_ID()
AND ps.page_count > 2500
ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE);
------
-- Helps determine whether you have framentation in your relational indexes
-- and how effective your index maintenance strategy is
--- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 73) (Overall Index Usage - Reads)
SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id,
s.user_seeks, s.user_scans, s.user_lookups,
s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads],
s.user_updates AS [Writes],
i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition,
s.last_user_scan, s.last_user_lookup, s.last_user_seek
FROM sys.indexes AS i WITH (NOLOCK)
LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK)
ON i.[object_id] = s.[object_id]
AND i.index_id = s.index_id
AND s.database_id = DB_ID()
WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1
ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads
------
-- Show which indexes in the current database are most active for Reads
--- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 74) (Overall Index Usage - Writes)
SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id,
s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads],
i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition,
s.last_system_update, s.last_user_update
FROM sys.indexes AS i WITH (NOLOCK)
LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK)
ON i.[object_id] = s.[object_id]
AND i.index_id = s.index_id
AND s.database_id = DB_ID()
WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1
ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes
------
-- Show which indexes in the current database are most active for Writes
-- Get in-memory OLTP index usage (Query 75) (XTP Index Usage)
SELECT OBJECT_NAME(i.[object_id]) AS [Object Name], i.index_id, i.[name] AS [Index Name],
i.[type_desc], xis.scans_started, xis.scans_retries,
xis.rows_touched, xis.rows_returned
FROM sys.dm_db_xtp_index_stats AS xis WITH (NOLOCK)
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON i.[object_id] = xis.[object_id]
AND i.index_id = xis.index_id
ORDER BY OBJECT_NAME(i.[object_id]) OPTION (RECOMPILE);
------
-- This gives you some index usage statistics for in-memory OLTP
-- Returns no data if you are not using in-memory OLTP
-- Guidelines for Using Indexes on Memory-Optimized Tables
-- https://bit.ly/2GCP8lF
-- Look at Columnstore index physical statistics (Query 76) (Columnstore Index Physical Stat)
SELECT OBJECT_NAME(ps.object_id) AS [TableName],
i.[name] AS [IndexName], ps.index_id, ps.partition_number,
ps.delta_store_hobt_id, ps.state_desc, ps.total_rows, ps.size_in_bytes,
ps.trim_reason_desc, ps.generation, ps.transition_to_compressed_state_desc,
ps.has_vertipaq_optimization, ps.deleted_rows,
100 * (ISNULL(ps.deleted_rows, 0))/ps.total_rows AS [Fragmentation]
FROM sys.dm_db_column_store_row_group_physical_stats AS ps WITH (NOLOCK)
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON ps.object_id = i.object_id
AND ps.index_id = i.index_id
ORDER BY ps.object_id, ps.partition_number, ps.row_group_id OPTION (RECOMPILE);
------
-- sys.dm_db_column_store_row_group_physical_stats (Transact-SQL)
-- https://bit.ly/2q276XQ
-- Get lock waits for current database (Query 77) (Lock Waits)
SELECT o.name AS [table_name], i.name AS [index_name], ios.index_id, ios.partition_number,
SUM(ios.row_lock_wait_count) AS [total_row_lock_waits],
SUM(ios.row_lock_wait_in_ms) AS [total_row_lock_wait_in_ms],
SUM(ios.page_lock_wait_count) AS [total_page_lock_waits],
SUM(ios.page_lock_wait_in_ms) AS [total_page_lock_wait_in_ms],
SUM(ios.page_lock_wait_in_ms)+ SUM(row_lock_wait_in_ms) AS [total_lock_wait_in_ms]
FROM sys.dm_db_index_operational_stats(DB_ID(), NULL, NULL, NULL) AS ios
INNER JOIN sys.objects AS o WITH (NOLOCK)
ON ios.[object_id] = o.[object_id]
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON ios.[object_id] = i.[object_id]
AND ios.index_id = i.index_id
WHERE o.[object_id] > 100
GROUP BY o.name, i.name, ios.index_id, ios.partition_number
HAVING SUM(ios.page_lock_wait_in_ms)+ SUM(row_lock_wait_in_ms) > 0
ORDER BY total_lock_wait_in_ms DESC OPTION (RECOMPILE);
------
-- This query is helpful for troubleshooting blocking and deadlocking issues
-- Look at UDF execution statistics (Query 78) (UDF Statistics)
SELECT OBJECT_NAME(object_id) AS [Function Name], execution_count,
total_worker_time, total_logical_reads, total_physical_reads, total_elapsed_time,
total_elapsed_time/execution_count AS [avg_elapsed_time],
FORMAT(cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time]
FROM sys.dm_exec_function_stats WITH (NOLOCK)
WHERE database_id = DB_ID()
ORDER BY total_worker_time DESC OPTION (RECOMPILE);
------
-- New for SQL Server 2016
-- Helps you investigate scalar UDF performance issues
-- Does not return information for table valued functions
-- sys.dm_exec_function_stats (Transact-SQL)
-- https://bit.ly/2q1Q6BM
-- Get QueryStore Options for this database (Query 79) (QueryStore Options)
SELECT actual_state_desc, desired_state_desc, [interval_length_minutes],
current_storage_size_mb, [max_storage_size_mb],
query_capture_mode_desc, size_based_cleanup_mode_desc
FROM sys.database_query_store_options WITH (NOLOCK) OPTION (RECOMPILE);
------
-- New for SQL Server 2016
-- Requires that Query Store is enabled for this database
-- Make sure that the actual_state_desc is the same as desired_state_desc
-- Make sure that the current_storage_size_mb is less than the max_storage_size_mb
-- Tuning Workload Performance with Query Store
-- https://bit.ly/1kHSl7w
-- Get input buffer information for the current database (Query 80) (Input Buffer)
SELECT es.session_id, DB_NAME(es.database_id) AS [Database Name],
es.login_time, es.cpu_time, es.logical_reads, es.memory_usage,
es.[status], ib.event_info AS [Input Buffer]
FROM sys.dm_exec_sessions AS es WITH (NOLOCK)
CROSS APPLY sys.dm_exec_input_buffer(es.session_id, NULL) AS ib
WHERE es.database_id = DB_ID()
AND es.session_id > 50
AND es.session_id <> @@SPID OPTION (RECOMPILE);
------
-- Gives you input buffer information from all non-system sessions for the current database
-- Replaces DBCC INPUTBUFFER
-- New DMF for retrieving input buffer in SQL Server
-- https://bit.ly/2uHKMbz
-- sys.dm_exec_input_buffer (Transact-SQL)
-- https://bit.ly/2J5Hf9q
-- Look at recent Full backups for the current database (Query 81) (Recent Full Backups)
SELECT TOP (30) bs.machine_name, bs.server_name, bs.database_name AS [Database Name], bs.recovery_model,
CONVERT (BIGINT, bs.backup_size / 1048576 ) AS [Uncompressed Backup Size (MB)],
CONVERT (BIGINT, bs.compressed_backup_size / 1048576 ) AS [Compressed Backup Size (MB)],
CONVERT (NUMERIC (20,2), (CONVERT (FLOAT, bs.backup_size) /
CONVERT (FLOAT, bs.compressed_backup_size))) AS [Compression Ratio], bs.has_backup_checksums, bs.is_copy_only, bs.encryptor_type,
DATEDIFF (SECOND, bs.backup_start_date, bs.backup_finish_date) AS [Backup Elapsed Time (sec)],
bs.backup_finish_date AS [Backup Finish Date], bmf.physical_device_name AS [Backup Location], bmf.physical_block_size
FROM msdb.dbo.backupset AS bs WITH (NOLOCK)
INNER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK)
ON bs.media_set_id = bmf.media_set_id
WHERE bs.database_name = DB_NAME(DB_ID())
AND bs.[type] = 'D' -- Change to L if you want Log backups
ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE);
------
-- Are your backup sizes and times changing over time?
-- Are you using backup compression?
-- Are you using backup checksums?
-- Are you doing copy_only backups?
-- Are you doing encrypted backups?
-- Have you done any backup tuning with striped backups, or changing the parameters of the backup command?
-- In SQL Server 2016, native SQL Server backup compression actually works
-- much better with databases that are using TDE than in previous versions
-- https://bit.ly/28Rpb2x
-- These six Pluralsight Courses go into more detail about how to run these queries and interpret the results
-- Azure SQL Database: Diagnosing Performance Issues with DMVs
-- https://bit.ly/2meDRCN
-- SQL Server 2017: Diagnosing Performance Issues with DMVs
-- https://bit.ly/2FqCeti
-- SQL Server 2017: Diagnosing Configuration Issues with DMVs
-- https://bit.ly/2MSUDUL
-- SQL Server 2014 DMV Diagnostic Queries Part 1
-- https://bit.ly/2plxCer
-- SQL Server 2014 DMV Diagnostic Queries Part 2
-- https://bit.ly/2IuJpzI
-- SQL Server 2014 DMV Diagnostic Queries Part 3
-- https://bit.ly/2FIlCPb
-- Microsoft Visual Studio Dev Essentials
-- https://bit.ly/2qjNRxi
-- Microsoft Azure Learn
-- https://bit.ly/2O0Hacc
-- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017
-- https://bit.ly/2ftKVrX
|
-- file:psql_crosstab.sql ln:16 expect:true
ANALYZE ctv_data
|
<filename>src/__tests__/fixtures/concurrent-index-2/3_index-concurrently.sql<gh_stars>100-1000
-- postgres-migrations disable-transaction
CREATE INDEX CONCURRENTLY concurrent_index ON concurrent (id);
|
<reponame>rrpawar96/Fineract-1
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.
--
DROP TABLE IF EXISTS `c_cache`;
CREATE TABLE `c_cache` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`cache_type_enum` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `c_cache`
(`id`,`cache_type_enum`)
VALUES
(1, 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'READ_CACHE', 'CACHE', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'UPDATE_CACHE', 'CACHE', 'UPDATE', 0);
|
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prcBuildCalendar]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[prcBuildCalendar]
GO
CREATE PROCEDURE prcBuildCalendar
AS
delete t_FiscalDays where CalDate >= '2013-01-01'
insert t_FiscalDays
select * from t_cal where CalDate >= '2013-01-01'
-- Uses dbo.t_FiscalDays to build remaining tables in the calendar
-- *********************************************************
-- Build t_FiscalYears
-- *********************************************************
TRUNCATE TABLE dbo.t_FiscalYears
INSERT INTO
dbo.t_FiscalYears
(
FiscalYear,
BeginDate,
EndDate
)
SELECT
FiscalYear,
MIN(CalDate) AS BeginDate,
MAX(CalDate) AS EndDate
FROM
dbo.t_FiscalDays
GROUP BY
FiscalYear
ORDER BY
FiscalYear
-- *********************************************************
-- Build t_FiscalQuarters
-- *********************************************************
TRUNCATE TABLE dbo.t_FiscalQuarters
INSERT INTO
dbo.t_FiscalQuarters
(
FiscalYear,
FiscalQuarter,
BeginDate,
EndDate,
QuarterDesc,
BDate,
EDate,
WorkingDays,
QRAMPlan
)
SELECT
FiscalYear,
FiscalQuarter,
MIN(CalDate) AS BeginDate,
MAX(CalDate) AS EndDate,
'FY' + RIGHT(FiscalYear,2) + '-Q'
+ CAST(FiscalQuarter AS char(1)) AS QuarterDesc,
CAST(YEAR(MIN(CalDate)) AS char(4))
+ RIGHT('0' + CAST(MONTH(MIN(CalDate)) AS varchar(2)), 2)
+ RIGHT('0' + CAST(DAY(MIN(CalDate)) AS varchar(2)), 2) AS BDate,
CAST(YEAR(MAX(CalDate)) AS char(4))
+ RIGHT('0' + CAST(MONTH(MAX(CalDate)) AS varchar(2)), 2)
+ RIGHT('0' + CAST(DAY(MAX(CalDate)) AS varchar(2)), 2) AS EDate,
SUM(CAST(WorkingDay AS tinyint)) AS WorkingDays,
'FY' + RIGHT(FiscalYear,2) +
CASE
WHEN FiscalQuarter = 2 THEN ' Forecast I'
WHEN FiscalQuarter = 3 THEN ' Forecast II'
WHEN FiscalQuarter = 4 THEN ' Forecast III'
ELSE ''
END AS 'QRAM Plan'
FROM
dbo.t_FiscalDays
GROUP BY
FiscalYear,
FiscalQuarter,
'FY' + RIGHT(FiscalYear,2) + '-Q'
+ CAST(FiscalQuarter AS char(1))
ORDER BY
FiscalYear,
FiscalQuarter
-- *********************************************************
-- Build t_FiscalWeeks
-- *********************************************************
TRUNCATE TABLE dbo.t_FiscalWeeks
INSERT INTO
dbo.t_FiscalWeeks
(
FiscalYear,
FiscalQuarter,
FiscalPeriod,
FiscalWeek,
FiscalWkBegin,
FiscalWkEnd,
eDate,
WorkingDays
)
SELECT
FiscalYear,
FiscalQuarter,
FiscalPeriod,
FiscalWeek,
MIN(CalDate) AS WeekBegin,
MAX(CalDate) AS WeekEnd,
CAST(YEAR(MAX(CalDate)) AS char(4))
+ RIGHT('0' + CAST(MONTH(MAX(CalDate)) AS varchar(2)), 2)
+ RIGHT('0' + CAST(DAY(MAX(CalDate)) AS varchar(2)), 2) AS EDate,
SUM(CAST(WorkingDay AS tinyint)) AS WorkingDays
FROM
dbo.t_FiscalDays
GROUP BY
FiscalYear,
FiscalWeek,
FiscalPeriod,
FiscalQuarter
ORDER BY
FiscalYear,
FiscalQuarter,
FiscalPeriod,
FiscalWeek
-- *********************************************************
-- Build t_FiscalPeriods
-- *********************************************************
TRUNCATE TABLE dbo.t_FiscalPeriods
INSERT INTO
dbo.t_FiscalPeriods
(
FiscalYear,
FiscalQuarter,
FiscalPeriod,
FiscalPerBegin,
FiscalPerEnd,
FiscalQtrBegin,
FiscalQtrEnd,
FiscalYrBegin,
FiscalYrEnd,
CalendarMonth,
PeriodWeeks,
PeriodMfgDays,
PeriodDays
)
SELECT
D.FiscalYear,
D.FiscalQuarter,
D.FiscalPeriod,
MIN(CalDate) AS FiscalPerBegin,
MAX(CalDate) AS FiscalPerEnd,
Q.BeginDate AS FiscalQtrBegin,
Q.EndDate AS FiscalQtrEnd,
Y.BeginDate AS FiscalYrBegin,
Y.EndDate AS FiscalYrEnd,
MONTH(DATEADD(D,15,MIN(CalDate))) AS CalendarMonth,
W.NoOfWeeks,
SUM(CAST(WorkingDay AS tinyint))AS PerMfgDays,
COUNT(D.CalDate) AS PeriodDays
FROM
dbo.t_FiscalDays AS D
LEFT JOIN
dbo.t_FiscalQuarters AS Q
ON (D.FiscalYear = Q.FiscalYear)
AND (D.FiscalQuarter = Q.FiscalQuarter)
LEFT JOIN
dbo.t_FiscalYears AS Y
ON Q.FiscalYear = Y.FiscalYear
LEFT JOIN
(
SELECT
FiscalYear,
FiscalPeriod,
COUNT(FiscalWeek) AS NoOfWeeks
FROM
dbo.t_FiscalWeeks
GROUP BY
FiscalYear,
FiscalPeriod
)
AS W
ON (D.FiscalYear = W.FiscalYear)
AND (D.FiscalPeriod = W.FiscalPeriod)
GROUP BY
D.FiscalYear,
D.FiscalQuarter,
D.FiscalPeriod,
Q.BeginDate,
Q.EndDate,
Y.BeginDate,
Y.EndDate,
W.NoOfWeeks
ORDER BY
D.FiscalYear,
D.FiscalQuarter,
D.FiscalPeriod;
GO
|
<reponame>PNNL-Comp-Mass-Spec/DMS-Website
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE general_params ( "name" text, "value" text );
INSERT INTO "general_params" VALUES('list_report_data_table','V_Dataset_Separation_Type_Usage');
INSERT INTO "general_params" VALUES('list_report_helper_multiple_selection','no');
INSERT INTO "general_params" VALUES('list_report_data_sort_dir','DESC');
INSERT INTO "general_params" VALUES('list_report_data_sort_col','Usage Last 12 Months');
CREATE TABLE list_report_hotlinks ( id INTEGER PRIMARY KEY, "name" text, "LinkType" text, "WhichArg" text, "Target" text, "Options" text );
INSERT INTO "list_report_hotlinks" VALUES(1,'Separation Type','update_opener','Separation Type','separation_type/show','');
CREATE TABLE list_report_primary_filter ( id INTEGER PRIMARY KEY, "name" text, "label" text, "size" text, "value" text, "col" text, "cmp" text, "type" text, "maxlength" text, "rows" text, "cols" text );
INSERT INTO "list_report_primary_filter" VALUES(1,'pf_separation_type','Type','25!','','Separation Type','ContainsText','text','75','','');
INSERT INTO "list_report_primary_filter" VALUES(2,'pf_separation_type_comment','Comment','20','','Separation Type Comment','ContainsText','text','256','','');
INSERT INTO "list_report_primary_filter" VALUES(3,'pf_separation_group','Group','20','','Separation Group','ContainsText','text','50','','');
INSERT INTO "list_report_primary_filter" VALUES(4,'pf_sample_type','Sample Type','20','','Sample Type','ContainsText','text','75','','');
INSERT INTO "list_report_primary_filter" VALUES(5,'pf_dataset_usage_last_12_months','Usage (12 Mo)','20','','Usage Last 12 Months','GreaterThanOrEqualTo','text','20','','');
INSERT INTO "list_report_primary_filter" VALUES(6,'pf_dataset_usage_all_years','Usage All','20','','Dataset Usage All Years','GreaterThanOrEqualTo','text','20','','');
INSERT INTO "list_report_primary_filter" VALUES(7,'pf_most_recent_use','Most Recent','20','','Most Recent Use','LaterThan','text','20','','');
INSERT INTO "list_report_primary_filter" VALUES(8,'pf_active','Active','10!','','Active','Equals','text','20','','');
COMMIT;
|
select *
from public.clinical_events
-- where domain_name = 'Measurement'
ORDER BY random();
select *
from public.clinical_events
where value_code IS NOT NULL AND value_code != 'None:No matching concept'
;
select person_id, value_as_number, unit_code
from public.clinical_events
where event_code = 'LOINC:2093-3'
and value_as_number > 200
;
|
<reponame>Yuh06/spring-ecomer<filename>db/09.09.sql
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: spring_ecomer
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.33-MariaDB
/*!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 `app_user`
--
DROP TABLE IF EXISTS `app_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `app_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`sso_id` varchar(30) NOT NULL,
`password` varchar(100) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`status` int(2) DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `sso_id` (`sso_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `app_user`
--
LOCK TABLES `app_user` WRITE;
/*!40000 ALTER TABLE `app_user` DISABLE KEYS */;
INSERT INTO `app_user` VALUES (2,'vanhuu','$2a$10$RSiPycV7Joxfhn4EecDczue1/ccNAF50zk6K0aYHBZ2iXVStKrX4K','van','huu','<EMAIL>',1),(3,'huunv','$2a$10$RSiPycV7Joxfhn4EecDczue1/ccNAF50zk6K0aYHBZ2iXVStKrX4K','Long','huu','<EMAIL>',1),(4,'admin','$2a$10$RSiPycV7Joxfhn4EecDczue1/ccNAF50zk6K0aYHBZ2iXVStKrX4K','Admin','Long','<EMAIL>',1);
/*!40000 ALTER TABLE `app_user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `app_user_user_profile`
--
DROP TABLE IF EXISTS `app_user_user_profile`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `app_user_user_profile` (
`user_id` bigint(20) NOT NULL,
`user_profile_id` bigint(20) NOT NULL,
PRIMARY KEY (`user_id`,`user_profile_id`),
KEY `FK_USER_PROFILE` (`user_profile_id`),
CONSTRAINT `FK_APP_USER` FOREIGN KEY (`user_id`) REFERENCES `app_user` (`id`),
CONSTRAINT `FK_USER_PROFILE` FOREIGN KEY (`user_profile_id`) REFERENCES `user_profile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `app_user_user_profile`
--
LOCK TABLES `app_user_user_profile` WRITE;
/*!40000 ALTER TABLE `app_user_user_profile` DISABLE KEYS */;
INSERT INTO `app_user_user_profile` VALUES (2,1),(4,2);
/*!40000 ALTER TABLE `app_user_user_profile` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `block_home_main`
--
DROP TABLE IF EXISTS `block_home_main`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `block_home_main` (
`home_main_id` bigint(20) NOT NULL AUTO_INCREMENT,
`image` varchar(255) DEFAULT NULL,
`name` varchar(255) NOT NULL,
`href` varchar(255) DEFAULT NULL,
`category_id` varchar(255) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`status` int(2) DEFAULT '0',
PRIMARY KEY (`home_main_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `block_home_main`
--
LOCK TABLES `block_home_main` WRITE;
/*!40000 ALTER TABLE `block_home_main` DISABLE KEYS */;
/*!40000 ALTER TABLE `block_home_main` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `block_home_products`
--
DROP TABLE IF EXISTS `block_home_products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `block_home_products` (
`home_products_id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`content` text COMMENT '[{''lable'':''Laptop'', ''product_id'':[1,2,3,5]}]',
`status` int(2) DEFAULT '0',
PRIMARY KEY (`home_products_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `block_home_products`
--
LOCK TABLES `block_home_products` WRITE;
/*!40000 ALTER TABLE `block_home_products` DISABLE KEYS */;
/*!40000 ALTER TABLE `block_home_products` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `category`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `category` (
`category_id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`title` varchar(255) DEFAULT NULL,
`desc` varchar(255) NOT NULL,
`content` text,
`icon` varchar(255) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`status` int(2) DEFAULT '0',
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `category`
--
LOCK TABLES `category` WRITE;
/*!40000 ALTER TABLE `category` DISABLE KEYS */;
INSERT INTO `category` VALUES (50,'Hàng gia dụng',NULL,'',NULL,NULL,'2020-09-09 12:01:45','2020-09-09 12:02:24',1);
/*!40000 ALTER TABLE `category` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `config`
--
DROP TABLE IF EXISTS `config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `config` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`value` text COLLATE utf8_unicode_ci,
`note` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Bang config thong tin tren web';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `config`
--
LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'logo','oiroiorieorwwe.png','Day la Logo'),(2,'logo','logo2.png','Logo thu 2'),(3,'phone','02455878987','Hotline web site');
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `menu`
--
DROP TABLE IF EXISTS `menu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `menu` (
`menu_id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`href` varchar(255) DEFAULT NULL,
`category_id` varchar(255) DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`status` int(2) DEFAULT '0',
PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `menu`
--
LOCK TABLES `menu` WRITE;
/*!40000 ALTER TABLE `menu` DISABLE KEYS */;
/*!40000 ALTER TABLE `menu` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pages`
--
DROP TABLE IF EXISTS `pages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`cate` int(10) DEFAULT '0',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`desc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`content` text COLLATE utf8_unicode_ci,
`status` tinyint(2) DEFAULT '0',
`create_time` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pages`
--
LOCK TABLES `pages` WRITE;
/*!40000 ALTER TABLE `pages` DISABLE KEYS */;
INSERT INTO `pages` VALUES (14,2,'hanoi','fdfdf','We\'ll never share your email with anyone else.',NULL,NULL,0,NULL),(15,1,'Hot tháng 8','su kiệntháng 8','',NULL,'<p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>',1,NULL),(16,1,'Hot tháng 8','fdfdf','',NULL,'<p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>',0,NULL);
/*!40000 ALTER TABLE `pages` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `persistent_logins`
--
DROP TABLE IF EXISTS `persistent_logins`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `persistent_logins` (
`username` varchar(64) NOT NULL,
`series` varchar(64) NOT NULL,
`token` varchar(64) NOT NULL,
`last_used` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`series`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `persistent_logins`
--
LOCK TABLES `persistent_logins` WRITE;
/*!40000 ALTER TABLE `persistent_logins` DISABLE KEYS */;
/*!40000 ALTER TABLE `persistent_logins` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product`
--
DROP TABLE IF EXISTS `product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product` (
`product_id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`title` varchar(255) DEFAULT NULL,
`desc` varchar(255) NOT NULL,
`price_ref` int(10) DEFAULT '0',
`price_sale` int(10) DEFAULT '0',
`content` text,
`image` varchar(255) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`status` int(2) DEFAULT '0',
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product`
--
LOCK TABLES `product` WRITE;
/*!40000 ALTER TABLE `product` DISABLE KEYS */;
/*!40000 ALTER TABLE `product` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_category`
--
DROP TABLE IF EXISTS `product_category`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_category` (
`product_id` bigint(20) NOT NULL,
`category_id` bigint(20) NOT NULL,
PRIMARY KEY (`product_id`,`category_id`),
KEY `FK_PRODUCT` (`product_id`),
KEY `FK_CATEGORY` (`category_id`),
CONSTRAINT `FK_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON DELETE CASCADE,
CONSTRAINT `FK_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_category`
--
LOCK TABLES `product_category` WRITE;
/*!40000 ALTER TABLE `product_category` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_category` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_image`
--
DROP TABLE IF EXISTS `product_image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_image` (
`image_id` bigint(20) NOT NULL AUTO_INCREMENT,
`product_id` bigint(20) NOT NULL,
`is_president` varchar(255) DEFAULT NULL,
`is_slider` varchar(255) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`image_id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_image`
--
LOCK TABLES `product_image` WRITE;
/*!40000 ALTER TABLE `product_image` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_image` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_reviews`
--
DROP TABLE IF EXISTS `product_reviews`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_reviews` (
`review_id` bigint(20) NOT NULL AUTO_INCREMENT,
`product_id` bigint(20) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`star` decimal(4,2) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`content` text,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`review_id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_reviews`
--
LOCK TABLES `product_reviews` WRITE;
/*!40000 ALTER TABLE `product_reviews` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_reviews` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `spring_session`
--
DROP TABLE IF EXISTS `spring_session`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `spring_session` (
`PRIMARY_ID` char(36) NOT NULL,
`SESSION_ID` char(36) NOT NULL,
`CREATION_TIME` bigint(20) NOT NULL,
`LAST_ACCESS_TIME` bigint(20) NOT NULL,
`MAX_INACTIVE_INTERVAL` int(11) NOT NULL,
`EXPIRY_TIME` bigint(20) NOT NULL,
`PRINCIPAL_NAME` varchar(100) DEFAULT NULL,
PRIMARY KEY (`PRIMARY_ID`),
UNIQUE KEY `SPRING_SESSION_IX1` (`SESSION_ID`),
KEY `SPRING_SESSION_IX2` (`EXPIRY_TIME`),
KEY `SPRING_SESSION_IX3` (`PRINCIPAL_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `spring_session`
--
LOCK TABLES `spring_session` WRITE;
/*!40000 ALTER TABLE `spring_session` DISABLE KEYS */;
/*!40000 ALTER TABLE `spring_session` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `spring_session_attributes`
--
DROP TABLE IF EXISTS `spring_session_attributes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `spring_session_attributes` (
`SESSION_PRIMARY_ID` char(36) NOT NULL,
`ATTRIBUTE_NAME` varchar(200) NOT NULL,
`ATTRIBUTE_BYTES` blob NOT NULL,
PRIMARY KEY (`SESSION_PRIMARY_ID`,`ATTRIBUTE_NAME`),
CONSTRAINT `SPRING_SESSION_ATTRIBUTES_FK` FOREIGN KEY (`SESSION_PRIMARY_ID`) REFERENCES `spring_session` (`PRIMARY_ID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `spring_session_attributes`
--
LOCK TABLES `spring_session_attributes` WRITE;
/*!40000 ALTER TABLE `spring_session_attributes` DISABLE KEYS */;
/*!40000 ALTER TABLE `spring_session_attributes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tcount_tbl`
--
DROP TABLE IF EXISTS `tcount_tbl`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tcount_tbl` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`tutorial_author` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tutorial_count` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tcount_tbl`
--
LOCK TABLES `tcount_tbl` WRITE;
/*!40000 ALTER TABLE `tcount_tbl` DISABLE KEYS */;
INSERT INTO `tcount_tbl` VALUES (1,'mahran',20),(2,'mahnaz',0),(3,'Jen',0),(4,'Gill',0),(5,'<NAME>',1),(6,'Sanjay',1);
/*!40000 ALTER TABLE `tcount_tbl` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tutorials_tbl`
--
DROP TABLE IF EXISTS `tutorials_tbl`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tutorials_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tutorial_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tutorial_author` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`submission_date` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tutorials_tbl`
--
LOCK TABLES `tutorials_tbl` WRITE;
/*!40000 ALTER TABLE `tutorials_tbl` DISABLE KEYS */;
INSERT INTO `tutorials_tbl` VALUES (1,'Learn PHP','<NAME>','2007-05-24'),(2,'Learn MySQL','Abdul S','2007-05-24'),(3,'JAVA Tutorial','Sanjay','2007-05-06');
/*!40000 ALTER TABLE `tutorials_tbl` 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` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sso_id` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`first_name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` int(10) unsigned zerofill DEFAULT NULL,
`create_time` timestamp(6) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Bang thong tin user';
/*!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,'t3h','ORURIEURIE839283ID','Java','Web',NULL,NULL,NULL,NULL),(2,'t3hjava','ORURIEURIE839283ID','JPA','Web',NULL,NULL,NULL,NULL),(3,'hibernate','1234567','Hibernate','Web','016474878',NULL,NULL,NULL),(4,'java2','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(5,'java3','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(6,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(7,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(8,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(9,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(10,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(11,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(12,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL),(13,'java4','ORURIEURIE839283ID','Hibernate','Web',NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_permision`
--
DROP TABLE IF EXISTS `user_permision`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_permision` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`action` varchar(100) NOT NULL,
`roles` varchar(255) NOT NULL DEFAULT 'hasRole(''USER'')',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_permision`
--
LOCK TABLES `user_permision` WRITE;
/*!40000 ALTER TABLE `user_permision` DISABLE KEYS */;
INSERT INTO `user_permision` VALUES (3,'/admin/**','hasRole(\'ADMIN\')'),(6,'/admin/banner/**','hasRole(\'ADMIN\') or hasRole(\'DBA\')'),(7,'/admin/page/**','hasRole(\'ADMIN\') or hasRole(\'DBA\')'),(8,'/admin/block-home/**','hasRole(\'ADMIN\') or hasRole(\'DBA\')'),(9,'/admin/config/**','hasRole(\'ADMIN\') or hasRole(\'DBA\')'),(10,'/admin/menu/**','any'),(11,'/admin/add-user','hasRole(\'ADMIN\')'),(12,'/admin/delete-user-*','hasRole(\'ADMIN\')'),(13,'/admin/edit-user-*','hasRole(\'ADMIN\')'),(14,'/product/create','hasRole(\'ADMIN\') or hasRole(\'DBA\')');
/*!40000 ALTER TABLE `user_permision` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_profile`
--
DROP TABLE IF EXISTS `user_profile`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_profile` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_profile`
--
LOCK TABLES `user_profile` WRITE;
/*!40000 ALTER TABLE `user_profile` DISABLE KEYS */;
INSERT INTO `user_profile` VALUES (2,'ROLE_ADMIN'),(3,'ROLE_DBA'),(1,'ROLE_USER');
/*!40000 ALTER TABLE `user_profile` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-09-09 19:29:31
|
/*cin varchar(6), name varchar(20),
credits int(11), sem varchar(5)*/
alter table course modify column cin varchar(6);
/*-----------------3rd sem------------------*/
insert into course values('15cs31','daa','4','3');
insert into course values('15cs32','usp','4','3');
insert into course values('15cs33','dms','4','3');
insert into course values('15cs34','co','4','3');
insert into course values('15cs35','ade','4','3');
insert into course values('15cs36','m3','4','3');
/*-----------------4th sem------------------*/
insert into course values('15cs41','se','4','4');
insert into course values('15cs42','dc','4','4');
insert into course values('15cs43','ada','4','4');
insert into course values('15cs44','mpmc','4','4');
insert into course values('15cs45','m4','4','4');
insert into course values('15cs46','ooc','4','7');
/*-----------------5th sem------------------*/
insert into course values('15cs51','dbms','4','5');
insert into course values('15cs52','ajava','4','5');
insert into course values('15cs53','.NET','4','5');
insert into course values('15cs54','cn','4','5');
insert into course values('15cs55','me','4','5');
insert into course values('15cs56','atci','4','5');
/*-----------------6th sem------------------*/
insert into course values('15cs61','cns','4','6');
insert into course values('15cs62','cg','4','6');
insert into course values('15cs63','ss&cd','4','6');
insert into course values('15cs64','os','4','6');
insert into course values('15cs65','fs','4','6');
insert into course values('15cs66','st','4','6');
/*-----------------7th sem------------------*/
insert into course values('15cs71','wt','4','7');
insert into course values('15cs72','aca','4','7');
insert into course values('15cs73','cca','4','7');
insert into course values('15cs74','ml','4','7');
|
-- Creating/replacing product ranges table
create table if not exists wms.product_ranges (
id smallint not null primary key references agdc.dataset_type (id),
lat_min decimal not null,
lat_max decimal not null,
lon_min decimal not null,
lon_max decimal not null,
dates jsonb not null,
bboxes jsonb not null);
|
<filename>join_illness.sql<gh_stars>1-10
CREATE TABLE IF NOT EXISTS drugs(
MasterProductID INT,
ChronicIllness TEXT,
ATCLevel5Code TEXT,
EthicalCategoryName TEXT,
EthicalSubCategoryName TEXT
);
--CREATE UNIQUE INDEX product_id_drugs ON drugs(MasterProductID);
INSERT INTO drugs --(MasterProductID, ChronicIllness, ATCLevel5Code)
SELECT Drug_LookUp.MasterProductID,
COALESCE(ChronicIllness, "OTHER") ChronicIllness,
ATCLevel5Code,
EthicalCategoryName,
EthicalSubCategoryName
FROM Drug_LookUp LEFT OUTER JOIN ChronicIllness_LookUp
ON Drug_LookUp.MasterProductID = ChronicIllness_LookUp.MasterProductID;
|
<filename>QueryTranslator/WatDivQuerySet/SQL/WatDiv100M_Mix/ML10-2-R-7--SO-OS-SS-VP__WatDiv100M.sql<gh_stars>10-100
SELECT tab0.v1 AS v1 , tab6.v7 AS v7 , tab4.v5 AS v5 , tab5.v6 AS v6 , tab3.v4 AS v4 , tab8.v9 AS v9 , tab2.v3 AS v3 , tab7.v8 AS v8 , tab1.v2 AS v2 , tab9.v10 AS v10
FROM (SELECT obj AS v1
FROM gr__offers$$1$$
WHERE sub = 'wsdbm:Retailer9369'
) tab0
JOIN (SELECT sub AS v1 , obj AS v2
FROM gr__includes$$2$$
) tab1
ON(tab0.v1=tab1.v1)
JOIN (SELECT obj AS v3 , sub AS v2
FROM rev__hasReview$$3$$
) tab2
ON(tab1.v2=tab2.v2)
JOIN (SELECT obj AS v4 , sub AS v3
FROM rev__reviewer$$4$$
) tab3
ON(tab2.v3=tab3.v3)
JOIN (SELECT obj AS v5 , sub AS v4
FROM wsdbm__friendOf$$5$$
) tab4
ON(tab3.v4=tab4.v4)
JOIN (SELECT sub AS v5 , obj AS v6
FROM wsdbm__makesPurchase$$6$$
) tab5
ON(tab4.v5=tab5.v5)
JOIN (SELECT obj AS v7 , sub AS v6
FROM wsdbm__purchaseFor$$7$$
) tab6
ON(tab5.v6=tab6.v6)
JOIN (SELECT sub AS v7 , obj AS v8
FROM sorg__actor$$8$$
) tab7
ON(tab6.v7=tab7.v7)
JOIN (SELECT obj AS v9 , sub AS v8
FROM wsdbm__subscribes$$9$$
) tab8
ON(tab7.v8=tab8.v8)
JOIN (SELECT sub AS v9 , obj AS v10
FROM sorg__language$$10$$
) tab9
ON(tab8.v9=tab9.v9)
++++++Tables Statistic
sorg__actor$$8$$ 2 OS sorg__actor/wsdbm__subscribes
VP <sorg__actor> 164597
SO <sorg__actor><wsdbm__purchaseFor> 106862 0.65
OS <sorg__actor><wsdbm__subscribes> 32865 0.2
------
wsdbm__makesPurchase$$6$$ 0 VP wsdbm__makesPurchase/
VP <wsdbm__makesPurchase> 1499988
SO <wsdbm__makesPurchase><wsdbm__friendOf> 1499988 1.0
OS <wsdbm__makesPurchase><wsdbm__purchaseFor> 1499988 1.0
------
sorg__language$$10$$ 1 SO sorg__language/wsdbm__subscribes
VP <sorg__language> 63899
SO <sorg__language><wsdbm__subscribes> 50000 0.78
------
gr__offers$$1$$ 0 VP gr__offers/
VP <gr__offers> 1420053
OS <gr__offers><gr__includes> 1420053 1.0
------
wsdbm__subscribes$$9$$ 1 SO wsdbm__subscribes/sorg__actor
VP <wsdbm__subscribes> 1496552
SO <wsdbm__subscribes><sorg__actor> 171735 0.11
OS <wsdbm__subscribes><sorg__language> 1496552 1.0
------
wsdbm__purchaseFor$$7$$ 2 OS wsdbm__purchaseFor/sorg__actor
VP <wsdbm__purchaseFor> 1500000
SO <wsdbm__purchaseFor><wsdbm__makesPurchase> 1499988 1.0
OS <wsdbm__purchaseFor><sorg__actor> 72482 0.05
------
rev__reviewer$$4$$ 2 OS rev__reviewer/wsdbm__friendOf
VP <rev__reviewer> 1500000
SO <rev__reviewer><rev__hasReview> 1476843 0.98
OS <rev__reviewer><wsdbm__friendOf> 601949 0.4
------
gr__includes$$2$$ 2 OS gr__includes/rev__hasReview
VP <gr__includes> 900000
SO <gr__includes><gr__offers> 432735 0.48
OS <gr__includes><rev__hasReview> 179741 0.2
------
rev__hasReview$$3$$ 1 SO rev__hasReview/gr__includes
VP <rev__hasReview> 1476843
SO <rev__hasReview><gr__includes> 1437537 0.97
OS <rev__hasReview><rev__reviewer> 1476843 1.0
------
wsdbm__friendOf$$5$$ 2 OS wsdbm__friendOf/wsdbm__makesPurchase
VP <wsdbm__friendOf> 45092208
SO <wsdbm__friendOf><rev__reviewer> 13968837 0.31
OS <wsdbm__friendOf><wsdbm__makesPurchase> 7128374 0.16
------
|
<filename>pdf-cos/spec/Harness.ddl
-- Harness: testing harness
import Stdlib
import ResourceDict
import TextEffect
import FontCommon
import FontDict
import GenPdfValue
import Page
import PageTreeNode
import PdfValue
import Type0Font
import Type1Font
import FontDesc
import TextObj
import ContentStreamLight
def Test0Font : FontDict = MkType0Font (Type0Font (PartialType0Font
CommonFontWitness
(just Helvetica)
(just (PreDefEncoding "TestEnc"))
nothing))
def TestFont = MkType1Font Test1Font
def TestResrcs : ResourceDict = ResourceDict (PartialResourceDict
nothing
nothing
nothing
nothing
nothing
(just
(Insert "F16" TestFont
(Insert "F2" TestFont
(Insert "F3" TestFont
(Insert "F4" TestFont
empty)))))
nothing
nothing)
def TestRef : Ref = {
obj = 0;
gen = 0;
}
-- Main: the entry point
def Main = (ExtractContentStreamText (ContentStreamP TestResrcs))
-- TODO:
-- text extraction: properly support Type0 fonts
-- text extraction: properly support TrueType fonts
-- DDL: huge build times for dict list
-- DDL: compiler allows xor over ints, interpreter doesn't
-- SPEC: Type3 fonts: consider case where font is in scope for content
-- stream that defines its glyph
-- SPEC: Type3 fonts: may refer to resrc dicts, which may loop
|
<reponame>omegaleonidas/Api
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 02, 2021 at 08:51 PM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 7.3.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_taa`
--
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_100000_create_password_resets_table', 1),
(2, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(3, '2021_06_29_045906_create_user_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `personal_access_tokens`
--
CREATE TABLE `personal_access_tokens` (
`id` bigint(20) UNSIGNED NOT NULL,
`tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`tokenable_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_used_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `personal_access_tokens`
--
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `created_at`, `updated_at`) VALUES
(1, 'App\\Models\\user', 2, 'token-name ', '<KEY>', '[\"*\"]', NULL, '2021-07-04 01:04:29', '2021-07-04 01:04:29'),
(2, 'App\\Models\\user', 2, 'token-name ', '<PASSWORD>48', '[\"*\"]', NULL, '2021-07-04 01:04:48', '2021-07-04 01:04:48'),
(3, 'App\\Models\\user', 2, 'token-name ', '3<PASSWORD>2<PASSWORD>3<PASSWORD>cf<PASSWORD>', '[\"*\"]', NULL, '2021-07-04 01:54:48', '2021-07-04 01:54:48'),
(4, 'App\\Models\\user', 2, 'token', '4<PASSWORD>', '[\"*\"]', NULL, '2021-07-04 02:02:52', '2021-07-04 02:02:52'),
(5, 'App\\Models\\user', 2, 'token', 'db<PASSWORD>', '[\"*\"]', NULL, '2021-07-04 02:05:17', '2021-07-04 02:05:17'),
(6, 'App\\Models\\user', 2, 'token', '683925<PASSWORD>2b6b7<PASSWORD>4d49c276be571486<PASSWORD>9<PASSWORD>61e95<PASSWORD>', '[\"*\"]', NULL, '2021-07-04 02:06:03', '2021-07-04 02:06:03'),
(7, 'App\\Models\\user', 2, 'token', 'd1<PASSWORD>48832fb4<PASSWORD>9<PASSWORD>2619d40243<PASSWORD>3323<PASSWORD>9<PASSWORD>', '[\"*\"]', NULL, '2021-07-04 02:11:02', '2021-07-04 02:11:02'),
(8, 'App\\Models\\user', 2, 'token', '5<PASSWORD>4ec2846<PASSWORD>', '[\"*\"]', '2021-07-04 02:16:50', '2021-07-04 02:12:44', '2021-07-04 02:16:50'),
(10, 'App\\Models\\user', 2, 'token', '0<PASSWORD>', '[\"*\"]', '2021-08-12 05:31:51', '2021-07-04 04:59:00', '2021-08-12 05:31:51'),
(11, 'App\\Models\\user', 2, 'token', '1<PASSWORD>d89ea06b8369f9b', '[\"*\"]', NULL, '2021-08-09 03:22:18', '2021-08-09 03:22:18'),
(12, 'App\\Models\\user', 2, 'token', '54a07386584561b3bfb35f478beee57ba5014b9322eeb8a76a4683d27e6138a4', '[\"*\"]', NULL, '2021-08-09 06:27:51', '2021-08-09 06:27:51'),
(13, 'App\\Models\\user', 2, 'token', '35d6873e1a896c6a2c3217cdc39369057cf01e503fa6739f4eeeaa4d7ed83ed9', '[\"*\"]', '2021-08-28 01:24:57', '2021-08-09 06:36:01', '2021-08-28 01:24:57'),
(14, 'App\\Models\\user', 2, 'token', '4302cc0b6a9e0a671f09e2ef9260725ac22d2097c753ed3cf187436faf97f5b0', '[\"*\"]', '2021-08-09 20:28:14', '2021-08-09 20:25:57', '2021-08-09 20:28:14'),
(15, 'App\\Models\\user', 2, 'token', '8f71da1<PASSWORD>67f9a5fc5e0fb48a14847c081f150fdcafd2baaa14781b9', '[\"*\"]', '2021-08-09 22:03:55', '2021-08-09 20:29:47', '2021-08-09 22:03:55'),
(16, 'App\\Models\\user', 2, 'token', 'cf499d186bce0d00ea9f51923f9c31676915a508cb62f7e5dc689e2c11ad55a1', '[\"*\"]', '2021-08-10 07:00:12', '2021-08-09 22:04:47', '2021-08-10 07:00:12'),
(17, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-10 08:30:46', '2021-08-10 07:04:40', '2021-08-10 08:30:46'),
(18, 'App\\Models\\user', 2, 'token', '4d6d78350062c54d8ec03bac1713d497be9f402f8a831de2d176a278caafbaf3', '[\"*\"]', '2021-08-10 08:34:24', '2021-08-10 08:31:11', '2021-08-10 08:34:24'),
(19, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-10 08:36:38', '2021-08-10 08:34:39', '2021-08-10 08:36:38'),
(20, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-14 20:33:49', '2021-08-10 08:36:49', '2021-08-14 20:33:49'),
(21, 'App\\Models\\user', 1, 'token', 'e6dc7353e558635498c6279168f90965a6991e84b3a72abf90a79367d8887a15', '[\"*\"]', '2021-08-13 02:21:08', '2021-08-12 21:50:35', '2021-08-13 02:21:08'),
(22, 'App\\Models\\user', 1, 'token', '920681c22c43ee9d40ac8404ac1c7e36ec37ae7ceb75fc4b680fb6db638376e8', '[\"*\"]', '2021-08-13 03:14:34', '2021-08-13 02:25:31', '2021-08-13 03:14:34'),
(23, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-13 08:04:07', '2021-08-13 04:06:06', '2021-08-13 08:04:07'),
(24, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-13 08:05:15', '2021-08-13 08:04:25', '2021-08-13 08:05:15'),
(25, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-13 08:06:43', '2021-08-13 08:05:28', '2021-08-13 08:06:43'),
(26, 'App\\Models\\user', 2, 'token', 'f4fc2c9d04e31bb5e4467bbede073529af77686f4c8251f749505859fe0f3d4b', '[\"*\"]', '2021-08-13 08:56:06', '2021-08-13 08:50:37', '2021-08-13 08:56:06'),
(27, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-13 09:13:05', '2021-08-13 08:56:22', '2021-08-13 09:13:05'),
(28, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-13 09:25:39', '2021-08-13 09:13:22', '2021-08-13 09:25:39'),
(29, 'App\\Models\\user', 2, 'token', '8dc8ea793225e603cfd28de993975c9b475c8778cbac3daef75605aabce05f50', '[\"*\"]', '2021-08-13 11:15:03', '2021-08-13 11:13:57', '2021-08-13 11:15:03'),
(30, 'App\\Models\\user', 1, 'token', '42b374eb520ad49ad18733cca779073b635f48e95e2b951263b2d0fb023f2183', '[\"*\"]', '2021-08-14 20:35:29', '2021-08-14 20:34:24', '2021-08-14 20:35:29'),
(31, 'App\\Models\\user', 2, 'token', '50b47bb32b27913de24a2eec8d368fc7054a6b4dfaf4f02bb66387a717d2ec6e', '[\"*\"]', '2021-08-14 20:43:13', '2021-08-14 20:35:43', '2021-08-14 20:43:13'),
(32, 'App\\Models\\user', 2, 'token', '30dfdab4bdd652df782456790fddaaefe56b10a4b630e983c7ebf053d2b92e2b', '[\"*\"]', '2021-08-14 20:49:49', '2021-08-14 20:43:37', '2021-08-14 20:49:49'),
(33, 'App\\Models\\user', 1, 'token', 'fcaee543938af6956998579aef32b70d0d8f0129e763ebf3a69f87be73274751', '[\"*\"]', '2021-08-14 20:49:44', '2021-08-14 20:43:56', '2021-08-14 20:49:44'),
(34, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-16 02:50:23', '2021-08-14 21:14:25', '2021-08-16 02:50:23'),
(35, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-16 02:50:46', '2021-08-16 02:43:29', '2021-08-16 02:50:46'),
(36, 'App\\Models\\user', 8, 'token', '5536c34f0848e68a3df2e6509f1b87163e17e15f9a746369adf8ab286b897adc', '[\"*\"]', NULL, '2021-08-16 03:14:03', '2021-08-16 03:14:03'),
(37, 'App\\Models\\user', 8, 'token', '20007c77546f81328cac68e4494a38823f62de752e6995fcff758fbed62b98e7', '[\"*\"]', NULL, '2021-08-16 03:14:20', '2021-08-16 03:14:20'),
(38, 'App\\Models\\user', 8, 'token', '50894b7e97fee37a6b1bf859417125c459f004e9619ea342158dfb3ccaabb450', '[\"*\"]', NULL, '2021-08-16 03:14:21', '2021-08-16 03:14:21'),
(39, 'App\\Models\\user', 8, 'token', '6ca4a393782370ac0a621c983d59b6f5c03e64235e84e6a5bed19b285c36215d', '[\"*\"]', NULL, '2021-08-16 03:14:22', '2021-08-16 03:14:22'),
(40, 'App\\Models\\user', 8, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-16 03:15:22', '2021-08-16 03:15:22'),
(41, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-16 03:15:58', '2021-08-16 03:15:58'),
(42, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-16 03:15:58', '2021-08-16 03:15:58'),
(43, 'App\\Models\\user', 2, 'token', 'd306a0205a7fa8d59cb6482d813af9d47448985ec5fd10e4abda4ca514741249', '[\"*\"]', NULL, '2021-08-16 03:15:59', '2021-08-16 03:15:59'),
(44, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-16 03:15:59', '2021-08-16 03:15:59'),
(45, 'App\\Models\\user', 2, 'token', '64ab65410b7188ccdcd77af893e8f5e80b7120eeb5b10e83e111e739d87e3ebe', '[\"*\"]', NULL, '2021-08-16 03:16:09', '2021-08-16 03:16:09'),
(46, 'App\\Models\\user', 2, 'token', '0<PASSWORD>', '[\"*\"]', NULL, '2021-08-16 03:17:18', '2021-08-16 03:17:18'),
(47, 'App\\Models\\user', 1, 'token', 'cf<PASSWORD>462b<PASSWORD>513569<PASSWORD>98<PASSWORD>6fc9<PASSWORD>55cd365<PASSWORD>', '[\"*\"]', '2021-08-16 05:50:29', '2021-08-16 03:17:47', '2021-08-16 05:50:29'),
(48, 'App\\Models\\user', 1, 'token', '39e9660e8c5006e933eb24c16abe4e8fe1478b19f3290ceb71322a0400d16b54', '[\"*\"]', '2021-08-16 05:42:41', '2021-08-16 03:43:55', '2021-08-16 05:42:41'),
(49, 'App\\Models\\user', 1, 'token', '<KEY>', '[\"*\"]', '2021-08-16 09:42:03', '2021-08-16 05:55:37', '2021-08-16 09:42:03'),
(50, 'App\\Models\\user', 1, 'token', 'f1f52e6dc9a7e936e57d8b2f39d2660c7b5a5739927f8c149975c2a96a8eca74', '[\"*\"]', '2021-08-16 11:32:55', '2021-08-16 10:12:08', '2021-08-16 11:32:55'),
(51, 'App\\Models\\user', 9, 'token', '5328359dcae10ac2a8b00bc87ad293ee217b3eb1dae724c6a0c2287cf28a8e37', '[\"*\"]', '2021-08-16 19:29:55', '2021-08-16 11:33:14', '2021-08-16 19:29:55'),
(52, 'App\\Models\\user', 9, 'token', 'd86c5e5aa76bb9d18f173462bdcc68a8d06e71d0962e4dd3777560b6ab9fd5f7', '[\"*\"]', '2021-08-17 01:39:24', '2021-08-16 19:31:34', '2021-08-17 01:39:24'),
(53, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-16 20:18:32', '2021-08-16 19:43:59', '2021-08-16 20:18:32'),
(54, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-17 01:59:27', '2021-08-16 22:22:54', '2021-08-17 01:59:27'),
(55, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-17 01:48:52', '2021-08-17 01:41:54', '2021-08-17 01:48:52'),
(56, 'App\\Models\\user', 9, 'token', '24e699788569f1cc8b678292f82cd7e6881e8700e4134ab58ebc009e6511b42e', '[\"*\"]', '2021-08-17 03:44:16', '2021-08-17 01:50:16', '2021-08-17 03:44:16'),
(57, 'App\\Models\\user', 9, 'token', 'c6289e7c766cd41e79dd111a097642f6b20ac748521a85d20eee7d1c0b41cc83', '[\"*\"]', '2021-08-17 03:46:36', '2021-08-17 02:01:38', '2021-08-17 03:46:36'),
(58, 'App\\Models\\user', 9, 'token', 'b7f9a88bd244e5c3aece962cd442aba4abd1e599ce1520e72d078aef1c4aafb0', '[\"*\"]', '2021-08-21 06:46:29', '2021-08-17 03:47:38', '2021-08-21 06:46:29'),
(59, 'App\\Models\\user', 9, 'token', '84ef1d73497c34ada9fca81bb86d9041244aa89fe101251b5ff923eaf41aa123', '[\"*\"]', NULL, '2021-08-17 07:32:19', '2021-08-17 07:32:19'),
(60, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-17 09:15:32', '2021-08-17 07:32:20', '2021-08-17 09:15:32'),
(61, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-18 00:43:39', '2021-08-18 00:43:11', '2021-08-18 00:43:39'),
(62, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-21 07:56:58', '2021-08-18 00:45:59', '2021-08-21 07:56:58'),
(63, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-21 07:50:18', '2021-08-21 07:49:37', '2021-08-21 07:50:18'),
(64, 'App\\Models\\user', 9, 'token', '33c39428eb1dad7a263a020996d8da8f81bbca819c8d377be497ead4845b8fbe', '[\"*\"]', '2021-08-21 09:56:39', '2021-08-21 07:50:37', '2021-08-21 09:56:39'),
(65, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-21 07:57:26', '2021-08-21 07:57:11', '2021-08-21 07:57:26'),
(66, 'App\\Models\\user', 2, 'token', 'b8e73b6923c5f48dbd3d123fdefffccbf1f4ea1faf774ee6c88c831accf61c18', '[\"*\"]', '2021-08-21 07:58:02', '2021-08-21 07:57:48', '2021-08-21 07:58:02'),
(67, 'App\\Models\\user', 9, 'token', '<KEY>', '[\"*\"]', '2021-08-21 09:59:00', '2021-08-21 07:58:17', '2021-08-21 09:59:00'),
(68, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-27 19:45:22', '2021-08-27 01:05:22', '2021-08-27 19:45:22'),
(69, 'App\\Models\\user', 2, 'token', '7c554d76bd344e7f479cdb19593ea41cd731c69e94f3e9f204c549a73d94fb3f', '[\"*\"]', '2021-08-27 19:57:22', '2021-08-27 19:45:48', '2021-08-27 19:57:22'),
(70, 'App\\Models\\user', 2, 'token', '57f6a7e16c483f88ed10127fc26a3ffb1f7d1afb241ea3fa3627f2bfcac1c3ef', '[\"*\"]', '2021-08-27 20:36:01', '2021-08-27 19:46:16', '2021-08-27 20:36:01'),
(71, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-27 20:34:29', '2021-08-27 20:32:30', '2021-08-27 20:34:29'),
(72, 'App\\Models\\user', 1, 'token', '5dbe681a6c52516ad2338ac03269d7ef12c3fe7bc1556cd32336c5a136a1e519', '[\"*\"]', NULL, '2021-08-27 20:36:34', '2021-08-27 20:36:34'),
(73, 'App\\Models\\user', 1, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-27 20:38:07', '2021-08-27 20:38:07'),
(74, 'App\\Models\\user', 1, 'token', 'a158fa61cb441f3f3b85e64b9c0eb03e1518a3664b7107dc31c3999ad5a29430', '[\"*\"]', NULL, '2021-08-27 20:38:22', '2021-08-27 20:38:22'),
(75, 'App\\Models\\user', 2, 'token', '8f9fe242aa05064d72b5e9ba107f2db7d5e36fbda3cf4fe250641674c25f6849', '[\"*\"]', '2021-08-28 01:51:19', '2021-08-27 22:25:47', '2021-08-28 01:51:19'),
(76, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-28 02:32:36', '2021-08-28 01:57:02', '2021-08-28 02:32:36'),
(77, 'App\\Models\\user', 2, 'token', '<KEY>', '[\"*\"]', '2021-08-28 02:15:03', '2021-08-28 02:01:43', '2021-08-28 02:15:03'),
(78, 'App\\Models\\user', 11, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-28 02:15:27', '2021-08-28 02:15:27'),
(79, 'App\\Models\\user', 11, 'token', '<KEY>', '[\"*\"]', '2021-08-28 11:50:16', '2021-08-28 02:17:21', '2021-08-28 11:50:16'),
(80, 'App\\Models\\user', 1, 'token', 'a19d72c5c6ec782caa2ff1365e097748fbd6f51eb76866c88afaf4303fed5de6', '[\"*\"]', '2021-09-02 06:50:44', '2021-08-28 07:32:37', '2021-09-02 06:50:44'),
(81, 'App\\Models\\user', 1, 'token', '0a05b2fcc7e99fe9d4ad8b2288cbdfa9dc1eb2c78aede832afdadb8bf24<PASSWORD>', '[\"*\"]', '2021-08-28 09:06:35', '2021-08-28 07:36:37', '2021-08-28 09:06:35'),
(82, 'App\\Models\\user', 1, 'token', '8d73f4caad6c28f6435588f6bc9ffce0a03140266005693937b04139423ed7c7', '[\"*\"]', NULL, '2021-08-28 08:09:48', '2021-08-28 08:09:48'),
(83, 'App\\Models\\user', 1, 'token', 'f80a32cf886ccac99efe10e32eef0bc64567082002ecb25fee535e2a61bbaa8f', '[\"*\"]', '2021-08-28 11:20:36', '2021-08-28 08:10:55', '2021-08-28 11:20:36'),
(84, 'App\\Models\\user', 1, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-28 08:24:12', '2021-08-28 08:24:12'),
(85, 'App\\Models\\user', 1, 'token', '0<PASSWORD>64<PASSWORD>43<PASSWORD>3<PASSWORD>afb8369bfbe38c23ba26cbfb3', '[\"*\"]', NULL, '2021-08-28 08:24:15', '2021-08-28 08:24:15'),
(86, 'App\\Models\\user', 1, 'token', '3051383a34c638a5012263fab6b5aa121e9e2d40c1a842d6f07828ac7ac19606', '[\"*\"]', NULL, '2021-08-28 08:25:21', '2021-08-28 08:25:21'),
(87, 'App\\Models\\user', 1, 'token', '20dfe17002a94cb835f012985dac6466871c6eba9ff90f7d73976a47148ce03e', '[\"*\"]', NULL, '2021-08-28 08:25:39', '2021-08-28 08:25:39'),
(88, 'App\\Models\\user', 1, 'token', 'c0f499d7d17943b60a3e74ba5affc7de37f920b7b858efb2616404f50feb2c64', '[\"*\"]', NULL, '2021-08-28 08:30:42', '2021-08-28 08:30:42'),
(89, 'App\\Models\\user', 1, 'token', 'db2<PASSWORD>f4ebb1<PASSWORD>43<PASSWORD>95c9ce26ccd481<PASSWORD>9d37e874fe0fe5b221<PASSWORD>fdf', '[\"*\"]', NULL, '2021-08-28 08:34:07', '2021-08-28 08:34:07'),
(90, 'App\\Models\\user', 1, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-28 11:22:58', '2021-08-28 11:22:58'),
(91, 'App\\Models\\user', 1, 'token', '<KEY>', '[\"*\"]', '2021-08-28 11:40:08', '2021-08-28 11:23:25', '2021-08-28 11:40:08'),
(92, 'App\\Models\\user', 1, 'token', '1fd5<PASSWORD>1868dbcdeddb2213f22781f3<PASSWORD>c28525<PASSWORD>136fac4eb484', '[\"*\"]', '2021-09-01 05:05:29', '2021-08-28 11:40:56', '2021-09-01 05:05:29'),
(93, 'App\\Models\\user', 1, 'token', '19f06b8bfc69713166f84949ec18b0b0b5a39526ea7ff6a2ae108bc4f480c6d4', '[\"*\"]', '2021-09-01 10:24:28', '2021-08-28 11:50:52', '2021-09-01 10:24:28'),
(94, 'App\\Models\\user', 1, 'token', '<KEY>', '[\"*\"]', NULL, '2021-08-31 08:14:38', '2021-08-31 08:14:38'),
(95, 'App\\Models\\user', 1, 'token', 'cd188406a21555b308d6439d89ca9e271cedf17b716e46a1af74f73<PASSWORD>', '[\"*\"]', '2021-09-01 10:59:38', '2021-09-01 10:36:21', '2021-09-01 10:59:38'),
(96, 'App\\Models\\user', 23, 'token', '83c80981559923492addd6842a7a869c5e74f0fabd916fe9f3844494429b0736', '[\"*\"]', NULL, '2021-09-01 11:00:03', '2021-09-01 11:00:03'),
(97, 'App\\Models\\user', 23, 'token', '<KEY>', '[\"*\"]', '2021-09-02 11:46:39', '2021-09-01 11:02:18', '2021-09-02 11:46:39'),
(98, 'App\\Models\\user', 1, 'token', '7337f5856b0a706eb264e25c8382772e923b7691ada72d338cf39e3dfda5e0ac', '[\"*\"]', '2021-09-02 06:45:22', '2021-09-02 06:44:52', '2021-09-02 06:45:22'),
(99, 'App\\Models\\user', 1, 'token', '07a36fa0179df228de5c7e22f86e413adc7030185f5b2eec08082d7eca76b386', '[\"*\"]', NULL, '2021-09-02 11:03:01', '2021-09-02 11:03:01');
-- --------------------------------------------------------
--
-- Table structure for table `t_absensi`
--
CREATE TABLE `t_absensi` (
`id_absensi` int(6) NOT NULL,
`nip` int(12) NOT NULL,
`tanggal` date NOT NULL,
`jam_masuk` text NOT NULL,
`jam_selesai` text DEFAULT NULL,
`alamat` text DEFAULT NULL,
`alamat_sore` text DEFAULT NULL,
`keterangan` text NOT NULL,
`keterangan_sore` text DEFAULT 'alfa',
`updated_at` timestamp NULL DEFAULT current_timestamp(),
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t_absensi`
--
INSERT INTO `t_absensi` (`id_absensi`, `nip`, `tanggal`, `jam_masuk`, `jam_selesai`, `alamat`, `alamat_sore`, `keterangan`, `keterangan_sore`, `updated_at`, `created_at`) VALUES
(2, 999999, '2021-07-20', '11:23', '16:23', 'null', 'null', 'alfa', 'hadir', '2021-08-19 10:24:54', '2021-08-19 10:24:54'),
(13, 55555, '2021-07-28', '16:24:28', '16:31:22', 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', 'alfa', 'hadir', '2021-08-28 02:24:33', '2021-08-28 02:24:33'),
(14, 999999, '2021-07-31', '22:36:07', '22:36:07', 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', 'alfa', 'hadir', '2021-08-31 08:36:13', '2021-08-31 08:36:13'),
(15, 999999, '2021-07-31', '22:40:13', NULL, 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', NULL, 'alfa', 'alfa', '2021-08-31 08:40:15', '2021-08-31 08:40:15'),
(16, 999999, '2021-07-31', '22:47:31', NULL, 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', NULL, 'alfa', 'alfa', '2021-08-31 08:47:35', '2021-08-31 08:47:35'),
(17, 999999, '2021-07-31', '23:01:39', NULL, 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', NULL, 'alfa', 'alfa', '2021-08-31 09:01:54', '2021-08-31 09:01:54'),
(18, 999999, '2021-07-31', '23:04:21', NULL, 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', NULL, 'alfa', 'alfa', '2021-08-31 09:04:24', '2021-08-31 09:04:24'),
(19, 999999, '2021-07-31', '23:18:15', NULL, 'null', NULL, 'alfa', 'alfa', '2021-08-31 09:18:17', '2021-08-31 09:18:17'),
(20, 999999, '2021-07-31', '23:19:06', NULL, 'Jl. Khatib Sulaiman No.86, Ulak Karang Sel., Kec. Padang Utara, Kota Padang, Sumatera Barat 25173, Indonesia', NULL, 'alfa', 'alfa', '2021-08-31 09:19:10', '2021-08-31 09:19:10');
-- --------------------------------------------------------
--
-- Table structure for table `t_agama`
--
CREATE TABLE `t_agama` (
`id_agama` int(10) NOT NULL,
`nama_agama` varchar(12) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t_agama`
--
INSERT INTO `t_agama` (`id_agama`, `nama_agama`) VALUES
(1, 'islam'),
(2, 'kristen');
-- --------------------------------------------------------
--
-- Table structure for table `t_cuti`
--
CREATE TABLE `t_cuti` (
`id_cuti` int(12) NOT NULL,
`nip` int(6) NOT NULL,
`lama_cuti` int(6) NOT NULL,
`alasan_cuti` text NOT NULL,
`tanggal_mulai` date NOT NULL,
`tanggal_akhir` date NOT NULL,
`tanggal` varchar(50) NOT NULL,
`acc` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t_cuti`
--
INSERT INTO `t_cuti` (`id_cuti`, `nip`, `lama_cuti`, `alasan_cuti`, `tanggal_mulai`, `tanggal_akhir`, `tanggal`, `acc`) VALUES
(7, 3487, 2, 'hadir', '2021-07-17', '2021-07-10', 'tanggal', 'acc'),
(8, 3487, 2, 'hadir', '2021-07-17', '2021-07-10', 'tanggal', 'acc'),
(9, 1711082025, 2, 'Alfa', '2021-07-09', '2021-07-19', '2021-7-19', 'acc'),
(11, 0, 5, 'hair', '2021-08-19', '2021-08-12', '2021-08-12', 'acc'),
(12, 1711082025, 2, 'Alfa', '2021-07-09', '2021-07-19', '2021-7-19', 'acc'),
(13, 1711082025, 2, 'Alfa', '2021-07-09', '2021-07-19', '2021-7-19', 'acc'),
(14, 1711082025, 2, 'Alfa', '2021-07-09', '2021-07-19', '2021-7-19', 'acc'),
(15, 1711082025, 2, 'Alfa', '2021-07-09', '2021-07-19', '2021-7-19', NULL),
(16, 1711082025, 2, 'Alfa', '2021-07-09', '2021-07-19', '2021-7-19', NULL),
(17, 999, 2, '<NAME>', '2021-07-13', '2021-07-18', 'Aug 13, 2021 3:06:30 AM', 'acc'),
(18, 3232, 2, 'sakit', '2021-07-16', '2021-07-18', '16 Agu 2021 17.19.26', NULL),
(19, 3232, 2, 'izin', '2021-07-16', '2021-07-18', '16 Agu 2021 17.56.56', NULL),
(20, 3232, 2, '1', '2021-07-16', '2021-07-18', '16 Agu 2021 18.00.36', NULL),
(21, 3232, 2, 'f', '2021-07-18', '2021-07-26', '16 Agu 2021 18.01.00', NULL),
(22, 999999, 2, 'iz<NAME>', '2021-07-17', '2021-07-17', '17 Agu 2021 10.03.54', NULL),
(23, 999999, 2, 'telah melakukan upacara benderaaaaaaaaaa', '2021-07-17', '2021-07-20', '17 Agu 2021 10.05.05', NULL),
(24, 999999, 2, 'sedang melakukan upacara bendera di gedung marapi', '2021-07-17', '2021-07-19', '17 Agu 2021 10.06.05', NULL),
(25, 55555, 2, 'sakit', '2021-07-20', '2021-07-29', 'Aug 28, 2021 7:04:36 AM', NULL),
(26, 999999, 2, 'sakitt', '2021-07-28', '2021-07-30', 'Aug 28, 2021 10:36:49 PM', NULL),
(27, 999999, 2, 'sakit', '2021-07-31', '2021-07-01', '31 Agu 2021 01.16.35', 'acc');
-- --------------------------------------------------------
--
-- Table structure for table `t_informasi`
--
CREATE TABLE `t_informasi` (
`id_informasi` int(10) NOT NULL,
`judul` varchar(150) NOT NULL,
`descripsi` text NOT NULL,
`gambar` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t_informasi`
--
INSERT INTO `t_informasi` (`id_informasi`, `judul`, `descripsi`, `gambar`) VALUES
(1, 'kelulusan', 'lalala', 'kelulusan.png'),
(2, 'menampilkan Data', 'halal', 'menampilkan Data.png'),
(3, 'jukekuasaan sekolah', 'kejuaraan', 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHCBUSExgVFRUZGBgaGyAcHBoaGyEbHx8hJBsfHRsfHCEbIS0kJCQqICMbJTklKi4zNDQ0HSM6PzoyPi0zNDEBCwsLEA8QHRISHTMqIyM1MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxMzMzMzMxMzMzMzMzMzMzM//AABEIAKgBLAMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYDBAcCAQj/xABAEAACAQIEAwYCBwYFBAMAAAABAgADEQQFEiEGMVETIkFhcYEHkRQjMkJSobEzcoKSssFDYqLC8BUk0eFjg5P/xAAYAQEBAQEBAAAAAAAAAAAAAAAAAgEDBP/EACIRAQEAAwACAgIDAQAAAAAAAAABAhEhEjEDQRNRMmFxIv/aAAwDAQACEQMRAD8A6NEROzxkREBETVzLMaWFTtKzhEuBqPU8htA2olf4j4vw2AZVqlizqWUKL7Dlc+FzsPQyicL/ABMft3ONqEU2HcVKYIU38SO/a233vaT5RUwtm3W4nG87+KeIap/2wRKasbFl1F1tYaweXXaxklW+K6vSrBaTU30WpNs13NwWYE<KEY>'),
(4, 'lokal 1 a memenangkan lomba', 'Kabupaten Pati – Padatnya agenda kepala daerah pada Sabtu (30/3), namun Bupati Haryanto menyempatkan menghadiri lomba MAPSI tingkat SMP se- Kabupaten Pati yang dilaksanakan di SMP Negeri 1 Jaken. Hadir pada acara tersebut Camat Jaken, Danramil Jaken, Kepala sekolah dan guru pembimbing. Lomba Mapsi ini diikuti oleh 583 peserta yang berkompetisi di tujuh bidang lomba mata pelajaran.', 'fikri galau.png');
-- --------------------------------------------------------
--
-- Table structure for table `t_jabatan`
--
CREATE TABLE `t_jabatan` (
`id_jabatan` int(10) NOT NULL,
`nama_jabatan` varchar(30) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t_jabatan`
--
INSERT INTO `t_jabatan` (`id_jabatan`, `nama_jabatan`, `updated_at`, `created_at`) VALUES
(1, 'kepala sekolah', '2021-07-04 12:31:28', '2021-07-04 12:31:57'),
(2, 'admin', '2021-07-04 12:31:28', '2021-07-04 12:31:57'),
(3, 'bendahara', '2021-07-04 05:32:02', '2021-07-04 05:32:02'),
(4, 'seketaris', '2021-07-04 05:32:52', '2021-07-04 05:32:52');
-- --------------------------------------------------------
--
-- Table structure for table `t_pegawai`
--
CREATE TABLE `t_pegawai` (
`id_pegawai` int(12) NOT NULL,
`nip` varchar(15) NOT NULL,
`nama_pegawai` varchar(35) NOT NULL,
`jabatan_id` int(1) NOT NULL,
`email` varchar(30) NOT NULL,
`no_tlp` varchar(12) NOT NULL,
`alamat_pegawai` varchar(100) NOT NULL,
`tgl_masuk` date NOT NULL,
`tmp_lahir` varchar(40) NOT NULL,
`id_agama` int(10) NOT NULL,
`gender` varchar(30) NOT NULL,
`pendidikan` varchar(30) NOT NULL,
`password` varchar(32) DEFAULT NULL,
`foto` text DEFAULT NULL,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t_pegawai`
--
INSERT INTO `t_pegawai` (`id_pegawai`, `nip`, `nama_pegawai`, `jabatan_id`, `email`, `no_tlp`, `alamat_pegawai`, `tgl_masuk`, `tmp_lahir`, `id_agama`, `gender`, `pendidikan`, `password`, `foto`, `updated_at`, `created_at`) VALUES
(1, '999999', '<PASSWORD>', 2, '<EMAIL>', '82170911098', 'di pasaf kuliner', '2020-02-02', 'padang panjang 3 juli 1999', 1, 'Laki laki', 'sma', NULL, '999999.jpg', '2021-08-19 17:15:31', '2021-08-19 17:15:31'),
(4, '55555', 'admin', 2, '<EMAIL>', 'kotlin.Unit', 'secata b', '2021-07-27', '2021-7-11', 1, 'Laki laki', 'sma', NULL, '55555.jpg', '2021-08-27 08:07:44', '2021-08-27 08:07:44');
-- --------------------------------------------------------
--
-- Table structure for table `t_user`
--
CREATE TABLE `t_user` (
`id_user` int(6) NOT NULL,
`level_id` int(2) NOT NULL,
`nama_user` varchar(30) NOT NULL,
`username` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`last_login` int(6) NOT NULL,
`fhoto` varchar(8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`nip` int(30) NOT NULL,
`nohp` bigint(30) NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`level` int(11) NOT NULL DEFAULT 2
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `nip`, `nohp`, `password`, `remember_token`, `created_at`, `updated_at`, `level`) VALUES
(1, 'hidayatul sidiq', '<EMAIL>', NULL, 999999, 82170911098, '$2y$10$FxMMLSnF.5jXv46.TgtPJe3QIfkSr2f8HzFd7hU2O1QI/hop4ZRdK', NULL, '2021-06-29 09:42:29', '2021-06-29 09:42:29', 1),
(10, 'kepada sekolah', '<EMAIL>', NULL, 87654321, 232545224, '$2y$10$mbhRD1j4pHMcefT.x6PfjOUgifcwfRQe6MJJOi1rRIvCphIIm/6VW', NULL, '2021-08-27 01:18:06', '2021-08-27 01:18:06', 2),
(11, 'ari', '<EMAIL>', NULL, 1711082050, 81275327325, '$2y$10$LGzx08gkjCGx/s/QfFkqtef/omgFUM9YlAXSfNclgAITBkQH2kA66', NULL, '2021-08-28 02:14:23', '2021-08-28 02:14:23', 2),
(23, 'ani', '<EMAIL>', NULL, 343434, 82170911098, '$2y$10$CrgBYAnIM7GHN05co1Nq0.3XcQbWUYz/i.4btgxBMypLiDyOY6VZ2', NULL, NULL, NULL, 2),
(24, 'tws', '<EMAIL>', NULL, 4434343, 876868678, '$2y$10$gg.nR/<KEY>', NULL, NULL, NULL, 2);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
--
-- Indexes for table `t_absensi`
--
ALTER TABLE `t_absensi`
ADD PRIMARY KEY (`id_absensi`);
--
-- Indexes for table `t_agama`
--
ALTER TABLE `t_agama`
ADD PRIMARY KEY (`id_agama`);
--
-- Indexes for table `t_cuti`
--
ALTER TABLE `t_cuti`
ADD PRIMARY KEY (`id_cuti`);
--
-- Indexes for table `t_informasi`
--
ALTER TABLE `t_informasi`
ADD PRIMARY KEY (`id_informasi`);
--
-- Indexes for table `t_jabatan`
--
ALTER TABLE `t_jabatan`
ADD PRIMARY KEY (`id_jabatan`);
--
-- Indexes for table `t_pegawai`
--
ALTER TABLE `t_pegawai`
ADD PRIMARY KEY (`id_pegawai`);
--
-- Indexes for table `t_user`
--
ALTER TABLE `t_user`
ADD PRIMARY KEY (`id_user`);
--
-- 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 `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=100;
--
-- AUTO_INCREMENT for table `t_absensi`
--
ALTER TABLE `t_absensi`
MODIFY `id_absensi` int(6) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `t_agama`
--
ALTER TABLE `t_agama`
MODIFY `id_agama` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `t_cuti`
--
ALTER TABLE `t_cuti`
MODIFY `id_cuti` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `t_informasi`
--
ALTER TABLE `t_informasi`
MODIFY `id_informasi` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `t_jabatan`
--
ALTER TABLE `t_jabatan`
MODIFY `id_jabatan` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `t_pegawai`
--
ALTER TABLE `t_pegawai`
MODIFY `id_pegawai` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `t_user`
--
ALTER TABLE `t_user`
MODIFY `id_user` int(6) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
insert into `Drug Company` (drug_company_id, drug_company_name) values (1, 'Ultradent Products, Inc.');
insert into `Drug Company` (drug_company_id, drug_company_name) values (2, 'Harmon Stores Inc');
insert into `Drug Company` (drug_company_id, drug_company_name) values (3, 'Wal-Mart Stores Inc');
insert into `Drug Company` (drug_company_id, drug_company_name) values (4, 'Cadila Healthcare Limited');
insert into `Drug Company` (drug_company_id, drug_company_name) values (5, 'Energizer Personal Care LLC');
insert into `Drug Company` (drug_company_id, drug_company_name) values (6, 'Henry Schein, Inc.');
insert into `Drug Company` (drug_company_id, drug_company_name) values (7, 'Family Dollar');
insert into `Drug Company` (drug_company_id, drug_company_name) values (8, 'Three Rivers Pharmaceuticals, LLC.');
insert into `Drug Company` (drug_company_id, drug_company_name) values (9, 'Save-A-Lot Food Stores Ltd');
insert into `Drug Company` (drug_company_id, drug_company_name) values (10, 'Agile Pharmachem');
|
<gh_stars>0
CREATE FUNCTION [dspUtil].[Metadata_ProceduresDefination] ()
RETURNS TABLE
AS
RETURN SELECT S.name AS SchemaName, O.name AS ObjectName, O.type AS Type, dspUtil.String_RemoveWhitespacesBig((OBJECT_DEFINITION(O.object_id))) AS Script
FROM sys.objects AS O
INNER JOIN sys.schemas AS S ON S.schema_id = O.schema_id
WHERE O.type IN ( 'FN', 'IF', 'TF', 'P' );
|
<filename>tests/Functional/schema/NamespaceTest/testNamespaceNameMatchesCase.clean.sql
DROP SCHEMA IF EXISTS FOCAL_BANGER
DROP SCHEMA IF EXISTS choppin_broccoli
DROP SCHEMA IF EXISTS laLunaRosa
DROP SCHEMA IF EXISTS BumbleFetish
|
/* START */
/* Data for the table "office" */
insert into "office"("office_code", "city", "phone", "address_line_first", "address_line_second", "state", "country", "postal_code", "territory") values
('1', 'San Francisco', '+1 650 219 4782', '100 Market Street', 'Suite 300', 'CA', 'USA', '94080', 'NA'),
('2', 'Boston', '+1 215 837 0825', '1550 Court Place', 'Suite 102', 'MA', 'USA', '02107', 'NA'),
('3', 'NYC', '+1 212 555 3000', '523 East 53rd Street', 'apt. 5A', 'NY', 'USA', '10022', 'NA'),
('4', 'Paris', '+33 14 723 4404', '43 Rue Jouffroy Dabbans', NULL, NULL, 'France', '75017', 'EMEA'),
('5', 'Tokyo', '+81 33 224 5000', '4-1 Kioicho', NULL, 'Chiyoda-Ku', 'Japan', '102-8578', 'Japan'),
('6', 'Sydney', '+61 2 9264 2451', '5-11 Wentworth Avenue', 'Floor #2', NULL, 'Australia', 'NSW 2010', 'APAC'),
('7', 'London', '+44 20 7877 2041', '25 Old Broad Street', 'Level 7', NULL, 'UK', 'EC2N 1HN', 'EMEA') ON CONFLICT (office_code) DO NOTHING;
/* Data for the table "employee" */
insert into "employee"("employee_number", "last_name", "first_name", "extension", "email", "office_code", "salary", "reports_to", "job_title") values
(1002, 'Murphy', 'Diane', 'x5800', '<EMAIL>', '1', 120000, NULL, 'President'),
(1056, 'Patterson', 'Mary', 'x4611', '<EMAIL>', '1', 100000, 1002, 'VP Sales'),
(1076, 'Firrelli', 'Jeff', 'x9273', '<EMAIL>', '1', 100000, 1002, 'VP Marketing'),
(1088, 'Patterson', 'William', 'x4871', '<EMAIL>', '6', 80000, 1056, 'Sales Manager (APAC)'),
(1102, 'Bondur', 'Gerard', 'x5408', '<EMAIL>', '4', 80000, 1056, 'Sale Manager (EMEA)'),
(1143, 'Bow', 'Anthony', 'x5428', '<EMAIL>', '1', 75000, 1056, 'Sales Manager (NA)'),
(1165, 'Jennings', 'Leslie', 'x3291', '<EMAIL>', '1', 60000, 1143, 'Sales Rep'),
(1166, 'Thompson', 'Leslie', 'x4065', '<EMAIL>', '1', 60000, 1143, 'Sales Rep'),
(1188, 'Firrelli', 'Julie', 'x2173', '<EMAIL>', '2', 60000, 1143, 'Sales Rep'),
(1216, 'Patterson', 'Steve', 'x4334', '<EMAIL>', '2', 55000, 1143, 'Sales Rep'),
(1286, 'Tseng', '<NAME>', 'x2248', '<EMAIL>', '3', 55000, 1143, 'Sales Rep'),
(1323, 'Vanauf', 'George', 'x4102', '<EMAIL>', '3', 55000, 1143, 'Sales Rep'),
(1337, 'Bondur', 'Loui', 'x6493', '<EMAIL>', '4', 60000, 1102, 'Sales Rep'),
(1370, 'Hernandez', 'Gerard', 'x2028', '<EMAIL>', '4', 65000, 1102, 'Sales Rep'),
(1401, 'Castillo', 'Pamela', 'x2759', '<EMAIL>', '4', 55000, 1102, 'Sales Rep'),
(1501, 'Bott', 'Larry', 'x2311', '<EMAIL>', '7', 50000, 1102, 'Sales Rep'),
(1504, 'Jones', 'Barry', 'x102', '<EMAIL>', '7', 50000, 1102, 'Sales Rep'),
(1611, 'Fixter', 'Andy', 'x101', '<EMAIL>', '6', 50000, 1088, 'Sales Rep'),
(1612, 'Marsh', 'Peter', 'x102', '<EMAIL>', '6', 55000, 1088, 'Sales Rep'),
(1619, 'King', 'Tom', 'x103', '<EMAIL>', '6', 60000, 1088, 'Sales Rep'),
(1621, 'Nishi', 'Mami', 'x101', '<EMAIL>', '5', 55000, 1056, 'Sales Rep'),
(1625, 'Kato', 'Yoshimi', 'x102', '<EMAIL>', '5', 60000, 1621, 'Sales Rep'),
(1702, 'Gerard', 'Martin', 'x2312', '<EMAIL>', '4', 50000, 1102, 'Sales Rep') ON CONFLICT ("employee_number") DO NOTHING;
/* Data for the table "manager" */
insert into "manager" ("manager_id", "manager_name") values
('1', '<NAME>'),
('2', '<NAME>'),
('3', '<NAME>') ON CONFLICT ("manager_id") DO NOTHING;
/* Data for the table "office_has_manager" */
insert into "office_has_manager" ("offices_office_code", "managers_manager_id") values
('1', '1'),
('2', '1'),
('3', '1'),
('4', '2'),
('5', '3'),
('6', '3'),
('7', '2') ON CONFLICT ("offices_office_code", "managers_manager_id") DO NOTHING;
/* Data for the table "customer" */
insert into "customer"("customer_number", "customer_name", "contact_last_name", "contact_first_name", "phone", "sales_rep_employee_number", "credit_limit") values
(103, 'Atelier graphique', 'Schmitt', 'Carine ', '40.32.2555', 1370, '21000.00'),
(112, 'Signal Gift Stores', 'King', 'Jean', '7025551838', 1166, '71800.00'),
(114, 'Australian Collectors, Co.', 'Ferguson', 'Peter', '03 9520 4555', 1611, '117300.00'),
(119, 'La Rochelle Gifts', 'Labrune', 'Janine ', '40.67.8555', 1370, '118200.00'),
(121, 'Baane Mini Imports', 'Bergulfsen', 'Jonas ', '07-98 9555', 1504, '81700.00'),
(124, 'Mini Gifts Distributors Ltd.', 'Nelson', 'Susan', '4155551450', 1165, '210500.00'),
(125, 'Havel & Zbyszek Co', 'Piestrzeniewicz', 'Zbyszek ', '(26) 642-7555', NULL, '0.00'),
(128, 'Blauer See Auto, Co.', 'Keitel', 'Roland', '+49 69 66 90 2555', 1504, '59700.00'),
(129, 'Mini Wheels Co.', 'Murphy', 'Julie', '6505555787', 1165, '64600.00'),
(131, 'Land of Toys Inc.', 'Lee', 'Kwai', '2125557818', 1323, '114900.00'),
(141, 'Euro+ Shopping Channel', 'Freyre', 'Diego ', '(91) 555 94 44', 1370, '227600.00'),
(144, 'Volvo Model Replicas, Co', 'Berglund', 'Christina ', '0921-12 3555', 1504, '53100.00'),
(145, '<NAME>', 'Petersen', 'Jytte ', '31 12 3555', 1401, '83400.00'),
(146, 'Saveley & Henriot, Co.', 'Saveley', 'Mary ', '78.32.5555', 1337, '123900.00'),
(148, 'Dragon Souveniers, Ltd.', 'Natividad', 'Eric', '+65 221 7555', 1621, '103800.00'),
(151, 'Muscle Machine Inc', 'Young', 'Jeff', '2125557413', 1286, '138500.00'),
(157, 'Diecast Classics Inc.', 'Leong', 'Kelvin', '2155551555', 1216, '100600.00'),
(161, 'Technics Stores Inc.', 'Hashimoto', 'Juri', '6505556809', 1165, '84600.00'),
(166, 'Handji Gifts& Co', 'Victorino', 'Wendy', '+65 224 1555', 1612, '97900.00'),
(167, 'Herkku Gifts', 'Oeztan', 'Veysel', '+47 2267 3215', 1504, '96800.00'),
(168, 'American Souvenirs Inc', 'Franco', 'Keith', '2035557845', 1286, '0.00'),
(169, 'Porto Imports Co.', 'de Castro', 'Isabel ', '(1) 356-5555', NULL, '0.00'),
(171, 'Daedalus Designs Imports', 'Rancé', 'Martine ', '20.16.1555', 1370, '82900.00'),
(172, 'La Corne Dabondance, Co.', 'Bertrand', 'Marie', '(1) 42.34.2555', 1337, '84300.00'),
(173, 'Cambridge Collectables Co.', 'Tseng', 'Jerry', '6175555555', 1188, '43400.00'),
(175, 'Gift Depot Inc.', 'King', 'Julie', '2035552570', 1323, '84300.00'),
(177, 'Osaka Souveniers Co.', 'Kentary', 'Mory', '+81 06 6342 5555', 1621, '81200.00'),
(181, 'Vitachrome Inc.', 'Frick', 'Michael', '2125551500', 1286, '76400.00'),
(186, 'Toys of Finland, Co.', 'Karttunen', 'Matti', '90-224 8555', 1501, '96500.00'),
(187, 'AV Stores, Co.', 'Ashworth', 'Rachel', '(171) 555-1555', 1501, '136800.00'),
(189, 'Clover Collections, Co.', 'Cassidy', 'Dean', '+353 1862 1555', 1504, '69400.00'),
(198, 'Auto-Moto Classics Inc.', 'Taylor', 'Leslie', '6175558428', 1216, '23000.00'),
(201, 'UK Collectables, Ltd.', 'Devon', 'Elizabeth', '(171) 555-2282', 1501, '92700.00'),
(202, 'Canadian Gift Exchange Network', 'Tamuri', 'Yoshi ', '(604) 555-3392', 1323, '90300.00'),
(204, 'Online Mini Collectables', 'Barajas', 'Miguel', '6175557555', 1188, '68700.00'),
(205, 'Toys4GrownUps.com', 'Young', 'Julie', '6265557265', 1166, '90700.00'),
(206, 'Asian Shopping Network, Co', 'Walker', 'Brydey', '+612 9411 1555', NULL, '0.00'),
(209, 'Mini Caravy', 'Citeaux', 'Frédérique ', '88.60.1555', 1370, '53800.00'),
(211, 'King Kong Collectables, Co.', 'Gao', 'Mike', '+852 2251 1555', 1621, '58600.00'),
(216, 'Enaco Distributors', 'Saavedra', 'Eduardo ', '(93) 203 4555', 1702, '60300.00'),
(219, 'Boards & Toys Co.', 'Young', 'Mary', '3105552373', 1166, '11000.00'),
(223, 'Natürlich Autos', 'Kloss', 'Horst ', '0372-555188', NULL, '0.00'),
(227, 'Heintze Collectables', 'Ibsen', 'Palle', '86 21 3555', 1401, '120800.00'),
(233, 'Québec Home Shopping Network', 'Fresnière', 'Jean ', '(514) 555-8054', 1286, '48700.00'),
(237, 'ANG Resellers', 'Camino', 'Alejandra ', '(91) 745 6555', NULL, '0.00'),
(239, 'Collectable Mini Designs Co.', 'Thompson', 'Valarie', '7605558146', 1166, '105000.00'),
(240, 'giftsbymail.co.uk', 'Bennett', 'Helen ', '(198) 555-8888''UK', 1501, '93900.00'),
(242, 'Alpha Cognac', 'Roulet', 'Annette ', '61.77.6555', 1370, '61100.00'),
(247, 'Messner Shopping Network', 'Messner', 'Renate ', '069-0555984', NULL, '0.00'),
(249, 'Amica Models & Co.', 'Accorti', 'Paolo ', '011-4988555', 1401, '113000.00'),
(250, '<NAME>', '<NAME>', 'Daniel', '+33 1 46 62 7555', 1337, '68100.00'),
(256, 'Auto Associés & Cie.', 'Tonini', 'Daniel ', '30.59.8555', 1370, '77900.00'),
(259, 'Toms Spezialitäten, Ltd', 'Pfalzheim', 'Henriette ', '0221-5554327', 1504, '120400.00'),
(260, 'Royal Canadian Collectables, Ltd.', 'Lincoln', 'Elizabeth ', '(604) 555-4555', 1323, '89600.00'),
(273, 'Franken Gifts, Co', 'Franken', 'Peter ', '089-0877555', NULL, '0.00'),
(276, 'Anna Decorations, Ltd', 'OHara', 'Anna', '02 9936 8555', 1611, '107800.00'),
(278, 'Rovelli Gifts', 'Rovelli', 'Giovanni ', '035-640555', 1401, '119600.00'),
(282, 'Souveniers And Things Co.', 'Huxley', 'Adrian', '+61 2 9495 8555', 1611, '93300.00'),
(286, 'Marta Replicas Co.', 'Hernandez', 'Marta', '6175558555', 1216, '123700.00'),
(293, 'BG&E Collectables', 'Harrison', 'Ed', '+41 26 425 50 01', NULL, '0.00'),
(298, 'Vida Sport, Ltd', 'Holz', 'Mihael', '0897-034555', 1702, '141300.00'),
(299, 'Norway Gifts By Mail, Co.', 'Klaeboe', 'Jan', '+47 2212 1555', 1504, '95100.00'),
(303, 'Schuyler Imports', 'Schuyler', 'Bradley', '+31 20 491 9555', NULL, '0.00'),
(307, 'Der Hund Imports', 'Andersen', 'Mel', '030-0074555', NULL, '0.00'),
(311, 'Oulu Toy Supplies, Inc.', 'Koskitalo', 'Pirkko', '981-443655', 1501, '90500.00'),
(314, 'Petit Auto', 'Dewey', 'Catherine ', '(02) 5554 67', 1401, '79900.00'),
(319, 'Mini Classics', 'Frick', 'Steve', '9145554562', 1323, '102700.00'),
(320, 'Mini Creations Ltd.', 'Huang', 'Wing', '5085559555', 1188, '94500.00'),
(321, 'Corporate Gift Ideas Co.', 'Brown', 'Julie', '6505551386', 1165, '105000.00'),
(323, 'Down Under Souveniers, Inc', 'Graham', 'Mike', '+64 9 312 5555', 1612, '88000.00'),
(324, 'Stylish Desk Decors, Co.', 'Brown', 'Ann ', '(171) 555-0297', 1501, '77000.00'),
(328, 'Tekni Collectables Inc.', 'Brown', 'William', '2015559350', 1323, '43000.00'),
(333, 'Australian Gift Network, Co', 'Calaghan', 'Ben', '61-7-3844-6555', 1611, '51600.00'),
(334, 'Suominen Souveniers', 'Suominen', 'Kalle', '+358 9 8045 555', 1501, '98800.00'),
(335, 'Cramer Spezialitäten, Ltd', 'Cramer', 'Philip ', '0555-09555', NULL, '0.00'),
(339, 'Classic Gift Ideas, Inc', 'Cervantes', 'Francisca', '2155554695', 1188, '81100.00'),
(344, 'CAF Imports', 'Fernandez', 'Jesus', '+34 913 728 555', 1702, '59600.00'),
(347, 'Men R US Retailers, Ltd.', 'Chandler', 'Brian', '2155554369', 1166, '57700.00'),
(348, 'Asian Treasures, Inc.', 'McKenna', 'Patricia ', '2967 555', NULL, '0.00'),
(350, 'Marseille Mini Autos', 'Lebihan', 'Laurence ', '91.24.4555', 1337, '65000.00'),
(353, 'Reims Collectables', 'Henriot', 'Paul ', '26.47.1555', 1337, '81100.00'),
(356, 'SAR Distributors, Co', 'Kuger', 'Armand', '+27 21 550 3555', NULL, '0.00'),
(357, 'GiftsForHim.com', 'MacKinlay', 'Wales', '64-9-3763555', 1612, '77700.00'),
(361, 'Kommission Auto', 'Josephs', 'Karin', '0251-555259', NULL, '0.00'),
(362, 'Gifts4AllAges.com', 'Yoshido', 'Juri', '6175559555', 1216, '41900.00'),
(363, 'Online Diecast Creations Co.', 'Young', 'Dorothy', '6035558647', 1216, '114200.00'),
(369, 'Lisboa Souveniers, Inc', 'Rodriguez', 'Lino ', '(1) 354-2555', NULL, '0.00'),
(376, 'Precious Collectables', 'Urs', 'Braun', '0452-076555', 1702, '0.00'),
(379, 'Collectables For Less Inc.', 'Nelson', 'Allen', '6175558555', 1188, '70700.00'),
(381, '<NAME>', 'Cartrain', 'Pascale ', '(071) 23 67 2555', 1401, '23500.00'),
(382, 'Salzburg Collectables', 'Pipps', 'Georg ', '6562-9555', 1401, '71700.00'),
(385, 'Cruz & Sons Co.', 'Cruz', 'Arnold', '+63 2 555 3587', 1621, '81500.00'),
(386, '<NAME>', 'Moroni', 'Maurizio ', '0522-556555', 1401, '121400.00'),
(398, 'Tokyo Collectables, Ltd', 'Shimamura', 'Akiko', '+81 3 3584 0555', 1621, '94400.00'),
(406, 'Auto Canal+ Petit', 'Perrier', 'Dominique', '(1) 47.55.6555', 1337, '95000.00'),
(409, 'Stuttgart Collectable Exchange', 'Müller', 'Rita ', '0711-555361', NULL, '0.00'),
(412, 'Extreme Desk Decorations, Ltd', 'McRoy', 'Sarah', '04 499 9555', 1612, '86800.00'),
(415, 'Bavarian Collectables Imports, Co.', 'Donnermeyer', 'Michael', ' +49 89 61 08 9555', 1504, '77000.00'),
(424, 'Classic Legends Inc.', 'Hernandez', 'Maria', '2125558493', 1286, '67500.00'),
(443, 'Feuer Online Stores, Inc', 'Feuer', 'Alexander ', '0342-555176', NULL, '0.00'),
(447, 'Gift Ideas Corp.', 'Lewis', 'Dan', '2035554407', 1323, '49700.00'),
(448, 'Scandinavian Gift Ideas', 'Larsson', 'Martha', '0695-34 6555', 1504, '116400.00'),
(450, 'The Sharp Gifts Warehouse', 'Frick', 'Sue', '4085553659', 1165, '77600.00'),
(452, 'Mini Auto Werke', 'Mendel', 'Roland ', '7675-3555', 1401, '45300.00'),
(455, 'Super Scale Inc.', 'Murphy', 'Leslie', '2035559545', 1286, '95400.00'),
(456, 'Microscale Inc.', 'Choi', 'Yu', '2125551957', 1286, '39800.00'),
(458, 'Corrida Auto Replicas, Ltd', 'Sommer', 'Martín ', '(91) 555 22 82', 1702, '104600.00'),
(459, 'Warburg Exchange', 'Ottlieb', 'Sven ', '0241-039123', NULL, '0.00'),
(462, 'FunGiftIdeas.com', 'Benitez', 'Violeta', '5085552555', 1216, '85800.00'),
(465, 'Anton Designs, Ltd.', 'Anton', 'Carmen', '+34 913 728555', NULL, '0.00'),
(471, 'Australian Collectables, Ltd', 'Clenahan', 'Sean', '61-9-3844-6555', 1611, '60300.00'),
(473, '<NAME>', 'Ricotti', 'Franco', '+39 022515555', 1401, '34800.00'),
(475, 'West Coast Collectables Co.', 'Thompson', 'Steve', '3105553722', 1166, '55400.00'),
(477, 'Mit Vergnügen & Co.', 'Moos', 'Hanna ', '0621-08555', NULL, '0.00'),
(480, 'Kremlin Collectables, Co.', 'Semenov', 'Alexander ', '+7 812 293 0521', NULL, '0.00'),
(481, 'Raanan Stores, Inc', 'Altagar, G M', 'Raanan', '+ 972 9 959 8555', NULL, '0.00'),
(484, 'Iberia Gift Imports, Corp.', 'Roel', '<NAME> ', '(95) 555 82 82', 1702, '65700.00'),
(486, 'Motor Mint Distributors Inc.', 'Salazar', 'Rosa', '2155559857', 1323, '72600.00'),
(487, 'Signal Collectibles Ltd.', 'Taylor', 'Sue', '4155554312', 1165, '60300.00'),
(489, 'Double Decker Gift Stores, Ltd', 'Smith', 'Thomas ', '(171) 555-7555', 1501, '43300.00'),
(495, 'Diecast Collectables', 'Franco', 'Valarie', '6175552555', 1188, '85100.00'),
(496, 'Kellys Gift Shop', 'Snowden', 'Tony', '+64 9 5555500', 1612, '110000.00') ON CONFLICT ("customer_number") DO NOTHING;
/* Data for the table "customerdetail" */
insert into "customerdetail"("customer_number", "address_line_first", "address_line_second", "city", "state", "postal_code", "country") values
(103, '54, rue Royale', NULL, 'Nantes', NULL, '44000', 'France'),
(112, '8489 Strong St.', NULL, 'Las Vegas', 'NV', '83030', 'USA'),
(114, '636 St Kilda Road', 'Level 3', 'Melbourne', 'Victoria', '3004', 'Australia'),
(119, '67, rue des Cinquante Otages', NULL, 'Nantes', NULL, '44000', 'France'),
(121, 'Erling Skakkes gate 78', NULL, 'Stavern', NULL, '4110', 'Norway'),
(124, '5677 Strong St.', NULL, 'San Rafael', 'CA', '97562', 'USA'),
(125, 'ul. Filtrowa 68', NULL, 'Warszawa', NULL, '01-012', 'Poland'),
(128, 'Lyonerstr. 34', NULL, 'Frankfurt', NULL, '60528', 'Germany'),
(129, '5557 North Pendale Street', NULL, 'San Francisco', 'CA', '94217', 'USA'),
(131, '897 Long Airport Avenue', NULL, 'NYC', 'NY', '10022', 'USA'),
(141, 'C/ Moralzarzal, 86', NULL, 'Madrid', NULL, '28034', 'Spain'),
(144, 'Berguvsvägen 8', NULL, 'Luleå', NULL, 'S-958 22', 'Sweden'),
(145, '<NAME>', NULL, 'Kobenhavn', NULL, '1734', 'Denmark'),
(146, '2, rue du Commerce', NULL, 'Lyon', NULL, '69004', 'France'),
(148, '<NAME>.', 'Bronz Apt. 3/6 Tesvikiye', 'Singapore', NULL, '079903', 'Singapore'),
(151, '4092 Furth Circle', 'Suite 400', 'NYC', 'NY', '10022', 'USA'),
(157, '7586 Pompton St.', NULL, 'Allentown', 'PA', '70267', 'USA'),
(161, '9408 Furth Circle', NULL, 'Burlingame', 'CA', '94217', 'USA'),
(166, '106 Linden Road Sandown', '2nd Floor', 'Singapore', NULL, '069045', 'Singapore'),
(167, 'Brehmen St. 121', 'PR 334 Sentrum', 'Bergen', NULL, 'N 5804', 'Norway '),
(168, '149 Spinnaker Dr.', 'Suite 101', 'New Haven', 'CT', '97823', 'USA'),
(169, 'Estrada da saúde n. 58', NULL, 'Lisboa', NULL, '1756', 'Portugal'),
(171, '184, chaussée de Tournai', NULL, 'Lille', NULL, '59000', 'France'),
(172, '265, bou<NAME>', NULL, 'Paris', NULL, '75012', 'France'),
(173, '4658 Baden Av.', NULL, 'Cambridge', 'MA', '51247', 'USA'),
(175, '25593 South Bay Ln.', NULL, 'Bridgewater', 'CT', '97562', 'USA'),
(177, '1-6-20 Dojima', NULL, 'Kita-ku', 'Osaka', ' 530-0003', 'Japan'),
(181, '2678 Kingston Rd.', 'Suite 101', 'NYC', 'NY', '10022', 'USA'),
(186, 'Keskuskatu 45', NULL, 'Helsinki', NULL, '21240', 'Finland'),
(187, 'Fauntleroy Circus', NULL, 'Manchester', NULL, 'EC2 5NT', 'UK'),
(189, '25 Maiden Lane', 'Floor No. 4', 'Dublin', NULL, '2', 'Ireland'),
(198, '16780 Pompton St.', NULL, 'Brickhaven', 'MA', '58339', 'USA'),
(201, '12, Berkeley Gardens Blvd', NULL, 'Liverpool', NULL, 'WX1 6LT', 'UK'),
(202, '1900 Oak St.', NULL, 'Vancouver', 'BC', 'V3F 2K1', 'Canada'),
(204, '7635 Spinnaker Dr.', NULL, 'Brickhaven', 'MA', '58339', 'USA'),
(205, '78934 Hillside Dr.', NULL, 'Pasadena', 'CA', '90003', 'USA'),
(206, 'Suntec Tower Three', '8 Temasek', 'Singapore', NULL, '038988', 'Singapore'),
(209, '24, place Kléber', NULL, 'Strasbourg', NULL, '67000', 'France'),
(211, 'Bank of China Tower', '1 Garden Road', 'Central Hong Kong', NULL, NULL, 'Hong Kong'),
(216, '<NAME>, 23', NULL, 'Barcelona', NULL, '08022', 'Spain'),
(219, '4097 Douglas Av.', NULL, 'Glendale', 'CA', '92561', 'USA'),
(223, 'Taucherstraße 10', NULL, 'Cunewalde', NULL, '01307', 'Germany'),
(227, '<NAME>', NULL, 'Århus', NULL, '8200', 'Denmark'),
(233, '43 rue St. Laurent', NULL, 'Montréal', 'Québec', 'H1J 1C3', 'Canada'),
(237, 'Gran Vía, 1', NULL, 'Madrid', NULL, '28001', 'Spain'),
(239, '361 Furth Circle', NULL, 'San Diego', 'CA', '91217', 'USA'),
(240, 'Garden House', 'Crowther Way 23', 'Cowes', 'Isle of Wight', 'PO31 7PJ', 'UK'),
(242, '1 rue Alsace-Lorraine', NULL, 'Toulouse', NULL, '31000', 'France'),
(247, 'Magazinweg 7', NULL, 'Frankfurt', NULL, '60528', 'Germany'),
(249, 'Via Monte Bianco 34', NULL, 'Torino', NULL, '10100', 'Italy'),
(250, '27 rue du <NAME>', NULL, 'Paris', NULL, '75508', 'France'),
(256, '67, avenue de lEurope', NULL, 'Versailles', NULL, '78000', 'France'),
(259, 'Mehrheimerstr. 369', NULL, 'Köln', NULL, '50739', 'Germany'),
(260, '23 Tsawassen Blvd.', NULL, 'Tsawassen', 'BC', 'T2F 8M4', 'Canada'),
(273, 'Berliner Platz 43', NULL, 'München', NULL, '80805', 'Germany'),
(276, '201 Miller Street', 'Level 15', 'North Sydney', 'NSW', '2060', 'Australia'),
(278, 'Via Ludovico il Moro 22', NULL, 'Bergamo', NULL, '24100', 'Italy'),
(282, 'Monitor Money Building', '815 Pacific Hwy', 'Chatswood', 'NSW', '2067', 'Australia'),
(286, '39323 Spinnaker Dr.', NULL, 'Cambridge', 'MA', '51247', 'USA'),
(293, 'Rte des Arsenaux 41 ', NULL, 'Fribourg', NULL, '1700', 'Switzerland'),
(298, 'Grenzacherweg 237', NULL, 'Genève', NULL, '1203', 'Switzerland'),
(299, 'Drammensveien 126A', 'PB 211 Sentrum', 'Oslo', NULL, 'N 0106', 'Norway '),
(303, 'Kingsfordweg 151', NULL, 'Amsterdam', NULL, '1043 GR', 'Netherlands'),
(307, 'Obere Str. 57', NULL, 'Berlin', NULL, '12209', 'Germany'),
(311, 'Torikatu 38', NULL, 'Oulu', NULL, '90110', 'Finland'),
(314, '<NAME> 532', NULL, 'Bruxelles', NULL, 'B-1180', 'Belgium'),
(319, '3758 North Pendale Street', NULL, 'White Plains', 'NY', '24067', 'USA'),
(320, '4575 Hillside Dr.', NULL, 'New Bedford', 'MA', '50553', 'USA'),
(321, '7734 Strong St.', NULL, 'San Francisco', 'CA', '94217', 'USA'),
(323, '162-164 Grafton Road', 'Level 2', 'Auckland ', NULL, NULL, 'New Zealand'),
(324, '35 King George', NULL, 'London', NULL, 'WX3 6FW', 'UK'),
(328, '7476 Moss Rd.', NULL, 'Newark', 'NJ', '94019', 'USA'),
(333, '31 Duncan St. West End', NULL, 'South Brisbane', 'Queensland', '4101', 'Australia'),
(334, 'Software Engineering Center', 'SEC Oy', 'Espoo', NULL, 'FIN-02271', 'Finland'),
(335, 'Maubelstr. 90', NULL, 'Brandenburg', NULL, '14776', 'Germany'),
(339, '782 First Street', NULL, 'Philadelphia', 'PA', '71270', 'USA'),
(344, 'Merchants House', '27-30 Merchants Quay', 'Madrid', NULL, '28023', 'Spain'),
(347, '6047 Douglas Av.', NULL, 'Los Angeles', 'CA', '91003', 'USA'),
(348, '8 Johnstown Road', NULL, 'Cork', 'Co. Cork', NULL, 'Ireland'),
(350, '12, rue des Bouchers', NULL, 'Marseille', NULL, '13008', 'France'),
(353, '59 rue de lAbbaye', NULL, 'Reims', NULL, '51100', 'France'),
(356, '1250 Pretorius Street', NULL, 'Hatfield', 'Pretoria', '0028', 'South Africa'),
(357, '199 Great North Road', NULL, 'Auckland', NULL, NULL, 'New Zealand'),
(361, 'Luisenstr. 48', NULL, 'Münster', NULL, '44087', 'Germany'),
(362, '8616 Spinnaker Dr.', NULL, 'Boston', 'MA', '51003', 'USA'),
(363, '2304 Long Airport Avenue', NULL, 'Nashua', 'NH', '62005', 'USA'),
(369, '<NAME> n. 32', NULL, 'Lisboa', NULL, '1675', 'Portugal'),
(376, 'Hauptstr. 29', NULL, 'Bern', NULL, '3012', 'Switzerland'),
(379, '7825 Douglas Av.', NULL, 'Brickhaven', 'MA', '58339', 'USA'),
(381, 'B<NAME>, 255', NULL, 'Charleroi', NULL, 'B-6000', 'Belgium'),
(382, 'Geislweg 14', NULL, 'Salzburg', NULL, '5020', 'Austria'),
(385, '15 McCallum Street', 'NatWest Center #13-03', 'Makati City', NULL, '1227 MM', 'Philippines'),
(386, 'Strada Provinciale 124', NULL, '<NAME>', NULL, '42100', 'Italy'),
(398, '2-2-8 Roppongi', NULL, 'Minato-ku', 'Tokyo', '106-0032', 'Japan'),
(406, '25, rue Lauriston', NULL, 'Paris', NULL, '75016', 'France'),
(409, 'Adenauerallee 900', NULL, 'Stuttgart', NULL, '70563', 'Germany'),
(412, '101 Lambton Quay', 'Level 11', 'Wellington', NULL, NULL, 'New Zealand'),
(415, '<NAME>', NULL, 'Munich', NULL, '80686', 'Germany'),
(424, '5905 Pompton St.', 'Suite 750', 'NYC', 'NY', '10022', 'USA'),
(443, '<NAME>', NULL, 'Leipzig', NULL, '04179', 'Germany'),
(447, '2440 Pompton St.', NULL, 'Glendale', 'CT', '97561', 'USA'),
(448, '<NAME>', NULL, 'Bräcke', NULL, 'S-844 67', 'Sweden'),
(450, '3086 Ingle Ln.', NULL, 'San Jose', 'CA', '94217', 'USA'),
(452, '<NAME>', NULL, 'Graz', NULL, '8010', 'Austria'),
(455, '567 North Pendale Street', NULL, 'New Haven', 'CT', '97823', 'USA'),
(456, '5290 North Pendale Street', 'Suite 200', 'NYC', 'NY', '10022', 'USA'),
(458, 'C/ Araquil, 67', NULL, 'Madrid', NULL, '28023', 'Spain'),
(459, '<NAME>', NULL, 'Aachen', NULL, '52066', 'Germany'),
(462, '1785 First Street', NULL, 'New Bedford', 'MA', '50553', 'USA'),
(465, 'c/ Gobelas, 19-1 Urb. La Florida', NULL, 'Madrid', NULL, '28023', 'Spain'),
(471, '7 Allen Street', NULL, '<NAME>', 'Victoria', '3150', 'Australia'),
(473, '20093 Cologno Monzese', '<NAME>', 'Milan', NULL, NULL, 'Italy'),
(475, '3675 Furth Circle', NULL, 'Burbank', 'CA', '94019', 'USA'),
(477, 'Forsterstr. 57', NULL, 'Mannheim', NULL, '68306', 'Germany'),
(480, '2 Pobedy Square', NULL, '<NAME>', NULL, '196143', 'Russia'),
(481, '3 Hagalim Blv.', NULL, 'Herzlia', NULL, '47625', 'Israel'),
(484, 'C/ Romero, 33', NULL, 'Sevilla', NULL, '41101', 'Spain'),
(486, '11328 Douglas Av.', NULL, 'Philadelphia', 'PA', '71270', 'USA'),
(487, '2793 Furth Circle', NULL, 'Brisbane', 'CA', '94217', 'USA'),
(489, '120 Hanover Sq.', NULL, 'London', NULL, 'WA1 1DP', 'UK'),
(495, '6251 Ingle Ln.', NULL, 'Boston', 'MA', '51003', 'USA'),
(496, 'Arenales 1938 3A', NULL, 'Auckland ', NULL, NULL, 'New Zealand') ON CONFLICT ("customer_number") DO NOTHING;
/* Data for the table "productline" */
insert into "productline"("product_line", "text_description", "html_description", "image") values
('Classic Cars', 'Attention car enthusiasts: Make your wildest car ownership dreams come true. Whether you are looking for classic muscle cars, dream sports cars or movie-inspired miniatures, you will find great choices in this category. These replicas feature superb attention to detail and craftsmanship and offer features such as working steering system, opening forward compartment, opening rear trunk with removable spare wheel, 4-wheel independent spring suspension, and so on. The models range in size from 1:10 to 1:24 scale and include numerous limited edition and several out-of-production vehicles. All models include a certificate of authenticity from their manufacturers and come fully assembled and ready for display in the home or office.', NULL, NULL),
('Motorcycles', 'Our motorcycles are state of the art replicas of classic as well as contemporary motorcycle legends such as <NAME>, Ducati and Vespa. Models contain stunning details such as official logos, rotating wheels, working kickstand, front suspension, gear-shift lever, footbrake lever, and drive chain. Materials used include diecast and plastic. The models range in size from 1:10 to 1:50 scale and include numerous limited edition and several out-of-production vehicles. All models come fully assembled and ready for display in the home or office. Most include a certificate of authenticity.', NULL, NULL),
('Planes', 'Unique, diecast airplane and helicopter replicas suitable for collections, as well as home, office or classroom decorations. Models contain stunning details such as official logos and insignias, rotating jet engines and propellers, retractable wheels, and so on. Most come fully assembled and with a certificate of authenticity from their manufacturers.', NULL, NULL),
('Ships', 'The perfect holiday or anniversary gift for executives, clients, friends, and family. These handcrafted model ships are unique, stunning works of art that will be treasured for generations! They come fully assembled and ready for display in the home or office. We guarantee the highest quality, and best value.', NULL, NULL),
('Trains', 'Model trains are a rewarding hobby for enthusiasts of all ages. Whether youre looking for collectible wooden trains, electric streetcars or locomotives, youll find a number of great choices for any budget within this category. The interactive aspect of trains makes toy trains perfect for young children. The wooden train sets are ideal for children under the age of 5.', NULL, NULL),
('Trucks and Buses', 'The Truck and Bus models are realistic replicas of buses and specialized trucks produced from the early 1920s to present. The models range in size from 1:12 to 1:50 scale and include numerous limited edition and several out-of-production vehicles. Materials used include tin, diecast and plastic. All models include a certificate of authenticity from their manufacturers and are a perfect ornament for the home and office.', NULL, NULL),
('Vintage Cars', 'Our Vintage Car models realistically portray automobiles produced from the early 1900s through the 1940s. Materials used include Bakelite, diecast, plastic and wood. Most of the replicas are in the 1:18 and 1:24 scale sizes, which provide the optimum in detail and accuracy. Prices range from $30.00 up to $180.00 for some special limited edition replicas. All models include a certificate of authenticity from their manufacturers and come fully assembled and ready for display in the home or office.', NULL, NULL) ON CONFLICT ("product_line") DO NOTHING;
/* Data for the table "product" */
insert into "product"("product_id", "product_name", "product_line", "product_scale", "product_vendor", "product_description", "quantity_in_stock", "buy_price", "msrp") values
(1, '1969 <NAME> Ultimate Chopper', 'Motorcycles', '1:10', 'Min Lin Diecast', 'This replica features working kickstand, front suspension, gear-shift lever, footbrake lever, drive chain, wheels and steering. All parts are particularly delicate due to their precise scale and require special care and attention.', 7933, '48.81', '95.70'),
(2, '1952 Alpine Renault 1300', 'Classic Cars', '1:10', 'Classic Metal Creations', 'Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.', 7305, '98.58', '214.30'),
(3, '1996 Moto Guzzi 1100i', 'Motorcycles', '1:10', 'Highway 66 Mini Classics', 'Official Moto Guzzi logos and insignias, saddle bags located on side of motorcycle, detailed engine, working steering, working suspension, two leather seats, luggage rack, dual exhaust pipes, small saddle bag located on handle bars, two-tone paint with chrome accents, superior die-cast detail , rotating wheels , working kick stand, diecast metal with plastic parts and baked enamel finish.', 6625, '68.99', '118.94'),
(4, '2003 Harley-<NAME>agle Drag Bike', 'Motorcycles', '1:10', 'Red Start Diecast', 'Model features, official Harley Davidson logos and insignias, detachable rear wheelie bar, heavy diecast metal with resin parts, authentic multi-color tampo-printed graphics, separate engine drive belts, free-turning front fork, rotating tires and rear racing slick, certificate of authenticity, detailed engine, display stand\r\n, precision diecast replica, baked enamel finish, 1:10 scale model, removable fender, seat and tank cover piece for displaying the superior detail of the v-twin engine', 5582, '91.02', '193.66'),
(5, '1972 Alfa Romeo GTA', 'Classic Cars', '1:10', 'Motor City Art Classics', 'Features include: Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.', 3252, '85.68', '136.00'),
(6, '1962 LanciaA Delta 16V', 'Classic Cars', '1:10', 'Second Gear Diecast', 'Features include: Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.', 6791, '103.42', '147.74'),
(7, '1968 Ford Mustang', 'Classic Cars', '1:12', 'Autoart Studio Design', 'Hood, doors and trunk all open to reveal highly detailed interior features. Steering wheel actually turns the front wheels. Color dark green.', 68, '95.34', '194.57'),
(8, '2001 Ferrari Enzo', 'Classic Cars', '1:12', 'Second Gear Diecast', 'Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.', 3619, '95.59', '207.80'),
(9, '1958 Setra Bus', 'Trucks and Buses', '1:12', 'Welly Diecast Productions', 'Model features 30 windows, skylights & glare resistant glass, working steering system, original logos', 1579, '77.90', '136.67'),
(10, '2002 Suzuki XREO', 'Motorcycles', '1:12', 'Unimax Art Galleries', 'Official logos and insignias, saddle bags located on side of motorcycle, detailed engine, working steering, working suspension, two leather seats, luggage rack, dual exhaust pipes, small saddle bag located on handle bars, two-tone paint with chrome accents, superior die-cast detail , rotating wheels , working kick stand, diecast metal with plastic parts and baked enamel finish.', 9997, '66.27', '150.62'),
(11, '1969 Corvair Monza', 'Classic Cars', '1:18', 'Welly Diecast Productions', '1:18 scale die-cast about 10\" long doors open, hood opens, trunk opens and wheels roll', 6906, '89.14', '151.08'),
(12, '1968 Dodge Charger', 'Classic Cars', '1:12', 'Welly Diecast Productions', '1:12 scale model of a 1968 Dodge Charger. Hood, doors and trunk all open to reveal highly detailed interior features. Steering wheel actually turns the front wheels. Color black', 9123, '75.16', '117.44'),
(13, '1969 Ford Falcon', 'Classic Cars', '1:12', 'Second Gear Diecast', 'Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.', 1049, '83.05', '173.02'),
(14, '1970 Plymouth Hemi Cuda', 'Classic Cars', '1:12', 'Studio M Art Models', 'Very detailed 1970 Plymouth Cuda model in 1:12 scale. The Cuda is generally accepted as one of the fastest original muscle cars from the 1970s. This model is a reproduction of one of the orginal 652 cars built in 1970. Red color.', 5663, '31.92', '79.80'),
(15, '1957 Chevy Pickup', 'Trucks and Buses', '1:12', 'Exoto Designs', '1:12 scale die-cast about 20\" long Hood opens, Rubber wheels', 6125, '55.70', '118.50'),
(16, '1969 Dodge Charger', 'Classic Cars', '1:12', 'Welly Diecast Productions', 'Detailed model of the 1969 Dodge Charger. This model includes finely detailed interior and exterior features. Painted in red and white.', 7323, '58.73', '115.16'),
(17, '1940 Ford Pickup Truck', 'Trucks and Buses', '1:18', 'Studio M Art Models', 'This model features soft rubber tires, working steering, rubber mud guards, authentic Ford logos, detailed undercarriage, opening doors and hood, removable split rear gate, full size spare mounted in bed, detailed interior with opening glove box', 2613, '58.33', '116.67'),
(18, '1993 Mazda RX-7', 'Classic Cars', '1:18', 'Highway 66 Mini Classics', 'This model features, opening hood, opening doors, detailed engine, rear spoiler, opening trunk, working steering, tinted windows, baked enamel finish. Color red.', 3975, '83.51', '141.54'),
(19, '1937 <NAME>', 'Vintage Cars', '1:18', 'Motor City Art Classics', 'Features opening engine cover, doors, trunk, and fuel filler cap. Color black', 8693, '60.62', '102.74'),
(20, '1936 Mercedes-Benz 500K Special Roadster', 'Vintage Cars', '1:18', 'Studio M Art Models', 'This 1:18 scale replica is constructed of heavy die-cast metal and has all the features of the original: working doors and rumble seat, independent spring suspension, detailed interior, working steering system, and a bifold hood that reveals an engine so accurate that it even includes the wiring. All this is topped off with a baked enamel finish. Color white.', 8635, '24.26', '53.91'),
(21, '1965 Aston Martin DB5', 'Classic Cars', '1:18', 'Classic Metal Creations', 'Die-cast model of the silver 1965 Aston Martin DB5 in silver. This model includes full wire wheels and doors that open with fully detailed passenger compartment. In 1:18 scale, this model measures approximately 10 inches/20 cm long.', 9042, '65.96', '124.44'),
(22, '1980s Black Hawk Helicopter', 'Planes', '1:18', 'Red Start Diecast', '1:18 scale replica of actual Armys UH-60L BLACK HAWK Helicopter. 100% hand-assembled. Features rotating rotor blades, propeller blades and rubber wheels.', 5330, '77.27', '157.69'),
(23, '1917 Grand Touring Sedan', 'Vintage Cars', '1:18', 'Welly Diecast Productions', 'This 1:18 scale replica of the 1917 Grand Touring car has all the features you would expect from museum quality reproductions: all four doors and bi-fold hood opening, detailed engine and instrument panel, chrome-look trim, and tufted upholstery, all topped off with a factory baked-enamel finish.', 2724, '86.70', '170.00'),
(24, '1948 Porsche 356-A Roadster', 'Classic Cars', '1:18', 'Gearbox Collectibles', 'This precision die-cast replica features opening doors, superb detail and craftsmanship, working steering system, opening forward compartment, opening rear trunk with removable spare, 4 wheel independent spring suspension as well as factory baked enamel finish.', 8826, '53.90', '77.00'),
(25, '1995 Honda Civic', 'Classic Cars', '1:18', '<NAME>', 'This model features, opening hood, opening doors, detailed engine, rear spoiler, opening trunk, working steering, tinted windows, baked enamel finish. Color yellow.', 9772, '93.89', '142.25'),
(26, '1998 Chrysler Plymouth Prowler', 'Classic Cars', '1:18', 'Gearbox Collectibles', 'Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.', 4724, '101.51', '163.73'),
(27, '1911 Ford Town Car', 'Vintage Cars', '1:18', 'Motor City Art Classics', 'Features opening hood, opening doors, opening trunk, wide white wall tires, front door arm rests, working steering system.', 540, '33.30', '60.54'),
(28, '1964 Mercedes Tour Bus', 'Trucks and Buses', '1:18', 'Unimax Art Galleries', 'Exact replica. 100+ parts. working steering system, original logos', 8258, '74.86', '122.73'),
(29, '1932 Model A Ford J-Coupe', 'Vintage Cars', '1:18', 'Autoart Studio Design', 'This model features grille-mounted chrome horn, lift-up louvered hood, fold-down rumble seat, working steering system, chrome-covered spare, opening doors, detailed and wired engine', 9354, '58.48', '127.13'),
(30, '1926 Ford Fire Engine', 'Trucks and Buses', '1:18', 'Carousel DieCast Legends', 'Gleaming red handsome appearance. Everything is here the fire hoses, ladder, axes, bells, lanterns, ready to fight any inferno.', 2018, '24.92', '60.77'),
(31, 'P-51-D Mustang', 'Planes', '1:72', 'Gearbox Collectibles', 'Has retractable wheels and comes with a stand', 992, '49.00', '84.48'),
(32, '1936 <NAME>', 'Motorcycles', '1:18', 'Welly Diecast Productions', 'Intricately detailed with chrome accents and trim, official die-struck logos and baked enamel finish.', 4357, '24.23', '60.57'),
(33, '1928 Mercedes-Benz SSK', 'Vintage Cars', '1:18', 'Gearbox Collectibles', 'This 1:18 replica features grille-mounted chrome horn, lift-up louvered hood, fold-down rumble seat, working steering system, chrome-covered spare, opening doors, detailed and wired engine. Color black.', 548, '72.56', '168.75'),
(34, '1999 Indy 500 Monte Carlo SS', 'Classic Cars', '1:18', 'Red Start Diecast', 'Features include opening and closing doors. Color: Red', 8164, '56.76', '132.00'),
(35, '1913 Ford Model T Speedster', 'Vintage Cars', '1:18', 'Carousel DieCast Legends', 'This 250 part reproduction includes moving handbrakes, clutch, throttle and foot pedals, squeezable horn, detailed wired engine, removable water, gas, and oil cans, pivoting monocle windshield, all topped with a baked enamel red finish. Each replica comes with an Owners Title and Certificate of Authenticity. Color red.', 4189, '60.78', '101.31'),
(36, '1934 Ford V8 Coupe', 'Vintage Cars', '1:18', '<NAME>', 'Chrome Trim, Chrome Grille, Opening Hood, Opening Doors, Opening Trunk, Detailed Engine, Working Steering System', 5649, '34.35', '62.46'),
(37, '1999 Yamaha Speed Boat', 'Ships', '1:18', '<NAME>', 'Exact replica. Wood and Metal. Many extras including rigging, long boats, pilot house, anchors, etc. Comes with three masts, all square-rigged.', 4259, '51.61', '86.02'),
(38, '18th Century Vintage Horse Carriage', 'Vintage Cars', '1:18', 'Red Start Diecast', 'Hand crafted diecast-like metal horse carriage is re-created in about 1:18 scale of antique horse carriage. This antique style metal Stagecoach is all hand-assembled with many different parts.\r\n\r\nThis collectible metal horse carriage is painted in classic Red, and features turning steering wheel and is entirely hand-finished.', 5992, '60.74', '104.72'),
(39, '1903 Ford Model A', 'Vintage Cars', '1:18', 'Unimax Art Galleries', 'Features opening trunk, working steering system', 3913, '68.30', '136.59'),
(40, '1992 Ferrari 360 Spider red', 'Classic Cars', '1:18', 'Unimax Art Galleries', 'his replica features opening doors, superb detail and craftsmanship, working steering system, opening forward compartment, opening rear trunk with removable spare, 4 wheel independent spring suspension as well as factory baked enamel finish.', 8347, '77.90', '169.34'),
(41, '1985 Toyota Supra', 'Classic Cars', '1:18', 'Highway 66 Mini Classics', 'This model features soft rubber tires, working steering, rubber mud guards, authentic Ford logos, detailed undercarriage, opening doors and hood, removable split rear gate, full size spare mounted in bed, detailed interior with opening glove box', 7733, '57.01', '107.57'),
(42, 'Collectable Wooden Train', 'Trains', '1:18', 'Carousel DieCast Legends', 'Hand crafted wooden toy train set is in about 1:18 scale, 25 inches in total length including 2 additional carts, of actual vintage train. This antique style wooden toy train model set is all hand-assembled with 100% wood.', 6450, '67.56', '100.84'),
(43, '1969 Dodge Super Bee', 'Classic Cars', '1:18', 'Min Lin Diecast', 'This replica features opening doors, superb detail and craftsmanship, working steering system, opening forward compartment, opening rear trunk with removable spare, 4 wheel independent spring suspension as well as factory baked enamel finish.', 1917, '49.05', '80.41'),
(44, '1917 Maxwell Touring Car', 'Vintage Cars', '1:18', 'Exoto Designs', 'Features Gold Trim, Full Size Spare Tire, Chrome Trim, Chrome Grille, Opening Hood, Opening Doors, Opening Trunk, Detailed Engine, Working Steering System', 7913, '57.54', '99.21'),
(45, '1976 Ford Gran Torino', 'Classic Cars', '1:18', 'Gearbox Collectibles', 'Highly detailed 1976 Ford Gran Torino \"Starsky and Hutch\" diecast model. Very well constructed and painted in red and white patterns.', 9127, '73.49', '146.99'),
(46, '1948 Porsche Type 356 Roadster', 'Classic Cars', '1:18', 'Gearbox Collectibles', 'This model features working front and rear suspension on accurately replicated and actuating shock absorbers as well as opening engine cover, rear stabilizer flap, and 4 opening doors.', 8990, '62.16', '141.28'),
(47, '1957 Vespa GS150', 'Motorcycles', '1:18', 'Studio M Art Models', 'Features rotating wheels , working kick stand. Comes with stand.', 7689, '32.95', '62.17'),
(48, '1941 Chevrolet Special Deluxe Cabriolet', 'Vintage Cars', '1:18', 'Exoto Designs', 'Features opening hood, opening doors, opening trunk, wide white wall tires, front door arm rests, working steering system, leather upholstery. Color black.', 2378, '64.58', '105.87'),
(49, '1970 Triumph Spitfire', 'Classic Cars', '1:18', 'Min Lin Diecast', 'Features include opening and closing doors. Color: White.', 5545, '91.92', '143.62'),
(50, '1932 Alfa Romeo 8C2300 Spider Sport', 'Vintage Cars', '1:18', 'Exoto Designs', 'This 1:18 scale precision die cast replica features the 6 front headlights of the original, plus a detailed version of the 142 horsepower straight 8 engine, dual spares and their famous comprehensive dashboard. Color black.', 6553, '43.26', '92.03'),
(51, '1904 Buick Runabout', 'Vintage Cars', '1:18', 'Exoto Designs', 'Features opening trunk, working steering system', 8290, '52.66', '87.77'),
(52, '1940s Ford truck', 'Trucks and Buses', '1:18', 'Motor City Art Classics', 'This 1940s Ford Pick-Up truck is re-created in 1:18 scale of original 1940s Ford truck. This antique style metal 1940s Ford Flatbed truck is all hand-assembled. This collectible 1940s Pick-Up truck is painted in classic dark green color, and features rotating wheels.', 3128, '84.76', '121.08'),
(53, '1939 Cadillac Limousine', 'Vintage Cars', '1:18', 'Studio M Art Models', 'Features completely detailed interior including Velvet flocked drapes, deluxe wood grain floor, and a wood grain casket with seperate chrome handles', 6645, '23.14', '50.31'),
(54, '1957 Corvette Convertible', 'Classic Cars', '1:18', 'Classic Metal Creations', '1957 die cast Corvette Convertible in Roman Red with white sides and whitewall tires. 1:18 scale quality die-cast with detailed engine and underbvody. Now you can own The Classic Corvette.', 1249, '69.93', '148.80'),
(55, '1957 Ford Thunderbird', 'Classic Cars', '1:18', 'Studio M Art Models', 'This 1:18 scale precision die-cast replica, with its optional porthole hardtop and factory baked-enamel Thunderbird Bronze finish, is a 100% accurate rendition of this American classic.', 3209, '34.21', '71.27'),
(56, '1970 Chevy Chevelle SS 454', 'Classic Cars', '1:24', 'Unimax Art Galleries', 'This model features rotating wheels, working streering system and opening doors. All parts are particularly delicate due to their precise scale and require special care and attention. It should not be picked up by the doors, roof, hood or trunk.', 1005, '49.24', '73.49'),
(57, '1970 Dodge Coronet', 'Classic Cars', '1:24', 'Highway 66 Mini Classics', '1:24 scale die-cast about 18\" long doors open, hood opens and rubber wheels', 4074, '32.37', '57.80'),
(58, '1997 BMW R 1100 S', 'Motorcycles', '1:24', 'Autoart Studio Design', 'Detailed scale replica with working suspension and constructed from over 70 parts', 7003, '60.86', '112.70'),
(59, '1966 Shelby Cobra 427 S/C', 'Classic Cars', '1:24', 'Carousel DieCast Legends', 'This diecast model of the 1966 Shelby Cobra 427 S/C includes many authentic details and operating parts. The 1:24 scale model of this iconic lighweight sports car from the 1960s comes in silver and its own display case.', 8197, '29.18', '50.31'),
(60, '1928 British Royal Navy Airplane', 'Planes', '1:24', 'Classic Metal Creations', 'Official logos and insignias', 3627, '66.74', '109.42'),
(61, '1939 Chevrolet Deluxe Coupe', 'Vintage Cars', '1:24', 'Motor City Art Classics', 'This 1:24 scale die-cast replica of the 1939 Chevrolet Deluxe Coupe has the same classy look as the original. Features opening trunk, hood and doors and a showroom quality baked enamel finish.', 7332, '22.57', '33.19'),
(62, '1960 BSA Gold Star DBD34', 'Motorcycles', '1:24', 'Highway 66 Mini Classics', 'Detailed scale replica with working suspension and constructed from over 70 parts', 15, '37.32', '76.17'),
(63, '18th century schooner', 'Ships', '1:24', 'Carousel DieCast Legends', 'All wood with canvas sails. Many extras including rigging, long boats, pilot house, anchors, etc. Comes with 4 masts, all square-rigged.', 1898, '82.34', '122.89'),
(64, '1938 Cadillac V-16 Presidential Limousine', 'Vintage Cars', '1:24', 'Classic Metal Creations', 'This 1:24 scale precision die cast replica of the 1938 Cadillac V-16 Presidential Limousine has all the details of the original, from the flags on the front to an opening back seat compartment complete with telephone and rifle. Features factory baked-enamel black finish, hood goddess ornament, working jump seats.', 2847, '20.61', '44.80'),
(65, '1962 Volkswagen Microbus', 'Trucks and Buses', '1:24', 'Autoart Studio Design', 'This 1:18 scale die cast replica of the 1962 Microbus is loaded with features: A working steering system, opening front doors and tailgate, and famous two-tone factory baked enamel finish, are all topped of by the sliding, real fabric, sunroof.', 2327, '61.34', '127.79'),
(66, '1982 Ducati 900 Monster', 'Motorcycles', '1:24', 'Highway 66 Mini Classics', 'Features two-tone paint with chrome accents, superior die-cast detail , rotating wheels , working kick stand', 6840, '47.10', '69.26'),
(67, '1949 Jaguar XK 120', 'Classic Cars', '1:24', 'Classic Metal Creations', 'Precision-engineered from original Jaguar specification in perfect scale ratio. Features opening doors, superb detail and craftsmanship, working steering system, opening forward compartment, opening rear trunk with removable spare, 4 wheel independent spring suspension as well as factory baked enamel finish.', 2350, '47.25', '90.87'),
(68, '1958 Chevy Corvette Limited Edition', 'Classic Cars', '1:24', 'Carousel DieCast Legends', 'The operating parts of this 1958 Chevy Corvette Limited Edition are particularly delicate due to their precise scale and require special care and attention. Features rotating wheels, working streering, opening doors and trunk. Color dark green.', 2542, '15.91', '35.36'),
(69, '1900s Vintage Bi-Plane', 'Planes', '1:24', 'Autoart Studio Design', 'Hand crafted diecast-like metal bi-plane is re-created in about 1:24 scale of antique pioneer airplane. All hand-assembled with many different parts. Hand-painted in classic yellow and features correct markings of original airplane.', 5942, '34.25', '68.51'),
(70, '1952 Citroen-15CV', 'Classic Cars', '1:24', 'Exoto Designs', 'Precision crafted hand-assembled 1:18 scale reproduction of the 1952 15CV, with its independent spring suspension, working steering system, opening doors and hood, detailed engine and instrument panel, all topped of with a factory fresh baked enamel finish.', 1452, '72.82', '117.44'),
(71, '1982 Lamborghini Diablo', 'Classic Cars', '1:24', 'Second Gear Diecast', 'This replica features opening doors, superb detail and craftsmanship, working steering system, opening forward compartment, opening rear trunk with removable spare, 4 wheel independent spring suspension as well as factory baked enamel finish.', 7723, '16.24', '37.76'),
(72, '1912 Ford Model T Delivery Wagon', 'Vintage Cars', '1:24', 'Min Lin Diecast', 'This model features chrome trim and grille, opening hood, opening doors, opening trunk, detailed engine, working steering system. Color white.', 9173, '46.91', '88.51'),
(73, '1969 Chevrolet Camaro Z28', 'Classic Cars', '1:24', 'Exoto Designs', '1969 Z/28 Chevy Camaro 1:24 scale replica. The operating parts of this limited edition 1:24 scale diecast model car 1969 Chevy Camaro Z28- hood, trunk, wheels, streering, suspension and doors- are particularly delicate due to their precise scale and require special care and attention.', 4695, '50.51', '85.61'),
(74, '1971 Alpine Renault 1600s', 'Classic Cars', '1:24', 'Welly Diecast Productions', 'This 1971 Alpine Renault 1600s replica Features opening doors, superb detail and craftsmanship, working steering system, opening forward compartment, opening rear trunk with removable spare, 4 wheel independent spring suspension as well as factory baked enamel finish.', 7995, '38.58', '61.23'),
(75, '1937 Horch 930V Limousine', 'Vintage Cars', '1:24', 'Autoart Studio Design', 'Features opening hood, opening doors, opening trunk, wide white wall tires, front door arm rests, working steering system', 2902, '26.30', '65.75'),
(76, '2002 Chevy Corvette', 'Classic Cars', '1:24', 'Gearbox Collectibles', 'The operating parts of this limited edition Diecast 2002 Chevy Corvette 50th Anniversary Pace car Limited Edition are particularly delicate due to their precise scale and require special care and attention. Features rotating wheels, poseable streering, opening doors and trunk.', 9446, '62.11', '107.08'),
(77, '1940 Ford Delivery Sedan', 'Vintage Cars', '1:24', 'Carousel DieCast Legends', 'Chrome Trim, Chrome Grille, Opening Hood, Opening Doors, Opening Trunk, Detailed Engine, Working Steering System. Color black.', 6621, '48.64', '83.86'),
(78, '1956 Porsche 356A Coupe', 'Classic Cars', '1:18', 'Classic Metal Creations', 'Features include: Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.', 6600, '98.30', '140.43'),
(79, 'Corsair F4U ( Bird Cage)', 'Planes', '1:24', 'Second Gear Diecast', 'Has retractable wheels and comes with a stand. Official logos and insignias.', 6812, '29.34', '68.24'),
(80, '1936 Mercedes Benz 500k Roadster', 'Vintage Cars', '1:24', 'Red Start Diecast', 'This model features grille-mounted chrome horn, lift-up louvered hood, fold-down rumble seat, working steering system and rubber wheels. Color black.', 2081, '21.75', '41.03'),
(81, '1992 Porsche Cayenne Turbo Silver', 'Classic Cars', '1:24', 'Exoto Designs', 'This replica features opening doors, superb detail and craftsmanship, working steering system, opening forward compartment, opening rear trunk with removable spare, 4 wheel independent spring suspension as well as factory baked enamel finish.', 6582, '69.78', '118.28'),
(82, '1936 Chrysler Airflow', 'Vintage Cars', '1:24', 'Second Gear Diecast', 'Features opening trunk, working steering system. Color dark green.', 4710, '57.46', '97.39'),
(83, '1900s Vintage Tri-Plane', 'Planes', '1:24', 'Unimax Art Galleries', 'Hand crafted diecast-like metal Triplane is Re-created in about 1:24 scale of antique pioneer airplane. This antique style metal triplane is all hand-assembled with many different parts.', 2756, '36.23', '72.45'),
(84, '1961 Chevrolet Impala', 'Classic Cars', '1:18', 'Classic Metal Creations', 'This 1:18 scale precision die-cast reproduction of the 1961 Chevrolet Impala has all the features-doors, hood and trunk that open; detailed 409 cubic-inch engine; chrome dashboard and stick shift, two-tone interior; working steering system; all topped of with a factory baked-enamel finish.', 7869, '32.33', '80.84'),
(85, '1980’s GM Manhattan Express', 'Trucks and Buses', '1:32', 'Motor City Art Classics', 'This 1980’s era new look Manhattan express is still active, running from the Bronx to mid-town Manhattan. Has 35 opeining windows and working lights. Needs a battery.', 5099, '53.93', '96.31'),
(86, '1997 BMW F650 ST', 'Motorcycles', '1:32', 'Exoto Designs', 'Features official die-struck logos and baked enamel finish. Comes with stand.', 178, '66.92', '99.89'),
(87, '1982 Ducati 996 R', 'Motorcycles', '1:32', 'Gearbox Collectibles', 'Features rotating wheels , working kick stand. Comes with stand.', 9241, '24.14', '40.23'),
(88, '1954 Greyhound Scenicruiser', 'Trucks and Buses', '1:32', 'Classic Metal Creations', 'Model features bi-level seating, 50 windows, skylights & glare resistant glass, working steering system, original logos', 2874, '25.98', '54.11'),
(89, '1950s Chicago Surface Lines Streetcar', 'Trains', '1:32', 'Gearbox Collectibles', 'This streetcar is a joy to see. It has 80 separate windows, electric wire guides, detailed interiors with seats, poles and drivers controls, rolling and turning wheel assemblies, plus authentic factory baked-enamel finishes (Green Hornet for Chicago and Cream and Crimson for Boston).', 8601, '26.72', '62.14'),
(90, '1996 Peterbilt 379 Stake Bed with Outrigger', 'Trucks and Buses', '1:32', 'Red Start Diecast', 'This model features, opening doors, detailed engine, working steering, tinted windows, detailed interior, die-struck logos, removable stakes operating outriggers, detachable second trailer, functioning 360-degree self loader, precision molded resin trailer and trim, baked enamel finish on cab', 814, '33.61', '64.64'),
(91, '1928 Ford Phaeton Deluxe', 'Vintage Cars', '1:32', 'Highway 66 Mini Classics', 'This model features grille-mounted chrome horn, lift-up louvered hood, fold-down rumble seat, working steering system', 136, '33.02', '68.79'),
(92, '1974 Ducati 350 Mk3 Desmo', 'Motorcycles', '1:32', 'Second Gear Diecast', 'This model features two-tone paint with chrome accents, superior die-cast detail , rotating wheels , working kick stand', 3341, '56.13', '102.05'),
(93, '1930 Buick Marquette Phaeton', 'Vintage Cars', '1:50', 'Studio M Art Models', 'Features opening trunk, working steering system', 7062, '27.06', '43.64'),
(94, 'Diamond T620 Semi-Skirted Tanker', 'Trucks and Buses', '1:50', 'Highway 66 Mini Classics', 'This limited edition model is licensed and perfectly scaled for Lionel Trains. The Diamond T620 has been produced in solid precision diecast and painted with a fire baked enamel finish. It comes with a removable tanker and is a perfect model to add authenticity to your static train or car layout or to just have on display.', 1016, '68.29', '115.75'),
(95, '1962 City of Detroit Streetcar', 'Trains', '1:50', 'Classic Metal Creations', 'This streetcar is a joy to see. It has 99 separate windows, electric wire guides, detailed interiors with seats, poles and drivers controls, rolling and turning wheel assemblies, plus authentic factory baked-enamel finishes (Green Hornet for Chicago and Cream and Crimson for Boston).', 1645, '37.49', '58.58'),
(96, '2002 Yamaha YZR M1', 'Motorcycles', '1:50', 'Autoart Studio Design', 'Features rotating wheels , working kick stand. Comes with stand.', 600, '34.17', '81.36'),
(97, 'The Schooner Bluenose', 'Ships', '1:700', 'Autoart Studio Design', 'All wood with canvas sails. Measures 31 1/2 inches in Length, 22 inches High and 4 3/4 inches Wide. Many extras.\r\nThe schooner Bluenose was built in Nova Scotia in 1921 to fish the rough waters off the coast of Newfoundland. Because of the Bluenose racing prowess she became the pride of all Canadians. Still featured on stamps and the Canadian dime, the Bluenose was lost off Haiti in 1946.', 1897, '34.00', '66.67'),
(98, 'American Airlines: B767-300', 'Planes', '1:700', '<NAME>', 'Exact replia with official logos and insignias and retractable wheels', 5841, '51.15', '91.34'),
(99, 'The Mayflower', 'Ships', '1:700', 'Studio M Art Models', 'Measures 31 1/2 inches Long x 25 1/2 inches High x 10 5/8 inches Wide\r\nAll wood with canvas sail. Extras include long boats, rigging, ladders, railing, anchors, side cannons, hand painted, etc.', 737, '43.30', '86.61'),
(100, 'HMS Bounty', 'Ships', '1:700', 'Unimax Art Galleries', 'Measures 30 inches Long x 27 1/2 inches High x 4 3/4 inches Wide. \r\nMany extras including rigging, long boats, pilot house, anchors, etc. Comes with three masts, all square-rigged.', 3501, '39.83', '90.52'),
(101, 'America West Airlines B757-200', 'Planes', '1:700', 'Motor City Art Classics', 'Official logos and insignias. Working steering system. Rotating jet engines', 9653, '68.80', '99.72'),
(102, 'The USS Constitution Ship', 'Ships', '1:700', 'Red Start Diecast', 'All wood with canvas sails. Measures 31 1/2\" Length x 22 3/8\" High x 8 1/4\" Width. Extras include 4 boats on deck, sea sprite on bow, anchors, copper railing, pilot houses, etc.', 7083, '33.97', '72.28'),
(103, '1982 Camaro Z28', 'Classic Cars', '1:18', 'Carousel DieCast Legends', 'Features include opening and closing doors. Color: White. \r\nMeasures approximately 9 1/2\" Long.', 6934, '46.53', '101.15'),
(104, 'ATA: B757-300', 'Planes', '1:700', 'Highway 66 Mini Classics', 'Exact replia with official logos and insignias and retractable wheels', 7106, '59.33', '118.65'),
(105, 'F/A 18 Hornet 1/72', 'Planes', '1:72', 'Motor City Art Classics', '10\" Wingspan with retractable landing gears.Comes with pilot', 551, '54.40', '80.00'),
(106, 'The Titanic', 'Ships', '1:700', 'Carousel DieCast Legends', 'Completed model measures 19 1/2 inches long, 9 inches high, 3inches wide and is in barn red/black. All wood and metal.', 1956, '51.09', '100.17'),
(107, 'The Queen Mary', 'Ships', '1:700', 'Welly Diecast Productions', 'Exact replica. Wood and Metal. Many extras including rigging, long boats, pilot house, anchors, etc. Comes with three masts, all square-rigged.', 5088, '53.63', '99.31'),
(108, 'American Airlines: MD-11S', 'Planes', '1:700', 'Second Gear Diecast', 'Polished finish. Exact replia with official logos and insignias and retractable wheels', 8820, '36.27', '74.03'),
(109, 'Boeing X-32A JSF', 'Planes', '1:72', 'Motor City Art Classics', '10\" Wingspan with retractable landing gears.Comes with pilot', 4857, '32.77', '49.66'),
(110, '<NAME>', 'Ships', '1:72', 'Unimax Art Galleries', 'Measures 38 inches Long x 33 3/4 inches High. Includes a stand.\r\nMany extras including rigging, long boats, pilot house, anchors, etc. Comes with 2 masts, all square-rigged', 414, '33.30', '54.60') ON CONFLICT ("product_id") DO NOTHING;
/* Data for the table "order" */
insert into "order"("order_id", "order_date", "required_date", "shipped_date", "status", "comments", "customer_number") values
(10100, '2003-01-06', '2003-01-13', '2003-01-10', 'Shipped', NULL, 363),
(10101, '2003-01-09', '2003-01-18', '2003-01-11', 'Shipped', 'Check on availability.', 128),
(10102, '2003-01-10', '2003-01-18', '2003-01-14', 'Shipped', NULL, 181),
(10103, '2003-01-29', '2003-02-07', '2003-02-02', 'Shipped', NULL, 121),
(10104, '2003-01-31', '2003-02-09', '2003-02-01', 'Shipped', NULL, 141),
(10105, '2003-02-11', '2003-02-21', '2003-02-12', 'Shipped', NULL, 145),
(10106, '2003-02-17', '2003-02-24', '2003-02-21', 'Shipped', NULL, 278),
(10107, '2003-02-24', '2003-03-03', '2003-02-26', 'Shipped', 'Difficult to negotiate with customer. We need more marketing materials', 131),
(10108, '2003-03-03', '2003-03-12', '2003-03-08', 'Shipped', NULL, 385),
(10109, '2003-03-10', '2003-03-19', '2003-03-11', 'Shipped', 'Customer requested that FedEx Ground is used for this shipping', 486),
(10110, '2003-03-18', '2003-03-24', '2003-03-20', 'Shipped', NULL, 187),
(10111, '2003-03-25', '2003-03-31', '2003-03-30', 'Shipped', NULL, 129),
(10112, '2003-03-24', '2003-04-03', '2003-03-29', 'Shipped', 'Customer requested that ad materials (such as posters, pamphlets) be included in the shippment', 144),
(10113, '2003-03-26', '2003-04-02', '2003-03-27', 'Shipped', NULL, 124),
(10114, '2003-04-01', '2003-04-07', '2003-04-02', 'Shipped', NULL, 172),
(10115, '2003-04-04', '2003-04-12', '2003-04-07', 'Shipped', NULL, 424),
(10116, '2003-04-11', '2003-04-19', '2003-04-13', 'Shipped', NULL, 381),
(10117, '2003-04-16', '2003-04-24', '2003-04-17', 'Shipped', NULL, 148),
(10118, '2003-04-21', '2003-04-29', '2003-04-26', 'Shipped', 'Customer has worked with some of our vendors in the past and is aware of their MSRP', 216),
(10119, '2003-04-28', '2003-05-05', '2003-05-02', 'Shipped', NULL, 382),
(10120, '2003-04-29', '2003-05-08', '2003-05-01', 'Shipped', NULL, 114),
(10121, '2003-05-07', '2003-05-13', '2003-05-13', 'Shipped', NULL, 353),
(10122, '2003-05-08', '2003-05-16', '2003-05-13', 'Shipped', NULL, 350),
(10123, '2003-05-20', '2003-05-29', '2003-05-22', 'Shipped', NULL, 103),
(10124, '2003-05-21', '2003-05-29', '2003-05-25', 'Shipped', 'Customer very concerned about the exact color of the models. There is high risk that he may dispute the order because there is a slight color mismatch', 112),
(10125, '2003-05-21', '2003-05-27', '2003-05-24', 'Shipped', NULL, 114),
(10126, '2003-05-28', '2003-06-07', '2003-06-02', 'Shipped', NULL, 458),
(10127, '2003-06-03', '2003-06-09', '2003-06-06', 'Shipped', 'Customer requested special shippment. The instructions were passed along to the warehouse', 151),
(10128, '2003-06-06', '2003-06-12', '2003-06-11', 'Shipped', NULL, 141),
(10129, '2003-06-12', '2003-06-18', '2003-06-14', 'Shipped', NULL, 324),
(10130, '2003-06-16', '2003-06-24', '2003-06-21', 'Shipped', NULL, 198),
(10131, '2003-06-16', '2003-06-25', '2003-06-21', 'Shipped', NULL, 447),
(10132, '2003-06-25', '2003-07-01', '2003-06-28', 'Shipped', NULL, 323),
(10133, '2003-06-27', '2003-07-04', '2003-07-03', 'Shipped', NULL, 141),
(10134, '2003-07-01', '2003-07-10', '2003-07-05', 'Shipped', NULL, 250),
(10135, '2003-07-02', '2003-07-12', '2003-07-03', 'Shipped', NULL, 124),
(10136, '2003-07-04', '2003-07-14', '2003-07-06', 'Shipped', 'Customer is interested in buying more Ferrari models', 242),
(10137, '2003-07-10', '2003-07-20', '2003-07-14', 'Shipped', NULL, 353),
(10138, '2003-07-07', '2003-07-16', '2003-07-13', 'Shipped', NULL, 496),
(10139, '2003-07-16', '2003-07-23', '2003-07-21', 'Shipped', NULL, 282),
(10140, '2003-07-24', '2003-08-02', '2003-07-30', 'Shipped', NULL, 161),
(10141, '2003-08-01', '2003-08-09', '2003-08-04', 'Shipped', NULL, 334),
(10142, '2003-08-08', '2003-08-16', '2003-08-13', 'Shipped', NULL, 124),
(10143, '2003-08-10', '2003-08-18', '2003-08-12', 'Shipped', 'Can we deliver the new Ford Mustang models by end-of-quarter?', 320),
(10144, '2003-08-13', '2003-08-21', '2003-08-14', 'Shipped', NULL, 381),
(10145, '2003-08-25', '2003-09-02', '2003-08-31', 'Shipped', NULL, 205),
(10146, '2003-09-03', '2003-09-13', '2003-09-06', 'Shipped', NULL, 447),
(10147, '2003-09-05', '2003-09-12', '2003-09-09', 'Shipped', NULL, 379),
(10148, '2003-09-11', '2003-09-21', '2003-09-15', 'Shipped', 'They want to reevaluate their terms agreement with Finance.', 276),
(10149, '2003-09-12', '2003-09-18', '2003-09-17', 'Shipped', NULL, 487),
(10150, '2003-09-19', '2003-09-27', '2003-09-21', 'Shipped', 'They want to reevaluate their terms agreement with Finance.', 148),
(10151, '2003-09-21', '2003-09-30', '2003-09-24', 'Shipped', NULL, 311),
(10152, '2003-09-25', '2003-10-03', '2003-10-01', 'Shipped', NULL, 333),
(10153, '2003-09-28', '2003-10-05', '2003-10-03', 'Shipped', NULL, 141),
(10154, '2003-10-02', '2003-10-12', '2003-10-08', 'Shipped', NULL, 219),
(10155, '2003-10-06', '2003-10-13', '2003-10-07', 'Shipped', NULL, 186),
(10156, '2003-10-08', '2003-10-17', '2003-10-11', 'Shipped', NULL, 141),
(10157, '2003-10-09', '2003-10-15', '2003-10-14', 'Shipped', NULL, 473),
(10158, '2003-10-10', '2003-10-18', '2003-10-15', 'Shipped', NULL, 121),
(10159, '2003-10-10', '2003-10-19', '2003-10-16', 'Shipped', NULL, 321),
(10160, '2003-10-11', '2003-10-17', '2003-10-17', 'Shipped', NULL, 347),
(10161, '2003-10-17', '2003-10-25', '2003-10-20', 'Shipped', NULL, 227),
(10162, '2003-10-18', '2003-10-26', '2003-10-19', 'Shipped', NULL, 321),
(10163, '2003-10-20', '2003-10-27', '2003-10-24', 'Shipped', NULL, 424),
(10164, '2003-10-21', '2003-10-30', '2003-10-23', 'Resolved', 'This order was disputed, but resolved on 11/1/2003; Customer doesnt like the colors and precision of the models.', 452),
(10165, '2003-10-22', '2003-10-31', '2003-12-26', 'Shipped', 'This order was on hold because customerss credit limit had been exceeded. Order will ship when payment is received', 148),
(10166, '2003-10-21', '2003-10-30', '2003-10-27', 'Shipped', NULL, 462),
(10167, '2003-10-23', '2003-10-30', NULL, 'Cancelled', 'Customer called to cancel. The warehouse was notified in time and the order didnt ship. They have a new VP of Sales and are shifting their sales model. Our VP of Sales should contact them.', 448),
(10168, '2003-10-28', '2003-11-03', '2003-11-01', 'Shipped', NULL, 161),
(10169, '2003-11-04', '2003-11-14', '2003-11-09', 'Shipped', NULL, 276),
(10170, '2003-11-04', '2003-11-12', '2003-11-07', 'Shipped', NULL, 452),
(10171, '2003-11-05', '2003-11-13', '2003-11-07', 'Shipped', NULL, 233),
(10172, '2003-11-05', '2003-11-14', '2003-11-11', 'Shipped', NULL, 175),
(10173, '2003-11-05', '2003-11-15', '2003-11-09', 'Shipped', 'Cautious optimism. We have happy customers here, if we can keep them well stocked. I need all the information I can get on the planned shippments of Porches', 278),
(10174, '2003-11-06', '2003-11-15', '2003-11-10', 'Shipped', NULL, 333),
(10175, '2003-11-06', '2003-11-14', '2003-11-09', 'Shipped', NULL, 324),
(10176, '2003-11-06', '2003-11-15', '2003-11-12', 'Shipped', NULL, 386),
(10177, '2003-11-07', '2003-11-17', '2003-11-12', 'Shipped', NULL, 344),
(10178, '2003-11-08', '2003-11-16', '2003-11-10', 'Shipped', 'Custom shipping instructions sent to warehouse', 242),
(10179, '2003-11-11', '2003-11-17', '2003-11-13', 'Cancelled', 'Customer cancelled due to urgent budgeting issues. Must be cautious when dealing with them in the future. Since order shipped already we must discuss who would cover the shipping charges.', 496),
(10180, '2003-11-11', '2003-11-19', '2003-11-14', 'Shipped', NULL, 171),
(10181, '2003-11-12', '2003-11-19', '2003-11-15', 'Shipped', NULL, 167),
(10182, '2003-11-12', '2003-11-21', '2003-11-18', 'Shipped', NULL, 124),
(10183, '2003-11-13', '2003-11-22', '2003-11-15', 'Shipped', 'We need to keep in close contact with their Marketing VP. He is the decision maker for all their purchases.', 339),
(10184, '2003-11-14', '2003-11-22', '2003-11-20', 'Shipped', NULL, 484),
(10185, '2003-11-14', '2003-11-21', '2003-11-20', 'Shipped', NULL, 320),
(10186, '2003-11-14', '2003-11-20', '2003-11-18', 'Shipped', 'They want to reevaluate their terms agreement with the VP of Sales', 489),
(10187, '2003-11-15', '2003-11-24', '2003-11-16', 'Shipped', NULL, 211),
(10188, '2003-11-18', '2003-11-26', '2003-11-24', 'Shipped', NULL, 167),
(10189, '2003-11-18', '2003-11-25', '2003-11-24', 'Shipped', 'They want to reevaluate their terms agreement with Finance.', 205),
(10190, '2003-11-19', '2003-11-29', '2003-11-20', 'Shipped', NULL, 141),
(10191, '2003-11-20', '2003-11-30', '2003-11-24', 'Shipped', 'We must be cautions with this customer. Their VP of Sales resigned. Company may be heading down.', 259),
(10192, '2003-11-20', '2003-11-29', '2003-11-25', 'Shipped', NULL, 363),
(10193, '2003-11-21', '2003-11-28', '2003-11-27', 'Shipped', NULL, 471),
(10194, '2003-11-25', '2003-12-02', '2003-11-26', 'Shipped', NULL, 146),
(10195, '2003-11-25', '2003-12-01', '2003-11-28', 'Shipped', NULL, 319),
(10196, '2003-11-26', '2003-12-03', '2003-12-01', 'Shipped', NULL, 455),
(10197, '2003-11-26', '2003-12-02', '2003-12-01', 'Shipped', 'Customer inquired about remote controlled models and gold models.', 216),
(10198, '2003-11-27', '2003-12-06', '2003-12-03', 'Shipped', NULL, 385),
(10199, '2003-12-01', '2003-12-10', '2003-12-06', 'Shipped', NULL, 475),
(10200, '2003-12-01', '2003-12-09', '2003-12-06', 'Shipped', NULL, 211),
(10201, '2003-12-01', '2003-12-11', '2003-12-02', 'Shipped', NULL, 129),
(10202, '2003-12-02', '2003-12-09', '2003-12-06', 'Shipped', NULL, 357),
(10203, '2003-12-02', '2003-12-11', '2003-12-07', 'Shipped', NULL, 141),
(10204, '2003-12-02', '2003-12-10', '2003-12-04', 'Shipped', NULL, 151),
(10205, '2003-12-03', '2003-12-09', '2003-12-07', 'Shipped', ' I need all the information I can get on our competitors.', 141),
(10206, '2003-12-05', '2003-12-13', '2003-12-08', 'Shipped', 'Can we renegotiate this one?', 202),
(10207, '2003-12-09', '2003-12-17', '2003-12-11', 'Shipped', 'Check on availability.', 495),
(10208, '2004-01-02', '2004-01-11', '2004-01-04', 'Shipped', NULL, 146),
(10209, '2004-01-09', '2004-01-15', '2004-01-12', 'Shipped', NULL, 347),
(10210, '2004-01-12', '2004-01-22', '2004-01-20', 'Shipped', NULL, 177),
(10211, '2004-01-15', '2004-01-25', '2004-01-18', 'Shipped', NULL, 406),
(10212, '2004-01-16', '2004-01-24', '2004-01-18', 'Shipped', NULL, 141),
(10213, '2004-01-22', '2004-01-28', '2004-01-27', 'Shipped', 'Difficult to negotiate with customer. We need more marketing materials', 489),
(10214, '2004-01-26', '2004-02-04', '2004-01-29', 'Shipped', NULL, 458),
(10215, '2004-01-29', '2004-02-08', '2004-02-01', 'Shipped', 'Customer requested that FedEx Ground is used for this shipping', 475),
(10216, '2004-02-02', '2004-02-10', '2004-02-04', 'Shipped', NULL, 256),
(10217, '2004-02-04', '2004-02-14', '2004-02-06', 'Shipped', NULL, 166),
(10218, '2004-02-09', '2004-02-16', '2004-02-11', 'Shipped', 'Customer requested that ad materials (such as posters, pamphlets) be included in the shippment', 473),
(10219, '2004-02-10', '2004-02-17', '2004-02-12', 'Shipped', NULL, 487),
(10220, '2004-02-12', '2004-02-19', '2004-02-16', 'Shipped', NULL, 189),
(10221, '2004-02-18', '2004-02-26', '2004-02-19', 'Shipped', NULL, 314),
(10222, '2004-02-19', '2004-02-27', '2004-02-20', 'Shipped', NULL, 239),
(10223, '2004-02-20', '2004-02-29', '2004-02-24', 'Shipped', NULL, 114),
(10224, '2004-02-21', '2004-03-02', '2004-02-26', 'Shipped', 'Customer has worked with some of our vendors in the past and is aware of their MSRP', 171),
(10225, '2004-02-22', '2004-03-01', '2004-02-24', 'Shipped', NULL, 298),
(10226, '2004-02-26', '2004-03-06', '2004-03-02', 'Shipped', NULL, 239),
(10227, '2004-03-02', '2004-03-12', '2004-03-08', 'Shipped', NULL, 146),
(10228, '2004-03-10', '2004-03-18', '2004-03-13', 'Shipped', NULL, 173),
(10229, '2004-03-11', '2004-03-20', '2004-03-12', 'Shipped', NULL, 124),
(10230, '2004-03-15', '2004-03-24', '2004-03-20', 'Shipped', 'Customer very concerned about the exact color of the models. There is high risk that he may dispute the order because there is a slight color mismatch', 128),
(10231, '2004-03-19', '2004-03-26', '2004-03-25', 'Shipped', NULL, 344),
(10232, '2004-03-20', '2004-03-30', '2004-03-25', 'Shipped', NULL, 240),
(10233, '2004-03-29', '2004-04-04', '2004-04-02', 'Shipped', 'Customer requested special shippment. The instructions were passed along to the warehouse', 328),
(10234, '2004-03-30', '2004-04-05', '2004-04-02', 'Shipped', NULL, 412),
(10235, '2004-04-02', '2004-04-12', '2004-04-06', 'Shipped', NULL, 260),
(10236, '2004-04-03', '2004-04-11', '2004-04-08', 'Shipped', NULL, 486),
(10237, '2004-04-05', '2004-04-12', '2004-04-10', 'Shipped', NULL, 181),
(10238, '2004-04-09', '2004-04-16', '2004-04-10', 'Shipped', NULL, 145),
(10239, '2004-04-12', '2004-04-21', '2004-04-17', 'Shipped', NULL, 311),
(10240, '2004-04-13', '2004-04-20', '2004-04-20', 'Shipped', NULL, 177),
(10241, '2004-04-13', '2004-04-20', '2004-04-19', 'Shipped', NULL, 209),
(10242, '2004-04-20', '2004-04-28', '2004-04-25', 'Shipped', 'Customer is interested in buying more Ferrari models', 456),
(10243, '2004-04-26', '2004-05-03', '2004-04-28', 'Shipped', NULL, 495),
(10244, '2004-04-29', '2004-05-09', '2004-05-04', 'Shipped', NULL, 141),
(10245, '2004-05-04', '2004-05-12', '2004-05-09', 'Shipped', NULL, 455),
(10246, '2004-05-05', '2004-05-13', '2004-05-06', 'Shipped', NULL, 141),
(10247, '2004-05-05', '2004-05-11', '2004-05-08', 'Shipped', NULL, 334),
(10248, '2004-05-07', '2004-05-14', NULL, 'Cancelled', 'Order was mistakenly placed. The warehouse noticed the lack of documentation.', 131),
(10249, '2004-05-08', '2004-05-17', '2004-05-11', 'Shipped', 'Can we deliver the new Ford Mustang models by end-of-quarter?', 173),
(10250, '2004-05-11', '2004-05-19', '2004-05-15', 'Shipped', NULL, 450),
(10251, '2004-05-18', '2004-05-24', '2004-05-24', 'Shipped', NULL, 328),
(10252, '2004-05-26', '2004-06-04', '2004-05-29', 'Shipped', NULL, 406),
(10253, '2004-06-01', '2004-06-09', '2004-06-02', 'Cancelled', 'Customer disputed the order and we agreed to cancel it. We must be more cautions with this customer going forward, since they are very hard to please. We must cover the shipping fees.', 201),
(10254, '2004-06-03', '2004-06-13', '2004-06-04', 'Shipped', 'Customer requested that DHL is used for this shipping', 323),
(10255, '2004-06-04', '2004-06-12', '2004-06-09', 'Shipped', NULL, 209),
(10256, '2004-06-08', '2004-06-16', '2004-06-10', 'Shipped', NULL, 145),
(10257, '2004-06-14', '2004-06-24', '2004-06-15', 'Shipped', NULL, 450),
(10258, '2004-06-15', '2004-06-25', '2004-06-23', 'Shipped', NULL, 398),
(10259, '2004-06-15', '2004-06-22', '2004-06-17', 'Shipped', NULL, 166),
(10260, '2004-06-16', '2004-06-22', NULL, 'Cancelled', 'Customer heard complaints from their customers and called to cancel this order. Will notify the Sales Manager.', 357),
(10261, '2004-06-17', '2004-06-25', '2004-06-22', 'Shipped', NULL, 233),
(10262, '2004-06-24', '2004-07-01', NULL, 'Cancelled', 'This customer found a better offer from one of our competitors. Will call back to renegotiate.', 141),
(10263, '2004-06-28', '2004-07-04', '2004-07-02', 'Shipped', NULL, 175),
(10264, '2004-06-30', '2004-07-06', '2004-07-01', 'Shipped', 'Customer will send a truck to our local warehouse on 7/1/2004', 362),
(10265, '2004-07-02', '2004-07-09', '2004-07-07', 'Shipped', NULL, 471),
(10266, '2004-07-06', '2004-07-14', '2004-07-10', 'Shipped', NULL, 386),
(10267, '2004-07-07', '2004-07-17', '2004-07-09', 'Shipped', NULL, 151),
(10268, '2004-07-12', '2004-07-18', '2004-07-14', 'Shipped', NULL, 412),
(10269, '2004-07-16', '2004-07-22', '2004-07-18', 'Shipped', NULL, 382),
(10270, '2004-07-19', '2004-07-27', '2004-07-24', 'Shipped', 'Can we renegotiate this one?', 282),
(10271, '2004-07-20', '2004-07-29', '2004-07-23', 'Shipped', NULL, 124),
(10272, '2004-07-20', '2004-07-26', '2004-07-22', 'Shipped', NULL, 157),
(10273, '2004-07-21', '2004-07-28', '2004-07-22', 'Shipped', NULL, 314),
(10274, '2004-07-21', '2004-07-29', '2004-07-22', 'Shipped', NULL, 379),
(10275, '2004-07-23', '2004-08-02', '2004-07-29', 'Shipped', NULL, 119),
(10276, '2004-08-02', '2004-08-11', '2004-08-08', 'Shipped', NULL, 204),
(10277, '2004-08-04', '2004-08-12', '2004-08-05', 'Shipped', NULL, 148),
(10278, '2004-08-06', '2004-08-16', '2004-08-09', 'Shipped', NULL, 112),
(10279, '2004-08-09', '2004-08-19', '2004-08-15', 'Shipped', 'Cautious optimism. We have happy customers here, if we can keep them well stocked. I need all the information I can get on the planned shippments of Porches', 141),
(10280, '2004-08-17', '2004-08-27', '2004-08-19', 'Shipped', NULL, 249),
(10281, '2004-08-19', '2004-08-28', '2004-08-23', 'Shipped', NULL, 157),
(10282, '2004-08-20', '2004-08-26', '2004-08-22', 'Shipped', NULL, 124),
(10283, '2004-08-20', '2004-08-30', '2004-08-23', 'Shipped', NULL, 260),
(10284, '2004-08-21', '2004-08-29', '2004-08-26', 'Shipped', 'Custom shipping instructions sent to warehouse', 299),
(10285, '2004-08-27', '2004-09-04', '2004-08-31', 'Shipped', NULL, 286),
(10286, '2004-08-28', '2004-09-06', '2004-09-01', 'Shipped', NULL, 172),
(10287, '2004-08-30', '2004-09-06', '2004-09-01', 'Shipped', NULL, 298),
(10288, '2004-09-01', '2004-09-11', '2004-09-05', 'Shipped', NULL, 166),
(10289, '2004-09-03', '2004-09-13', '2004-09-04', 'Shipped', 'We need to keep in close contact with their Marketing VP. He is the decision maker for all their purchases.', 167),
(10290, '2004-09-07', '2004-09-15', '2004-09-13', 'Shipped', NULL, 198),
(10291, '2004-09-08', '2004-09-17', '2004-09-14', 'Shipped', NULL, 448),
(10292, '2004-09-08', '2004-09-18', '2004-09-11', 'Shipped', 'They want to reevaluate their terms agreement with Finance.', 131),
(10293, '2004-09-09', '2004-09-18', '2004-09-14', 'Shipped', NULL, 249),
(10294, '2004-09-10', '2004-09-17', '2004-09-14', 'Shipped', NULL, 204),
(10295, '2004-09-10', '2004-09-17', '2004-09-14', 'Shipped', 'They want to reevaluate their terms agreement with Finance.', 362),
(10296, '2004-09-15', '2004-09-22', '2004-09-16', 'Shipped', NULL, 415),
(10297, '2004-09-16', '2004-09-22', '2004-09-21', 'Shipped', 'We must be cautions with this customer. Their VP of Sales resigned. Company may be heading down.', 189),
(10298, '2004-09-27', '2004-10-05', '2004-10-01', 'Shipped', NULL, 103),
(10299, '2004-09-30', '2004-10-10', '2004-10-01', 'Shipped', NULL, 186),
(10300, '2003-10-04', '2003-10-13', '2003-10-09', 'Shipped', NULL, 128),
(10301, '2003-10-05', '2003-10-15', '2003-10-08', 'Shipped', NULL, 299),
(10302, '2003-10-06', '2003-10-16', '2003-10-07', 'Shipped', NULL, 201),
(10303, '2004-10-06', '2004-10-14', '2004-10-09', 'Shipped', 'Customer inquired about remote controlled models and gold models.', 484),
(10304, '2004-10-11', '2004-10-20', '2004-10-17', 'Shipped', NULL, 256),
(10305, '2004-10-13', '2004-10-22', '2004-10-15', 'Shipped', 'Check on availability.', 286),
(10306, '2004-10-14', '2004-10-21', '2004-10-17', 'Shipped', NULL, 187),
(10307, '2004-10-14', '2004-10-23', '2004-10-20', 'Shipped', NULL, 339),
(10308, '2004-10-15', '2004-10-24', '2004-10-20', 'Shipped', 'Customer requested that FedEx Ground is used for this shipping', 319),
(10309, '2004-10-15', '2004-10-24', '2004-10-18', 'Shipped', NULL, 121),
(10310, '2004-10-16', '2004-10-24', '2004-10-18', 'Shipped', NULL, 259),
(10311, '2004-10-16', '2004-10-23', '2004-10-20', 'Shipped', 'Difficult to negotiate with customer. We need more marketing materials', 141),
(10312, '2004-10-21', '2004-10-27', '2004-10-23', 'Shipped', NULL, 124),
(10313, '2004-10-22', '2004-10-28', '2004-10-25', 'Shipped', 'Customer requested that FedEx Ground is used for this shipping', 202),
(10314, '2004-10-22', '2004-11-01', '2004-10-23', 'Shipped', NULL, 227),
(10315, '2004-10-29', '2004-11-08', '2004-10-30', 'Shipped', NULL, 119),
(10316, '2004-11-01', '2004-11-09', '2004-11-07', 'Shipped', 'Customer requested that ad materials (such as posters, pamphlets) be included in the shippment', 240),
(10317, '2004-11-02', '2004-11-12', '2004-11-08', 'Shipped', NULL, 161),
(10318, '2004-11-02', '2004-11-09', '2004-11-07', 'Shipped', NULL, 157),
(10319, '2004-11-03', '2004-11-11', '2004-11-06', 'Shipped', 'Customer requested that DHL is used for this shipping', 456),
(10320, '2004-11-03', '2004-11-13', '2004-11-07', 'Shipped', NULL, 144),
(10321, '2004-11-04', '2004-11-12', '2004-11-07', 'Shipped', NULL, 462),
(10322, '2004-11-04', '2004-11-12', '2004-11-10', 'Shipped', 'Customer has worked with some of our vendors in the past and is aware of their MSRP', 363),
(10323, '2004-11-05', '2004-11-12', '2004-11-09', 'Shipped', NULL, 128),
(10324, '2004-11-05', '2004-11-11', '2004-11-08', 'Shipped', NULL, 181),
(10325, '2004-11-05', '2004-11-13', '2004-11-08', 'Shipped', NULL, 121),
(10326, '2004-11-09', '2004-11-16', '2004-11-10', 'Shipped', NULL, 144),
(10327, '2004-11-10', '2004-11-19', '2004-11-13', 'Resolved', 'Order was disputed and resolved on 12/1/04. The Sales Manager was involved. Customer claims the scales of the models dont match what was discussed.', 145),
(10328, '2004-11-12', '2004-11-21', '2004-11-18', 'Shipped', 'Customer very concerned about the exact color of the models. There is high risk that he may dispute the order because there is a slight color mismatch', 278),
(10329, '2004-11-15', '2004-11-24', '2004-11-16', 'Shipped', NULL, 131),
(10330, '2004-11-16', '2004-11-25', '2004-11-21', 'Shipped', NULL, 385),
(10331, '2004-11-17', '2004-11-23', '2004-11-23', 'Shipped', 'Customer requested special shippment. The instructions were passed along to the warehouse', 486),
(10332, '2004-11-17', '2004-11-25', '2004-11-18', 'Shipped', NULL, 187),
(10333, '2004-11-18', '2004-11-27', '2004-11-20', 'Shipped', NULL, 129),
(10334, '2004-11-19', '2004-11-28', NULL, 'On Hold', 'The outstaniding balance for this customer exceeds their credit limit. Order will be shipped when a payment is received.', 144),
(10335, '2004-11-19', '2004-11-29', '2004-11-23', 'Shipped', NULL, 124),
(10336, '2004-11-20', '2004-11-26', '2004-11-24', 'Shipped', 'Customer requested that DHL is used for this shipping', 172),
(10337, '2004-11-21', '2004-11-30', '2004-11-26', 'Shipped', NULL, 424),
(10338, '2004-11-22', '2004-12-02', '2004-11-27', 'Shipped', NULL, 381),
(10339, '2004-11-23', '2004-11-30', '2004-11-30', 'Shipped', NULL, 398),
(10340, '2004-11-24', '2004-12-01', '2004-11-25', 'Shipped', 'Customer is interested in buying more Ferrari models', 216),
(10341, '2004-11-24', '2004-12-01', '2004-11-29', 'Shipped', NULL, 382),
(10342, '2004-11-24', '2004-12-01', '2004-11-29', 'Shipped', NULL, 114),
(10343, '2004-11-24', '2004-12-01', '2004-11-26', 'Shipped', NULL, 353),
(10344, '2004-11-25', '2004-12-02', '2004-11-29', 'Shipped', NULL, 350),
(10345, '2004-11-25', '2004-12-01', '2004-11-26', 'Shipped', NULL, 103),
(10346, '2004-11-29', '2004-12-05', '2004-11-30', 'Shipped', NULL, 112),
(10347, '2004-11-29', '2004-12-07', '2004-11-30', 'Shipped', 'Can we deliver the new Ford Mustang models by end-of-quarter?', 114),
(10348, '2004-11-01', '2004-11-08', '2004-11-05', 'Shipped', NULL, 458),
(10349, '2004-12-01', '2004-12-07', '2004-12-03', 'Shipped', NULL, 151),
(10350, '2004-12-02', '2004-12-08', '2004-12-05', 'Shipped', NULL, 141),
(10351, '2004-12-03', '2004-12-11', '2004-12-07', 'Shipped', NULL, 324),
(10352, '2004-12-03', '2004-12-12', '2004-12-09', 'Shipped', NULL, 198),
(10353, '2004-12-04', '2004-12-11', '2004-12-05', 'Shipped', NULL, 447),
(10354, '2004-12-04', '2004-12-10', '2004-12-05', 'Shipped', NULL, 323),
(10355, '2004-12-07', '2004-12-14', '2004-12-13', 'Shipped', NULL, 141),
(10356, '2004-12-09', '2004-12-15', '2004-12-12', 'Shipped', NULL, 250),
(10357, '2004-12-10', '2004-12-16', '2004-12-14', 'Shipped', NULL, 124),
(10358, '2004-12-10', '2004-12-16', '2004-12-16', 'Shipped', 'Customer requested that DHL is used for this shipping', 141),
(10359, '2004-12-15', '2004-12-23', '2004-12-18', 'Shipped', NULL, 353),
(10360, '2004-12-16', '2004-12-22', '2004-12-18', 'Shipped', NULL, 496),
(10361, '2004-12-17', '2004-12-24', '2004-12-20', 'Shipped', NULL, 282),
(10362, '2005-01-05', '2005-01-16', '2005-01-10', 'Shipped', NULL, 161),
(10363, '2005-01-06', '2005-01-12', '2005-01-10', 'Shipped', NULL, 334),
(10364, '2005-01-06', '2005-01-17', '2005-01-09', 'Shipped', NULL, 350),
(10365, '2005-01-07', '2005-01-18', '2005-01-11', 'Shipped', NULL, 320),
(10366, '2005-01-10', '2005-01-19', '2005-01-12', 'Shipped', NULL, 381),
(10367, '2005-01-12', '2005-01-21', '2005-01-16', 'Resolved', 'This order was disputed and resolved on 2/1/2005. Customer claimed that container with shipment was damaged. FedExs investigation proved this wrong.', 205),
(10368, '2005-01-19', '2005-01-27', '2005-01-24', 'Shipped', 'Can we renegotiate this one?', 124),
(10369, '2005-01-20', '2005-01-28', '2005-01-24', 'Shipped', NULL, 379),
(10370, '2005-01-20', '2005-02-01', '2005-01-25', 'Shipped', NULL, 276),
(10371, '2005-01-23', '2005-02-03', '2005-01-25', 'Shipped', NULL, 124),
(10372, '2005-01-26', '2005-02-05', '2005-01-28', 'Shipped', NULL, 398),
(10373, '2005-01-31', '2005-02-08', '2005-02-06', 'Shipped', NULL, 311),
(10374, '2005-02-02', '2005-02-09', '2005-02-03', 'Shipped', NULL, 333),
(10375, '2005-02-03', '2005-02-10', '2005-02-06', 'Shipped', NULL, 119),
(10376, '2005-02-08', '2005-02-18', '2005-02-13', 'Shipped', NULL, 219),
(10377, '2005-02-09', '2005-02-21', '2005-02-12', 'Shipped', 'Cautious optimism. We have happy customers here, if we can keep them well stocked. I need all the information I can get on the planned shippments of Porches', 186),
(10378, '2005-02-10', '2005-02-18', '2005-02-11', 'Shipped', NULL, 141),
(10379, '2005-02-10', '2005-02-18', '2005-02-11', 'Shipped', NULL, 141),
(10380, '2005-02-16', '2005-02-24', '2005-02-18', 'Shipped', NULL, 141),
(10381, '2005-02-17', '2005-02-25', '2005-02-18', 'Shipped', NULL, 321),
(10382, '2005-02-17', '2005-02-23', '2005-02-18', 'Shipped', 'Custom shipping instructions sent to warehouse', 124),
(10383, '2005-02-22', '2005-03-02', '2005-02-25', 'Shipped', NULL, 141),
(10384, '2005-02-23', '2005-03-06', '2005-02-27', 'Shipped', NULL, 321),
(10385, '2005-02-28', '2005-03-09', '2005-03-01', 'Shipped', NULL, 124),
(10386, '2005-03-01', '2005-03-09', '2005-03-06', 'Resolved', 'Disputed then Resolved on 3/15/2005. Customer doesnt like the craftsmaship of the models.', 141),
(10387, '2005-03-02', '2005-03-09', '2005-03-06', 'Shipped', 'We need to keep in close contact with their Marketing VP. He is the decision maker for all their purchases.', 148),
(10388, '2005-03-03', '2005-03-11', '2005-03-09', 'Shipped', NULL, 462),
(10389, '2005-03-03', '2005-03-09', '2005-03-08', 'Shipped', NULL, 448),
(10390, '2005-03-04', '2005-03-11', '2005-03-07', 'Shipped', 'They want to reevaluate their terms agreement with Finance.', 124),
(10391, '2005-03-09', '2005-03-20', '2005-03-15', 'Shipped', NULL, 276),
(10392, '2005-03-10', '2005-03-18', '2005-03-12', 'Shipped', NULL, 452),
(10393, '2005-03-11', '2005-03-22', '2005-03-14', 'Shipped', 'They want to reevaluate their terms agreement with Finance.', 323),
(10394, '2005-03-15', '2005-03-25', '2005-03-19', 'Shipped', NULL, 141),
(10395, '2005-03-17', '2005-03-24', '2005-03-23', 'Shipped', 'We must be cautions with this customer. Their VP of Sales resigned. Company may be heading down.', 250),
(10396, '2005-03-23', '2005-04-02', '2005-03-28', 'Shipped', NULL, 124),
(10397, '2005-03-28', '2005-04-09', '2005-04-01', 'Shipped', NULL, 242),
(10398, '2005-03-30', '2005-04-09', '2005-03-31', 'Shipped', NULL, 353),
(10399, '2005-04-01', '2005-04-12', '2005-04-03', 'Shipped', NULL, 496),
(10400, '2005-04-01', '2005-04-11', '2005-04-04', 'Shipped', 'Customer requested that DHL is used for this shipping', 450),
(10401, '2005-04-03', '2005-04-14', NULL, 'On Hold', 'Customer credit limit exceeded. Will ship when a payment is received.', 328),
(10402, '2005-04-07', '2005-04-14', '2005-04-12', 'Shipped', NULL, 406),
(10403, '2005-04-08', '2005-04-18', '2005-04-11', 'Shipped', NULL, 201),
(10404, '2005-04-08', '2005-04-14', '2005-04-11', 'Shipped', NULL, 323),
(10405, '2005-04-14', '2005-04-24', '2005-04-20', 'Shipped', NULL, 209),
(10406, '2005-04-15', '2005-04-25', '2005-04-21', 'Disputed', 'Customer claims container with shipment was damaged during shipping and some items were missing. I am talking to FedEx about this.', 145),
(10407, '2005-04-22', '2005-05-04', NULL, 'On Hold', 'Customer credit limit exceeded. Will ship when a payment is received.', 450),
(10408, '2005-04-22', '2005-04-29', '2005-04-27', 'Shipped', NULL, 398),
(10409, '2005-04-23', '2005-05-05', '2005-04-24', 'Shipped', NULL, 166),
(10410, '2005-04-29', '2005-05-10', '2005-04-30', 'Shipped', NULL, 357),
(10411, '2005-05-01', '2005-05-08', '2005-05-06', 'Shipped', NULL, 233),
(10412, '2005-05-03', '2005-05-13', '2005-05-05', 'Shipped', NULL, 141),
(10413, '2005-05-05', '2005-05-14', '2005-05-09', 'Shipped', 'Customer requested that DHL is used for this shipping', 175),
(10414, '2005-05-06', '2005-05-13', NULL, 'On Hold', 'Customer credit limit exceeded. Will ship when a payment is received.', 362),
(10415, '2005-05-09', '2005-05-20', '2005-05-12', 'Disputed', 'Customer claims the scales of the models dont match what was discussed. I keep all the paperwork though to prove otherwise', 471),
(10416, '2005-05-10', '2005-05-16', '2005-05-14', 'Shipped', NULL, 386),
(10417, '2005-05-13', '2005-05-19', '2005-05-19', 'Disputed', 'Customer doesnt like the colors and precision of the models.', 141),
(10418, '2005-05-16', '2005-05-24', '2005-05-20', 'Shipped', NULL, 412),
(10419, '2005-05-17', '2005-05-28', '2005-05-19', 'Shipped', NULL, 382),
(10420, '2005-05-29', '2005-06-07', NULL, 'In Process', NULL, 282),
(10421, '2005-05-29', '2005-06-06', NULL, 'In Process', 'Custom shipping instructions were sent to warehouse', 124),
(10422, '2005-05-30', '2005-06-11', NULL, 'In Process', NULL, 157),
(10423, '2005-05-30', '2005-06-05', NULL, 'In Process', NULL, 314),
(10424, '2005-05-31', '2005-06-08', NULL, 'In Process', NULL, 141),
(10425, '2005-05-31', '2005-06-07', NULL, 'In Process', NULL, 119) ON CONFLICT ("order_id") DO NOTHING;
/* Data for the table "orderdetail" */
insert into "orderdetail"("order_id", "product_id", "quantity_ordered", "price_each", "order_line_number") values
(10100, 23, 30, '136.00', 3),
(10100, 27, 50, '55.09', 2),
(10100, 50, 22, '75.46', 4),
(10100, 80, 49, '35.29', 1),
(10101, 29, 25, '108.06', 4),
(10101, 33, 26, '167.06', 1),
(10101, 61, 45, '32.53', 3),
(10101, 64, 46, '44.35', 2),
(10102, 19, 39, '95.55', 2),
(10102, 20, 41, '43.13', 1),
(10103, 2, 26, '214.30', 11),
(10103, 6, 42, '119.67', 4),
(10103, 9, 27, '121.64', 8),
(10103, 17, 35, '94.50', 10),
(10103, 30, 22, '58.34', 2),
(10103, 35, 27, '92.19', 12),
(10103, 36, 35, '61.84', 14),
(10103, 38, 25, '86.92', 13),
(10103, 44, 46, '86.31', 16),
(10103, 52, 36, '98.07', 5),
(10103, 53, 41, '40.75', 9),
(10103, 65, 36, '107.34', 1),
(10103, 82, 25, '88.62', 15),
(10103, 85, 31, '92.46', 3),
(10103, 90, 45, '63.35', 7),
(10103, 103, 42, '94.07', 6),
(10104, 11, 34, '131.44', 1),
(10104, 15, 41, '111.39', 9),
(10104, 26, 24, '135.90', 8),
(10104, 28, 29, '122.73', 12),
(10104, 40, 23, '165.95', 13),
(10104, 49, 38, '119.20', 3),
(10104, 57, 35, '52.02', 6),
(10104, 68, 44, '30.41', 10),
(10104, 81, 26, '106.45', 5),
(10104, 88, 35, '51.95', 11),
(10104, 89, 49, '56.55', 4),
(10104, 94, 33, '114.59', 7),
(10104, 95, 32, '53.31', 2),
(10105, 5, 50, '127.84', 2),
(10105, 8, 41, '205.72', 15),
(10105, 13, 29, '141.88', 14),
(10105, 39, 22, '136.59', 11),
(10105, 42, 38, '87.73', 13),
(10105, 51, 41, '75.48', 10),
(10105, 63, 43, '117.97', 9),
(10105, 72, 44, '73.46', 4),
(10105, 77, 50, '75.47', 1),
(10105, 97, 41, '54.00', 5),
(10105, 99, 29, '86.61', 12),
(10105, 102, 31, '60.72', 3),
(10105, 106, 39, '92.16', 6),
(10105, 107, 22, '99.31', 7),
(10105, 110, 25, '44.77', 8),
(10106, 22, 36, '134.04', 12),
(10106, 31, 34, '81.10', 2),
(10106, 37, 41, '80.86', 18),
(10106, 48, 41, '94.22', 17),
(10106, 60, 28, '107.23', 4),
(10106, 69, 49, '65.77', 13),
(10106, 75, 31, '55.89', 14),
(10106, 79, 50, '55.96', 11),
(10106, 83, 26, '71.00', 3),
(10106, 91, 33, '65.35', 5),
(10106, 93, 39, '35.78', 6),
(10106, 98, 31, '91.34', 7),
(10106, 100, 30, '85.09', 16),
(10106, 101, 34, '99.72', 9),
(10106, 104, 32, '113.90', 1),
(10106, 105, 44, '76.00', 8),
(10106, 108, 48, '70.33', 10),
(10106, 109, 48, '43.70', 15),
(10107, 1, 30, '81.35', 2),
(10107, 3, 39, '105.86', 5),
(10107, 4, 27, '172.36', 4),
(10107, 10, 21, '122.00', 1),
(10107, 32, 29, '52.70', 6),
(10107, 58, 25, '96.92', 3),
(10107, 62, 38, '73.12', 7),
(10107, 86, 20, '88.90', 8),
(10108, 7, 33, '165.38', 6),
(10108, 12, 45, '96.30', 4),
(10108, 14, 39, '75.81', 7),
(10108, 16, 36, '107.10', 3),
(10108, 24, 38, '67.76', 2),
(10108, 43, 26, '73.17', 9),
(10108, 45, 29, '132.29', 8),
(10108, 47, 43, '52.84', 12),
(10108, 54, 44, '139.87', 11),
(10108, 66, 35, '64.41', 15),
(10108, 74, 30, '60.01', 5),
(10108, 78, 40, '132.00', 1),
(10108, 84, 31, '67.10', 10),
(10108, 87, 27, '36.21', 13),
(10108, 92, 31, '87.76', 16),
(10108, 96, 34, '74.85', 14),
(10109, 18, 26, '117.48', 4),
(10109, 25, 38, '137.98', 3),
(10109, 34, 26, '126.72', 1),
(10109, 40, 46, '160.87', 5),
(10109, 46, 47, '125.74', 2),
(10109, 71, 29, '32.10', 6),
(10110, 21, 37, '118.22', 16),
(10110, 23, 42, '153.00', 7),
(10110, 27, 32, '51.46', 6),
(10110, 29, 33, '115.69', 4),
(10110, 33, 31, '163.69', 1),
(10110, 50, 28, '81.91', 8),
(10110, 55, 42, '62.00', 9),
(10110, 56, 36, '72.02', 13),
(10110, 59, 29, '43.27', 15),
(10110, 61, 20, '28.88', 3),
(10110, 64, 39, '40.77', 2),
(10110, 67, 43, '82.69', 11),
(10110, 70, 46, '112.74', 10),
(10110, 73, 27, '80.47', 12),
(10110, 76, 37, '96.37', 14),
(10110, 80, 48, '35.29', 5),
(10111, 19, 33, '87.33', 6),
(10111, 20, 48, '48.52', 5),
(10111, 36, 28, '53.09', 2),
(10111, 38, 43, '94.25', 1),
(10111, 44, 39, '91.27', 4),
(10111, 82, 26, '85.70', 3),
(10112, 2, 29, '197.16', 1),
(10112, 35, 23, '85.10', 2),
(10113, 9, 21, '121.64', 2),
(10113, 17, 49, '101.50', 4),
(10113, 53, 50, '43.27', 3),
(10113, 90, 23, '58.82', 1),
(10114, 6, 31, '128.53', 8),
(10114, 28, 39, '106.78', 3),
(10114, 30, 45, '53.48', 6),
(10114, 40, 48, '169.34', 4),
(10114, 52, 41, '105.34', 9),
(10114, 65, 21, '102.23', 5),
(10114, 68, 24, '28.64', 1),
(10114, 85, 32, '88.61', 7),
(10114, 88, 28, '43.83', 2),
(10114, 103, 42, '82.94', 10),
(10115, 15, 46, '111.39', 5),
(10115, 26, 46, '140.81', 4),
(10115, 57, 47, '56.64', 2),
(10115, 81, 44, '106.45', 1),
(10115, 94, 27, '100.70', 3),
(10116, 89, 27, '60.28', 1),
(10117, 8, 33, '195.33', 9),
(10117, 11, 43, '148.06', 10),
(10117, 13, 39, '173.02', 8),
(10117, 39, 26, '121.57', 5),
(10117, 42, 21, '81.68', 7),
(10117, 49, 22, '122.08', 12),
(10117, 51, 23, '73.73', 4),
(10117, 63, 41, '119.20', 3),
(10117, 95, 21, '55.65', 11),
(10117, 99, 38, '75.35', 6),
(10117, 107, 45, '89.38', 1),
(10117, 110, 50, '52.42', 2),
(10118, 106, 36, '86.15', 1),
(10119, 5, 46, '112.88', 11),
(10119, 22, 43, '151.38', 3),
(10119, 37, 21, '74.84', 9),
(10119, 48, 27, '95.28', 8),
(10119, 69, 41, '64.40', 4),
(10119, 72, 35, '72.58', 13),
(10119, 75, 20, '63.12', 5),
(10119, 77, 35, '82.18', 10),
(10119, 79, 28, '62.10', 2),
(10119, 97, 25, '57.34', 14),
(10119, 100, 29, '74.23', 7),
(10119, 102, 38, '67.22', 12),
(10119, 108, 26, '63.67', 1),
(10119, 109, 28, '40.22', 6),
(10120, 3, 29, '118.94', 3),
(10120, 4, 46, '158.80', 2),
(10120, 31, 29, '82.79', 8),
(10120, 32, 46, '57.54', 4),
(10120, 58, 35, '110.45', 1),
(10120, 60, 39, '93.01', 10),
(10120, 62, 34, '72.36', 5),
(10120, 83, 29, '71.73', 9),
(10120, 86, 22, '94.90', 6),
(10120, 91, 29, '68.79', 11),
(10120, 93, 49, '41.46', 12),
(10120, 98, 47, '91.34', 13),
(10120, 101, 24, '81.77', 15),
(10120, 104, 24, '106.79', 7),
(10120, 105, 43, '72.00', 14),
(10121, 1, 34, '86.13', 5),
(10121, 10, 50, '126.52', 4),
(10121, 66, 32, '58.18', 2),
(10121, 92, 25, '95.93', 3),
(10121, 96, 44, '72.41', 1),
(10122, 7, 42, '155.66', 10),
(10122, 12, 37, '113.92', 8),
(10122, 14, 32, '65.44', 11),
(10122, 16, 20, '104.80', 7),
(10122, 18, 34, '114.65', 2),
(10122, 24, 43, '62.37', 6),
(10122, 25, 31, '113.80', 1),
(10122, 40, 25, '137.17', 3),
(10122, 43, 21, '69.15', 13),
(10122, 45, 21, '133.76', 12),
(10122, 47, 35, '59.06', 16),
(10122, 54, 28, '145.82', 15),
(10122, 71, 39, '34.74', 4),
(10122, 74, 34, '50.82', 9),
(10122, 78, 43, '136.22', 5),
(10122, 84, 29, '67.10', 14),
(10122, 87, 31, '33.79', 17),
(10123, 21, 26, '120.71', 2),
(10123, 34, 46, '114.84', 3),
(10123, 46, 34, '117.26', 4),
(10123, 59, 50, '43.27', 1),
(10124, 23, 21, '153.00', 6),
(10124, 27, 42, '58.12', 5),
(10124, 29, 42, '111.87', 3),
(10124, 50, 36, '75.46', 7),
(10124, 55, 23, '66.28', 8),
(10124, 56, 22, '62.47', 12),
(10124, 61, 45, '30.53', 2),
(10124, 64, 22, '36.29', 1),
(10124, 67, 32, '74.51', 10),
(10124, 70, 25, '93.95', 9),
(10124, 73, 49, '76.19', 11),
(10124, 76, 43, '101.73', 13),
(10124, 80, 46, '36.11', 4),
(10125, 19, 32, '89.38', 1),
(10125, 33, 34, '138.38', 2),
(10126, 2, 38, '205.73', 11),
(10126, 6, 22, '122.62', 4),
(10126, 9, 21, '135.30', 8),
(10126, 17, 38, '116.67', 10),
(10126, 20, 42, '51.21', 17),
(10126, 30, 43, '51.05', 2),
(10126, 35, 31, '93.21', 12),
(10126, 36, 46, '61.84', 14),
(10126, 38, 30, '93.20', 13),
(10126, 44, 38, '94.25', 16),
(10126, 52, 50, '102.92', 5),
(10126, 53, 43, '47.29', 9),
(10126, 65, 27, '122.68', 1),
(10126, 82, 34, '83.76', 15),
(10126, 85, 43, '82.83', 3),
(10126, 90, 26, '62.05', 7),
(10126, 103, 45, '97.10', 6),
(10127, 8, 46, '193.25', 2),
(10127, 11, 46, '140.50', 3),
(10127, 13, 42, '169.56', 1),
(10127, 15, 24, '100.73', 11),
(10127, 26, 45, '140.81', 10),
(10127, 28, 45, '114.14', 14),
(10127, 40, 22, '149.02', 15),
(10127, 49, 25, '126.39', 5),
(10127, 57, 20, '50.86', 8),
(10127, 68, 39, '34.30', 12),
(10127, 81, 20, '107.63', 7),
(10127, 88, 45, '46.53', 13),
(10127, 89, 29, '60.90', 6),
(10127, 94, 46, '111.12', 9),
(10127, 95, 46, '55.65', 4),
(10128, 39, 41, '120.20', 2),
(10128, 42, 41, '80.67', 4),
(10128, 51, 43, '77.24', 1),
(10128, 99, 32, '72.75', 3),
(10129, 5, 33, '123.76', 2),
(10129, 63, 45, '113.06', 9),
(10129, 72, 41, '81.43', 4),
(10129, 77, 50, '76.31', 1),
(10129, 97, 31, '58.67', 5),
(10129, 102, 45, '72.28', 3),
(10129, 106, 42, '90.15', 6),
(10129, 107, 30, '94.34', 7),
(10129, 110, 32, '44.23', 8),
(10130, 37, 40, '68.82', 2),
(10130, 48, 33, '99.52', 1),
(10131, 22, 21, '141.92', 4),
(10131, 69, 35, '60.97', 5),
(10131, 75, 29, '52.60', 6),
(10131, 79, 50, '54.59', 3),
(10131, 100, 22, '76.94', 8),
(10131, 101, 40, '86.76', 1),
(10131, 108, 26, '63.67', 2),
(10131, 109, 21, '40.22', 7),
(10132, 105, 36, '80.00', 1),
(10133, 31, 49, '80.26', 3),
(10133, 60, 41, '109.42', 5),
(10133, 83, 46, '61.58', 4),
(10133, 86, 23, '80.91', 1),
(10133, 91, 49, '67.41', 6),
(10133, 93, 27, '37.09', 7),
(10133, 98, 24, '76.73', 8),
(10133, 104, 27, '115.09', 2),
(10134, 1, 41, '90.92', 2),
(10134, 3, 27, '116.56', 5),
(10134, 4, 31, '187.85', 4),
(10134, 10, 20, '131.04', 1),
(10134, 32, 30, '51.48', 6),
(10134, 58, 35, '94.67', 3),
(10134, 62, 43, '75.41', 7),
(10135, 7, 42, '173.17', 7),
(10135, 12, 48, '110.39', 5),
(10135, 14, 24, '72.62', 8),
(10135, 16, 29, '103.64', 4),
(10135, 24, 48, '66.99', 3),
(10135, 43, 45, '65.94', 10),
(10135, 45, 42, '139.64', 9),
(10135, 47, 45, '49.74', 13),
(10135, 54, 31, '133.92', 12),
(10135, 66, 29, '67.18', 16),
(10135, 71, 20, '34.36', 1),
(10135, 74, 27, '52.05', 6),
(10135, 78, 47, '139.03', 2),
(10135, 84, 23, '76.80', 11),
(10135, 87, 33, '38.62', 14),
(10135, 92, 30, '91.85', 17),
(10135, 96, 44, '78.92', 15),
(10136, 18, 25, '117.48', 2),
(10136, 25, 36, '120.91', 1),
(10136, 40, 41, '169.34', 3),
(10137, 21, 44, '115.73', 2),
(10137, 34, 37, '110.88', 3),
(10137, 46, 31, '118.68', 4),
(10137, 59, 26, '40.25', 1),
(10138, 23, 33, '149.60', 6),
(10138, 27, 22, '51.46', 5),
(10138, 29, 38, '114.42', 3),
(10138, 50, 47, '79.15', 7),
(10138, 55, 23, '64.86', 8),
(10138, 56, 45, '59.53', 12),
(10138, 61, 22, '33.19', 2),
(10138, 64, 33, '38.53', 1),
(10138, 67, 28, '73.60', 10),
(10138, 70, 30, '96.30', 9),
(10138, 73, 49, '77.05', 11),
(10138, 76, 21, '99.58', 13),
(10138, 80, 29, '32.82', 4),
(10139, 19, 31, '89.38', 7),
(10139, 20, 49, '52.83', 6),
(10139, 33, 41, '151.88', 8),
(10139, 35, 46, '91.18', 1),
(10139, 36, 20, '52.47', 3),
(10139, 38, 20, '101.58', 2),
(10139, 44, 30, '81.35', 5),
(10139, 82, 29, '93.49', 4),
(10140, 2, 37, '186.44', 11),
(10140, 6, 26, '131.49', 4),
(10140, 9, 38, '118.90', 8),
(10140, 17, 32, '95.67', 10),
(10140, 30, 46, '51.05', 2),
(10140, 52, 40, '100.50', 5),
(10140, 53, 29, '40.25', 9),
(10140, 65, 47, '118.84', 1),
(10140, 85, 26, '87.64', 3),
(10140, 90, 28, '62.05', 7),
(10140, 103, 36, '101.15', 6),
(10141, 15, 21, '114.95', 5),
(10141, 26, 39, '160.46', 4),
(10141, 28, 47, '103.09', 8),
(10141, 40, 34, '143.94', 9),
(10141, 57, 20, '50.86', 2),
(10141, 68, 21, '32.18', 6),
(10141, 81, 40, '104.09', 1),
(10141, 88, 24, '53.03', 7),
(10141, 94, 44, '94.92', 3),
(10142, 8, 33, '166.24', 12),
(10142, 11, 33, '140.50', 13),
(10142, 13, 46, '167.83', 11),
(10142, 39, 47, '129.76', 8),
(10142, 42, 22, '95.80', 10),
(10142, 49, 24, '122.08', 15),
(10142, 51, 24, '79.87', 7),
(10142, 63, 33, '114.29', 6),
(10142, 72, 49, '74.35', 1),
(10142, 89, 42, '60.90', 16),
(10142, 95, 42, '56.24', 14),
(10142, 97, 41, '55.34', 2),
(10142, 99, 43, '77.08', 9),
(10142, 106, 21, '92.16', 3),
(10142, 107, 38, '91.37', 4),
(10142, 110, 39, '46.96', 5),
(10143, 5, 49, '133.28', 15),
(10143, 22, 32, '126.15', 7),
(10143, 37, 46, '70.54', 13),
(10143, 48, 34, '99.52', 12),
(10143, 69, 27, '63.71', 8),
(10143, 75, 33, '59.83', 9),
(10143, 77, 23, '74.64', 14),
(10143, 79, 28, '55.96', 6),
(10143, 93, 34, '34.91', 1),
(10143, 98, 36, '86.77', 2),
(10143, 100, 26, '87.80', 11),
(10143, 101, 26, '79.78', 4),
(10143, 102, 31, '69.39', 16),
(10143, 105, 28, '70.40', 3),
(10143, 108, 34, '65.15', 5),
(10143, 109, 37, '49.66', 10),
(10144, 91, 20, '56.41', 1),
(10145, 1, 45, '76.56', 6),
(10145, 3, 37, '104.67', 9),
(10145, 4, 33, '154.93', 8),
(10145, 10, 49, '146.10', 5),
(10145, 31, 30, '71.81', 14),
(10145, 32, 30, '52.70', 10),
(10145, 58, 43, '103.68', 7),
(10145, 60, 40, '87.54', 16),
(10145, 62, 47, '63.98', 11),
(10145, 66, 27, '56.10', 3),
(10145, 83, 33, '71.73', 15),
(10145, 86, 33, '99.89', 12),
(10145, 87, 31, '39.43', 1),
(10145, 92, 27, '95.93', 4),
(10145, 96, 38, '73.22', 2),
(10145, 104, 20, '113.90', 13),
(10146, 47, 47, '60.30', 2),
(10146, 54, 29, '130.94', 1),
(10147, 7, 48, '161.49', 7),
(10147, 12, 31, '110.39', 5),
(10147, 14, 21, '74.21', 8),
(10147, 16, 33, '97.89', 4),
(10147, 24, 26, '70.84', 3),
(10147, 43, 36, '74.78', 10),
(10147, 45, 37, '129.35', 9),
(10147, 71, 25, '33.23', 1),
(10147, 74, 30, '48.98', 6),
(10147, 78, 23, '123.58', 2),
(10147, 84, 31, '72.76', 11),
(10148, 18, 23, '114.65', 13),
(10148, 21, 47, '108.26', 9),
(10148, 25, 25, '136.56', 12),
(10148, 34, 27, '113.52', 10),
(10148, 40, 32, '143.94', 14),
(10148, 46, 28, '135.63', 11),
(10148, 50, 34, '83.75', 1),
(10148, 55, 29, '66.28', 2),
(10148, 56, 25, '65.41', 6),
(10148, 59, 47, '46.29', 8),
(10148, 67, 21, '77.24', 4),
(10148, 70, 34, '115.09', 3),
(10148, 73, 31, '71.91', 5),
(10148, 76, 27, '96.37', 7),
(10149, 19, 50, '87.33', 4),
(10149, 20, 30, '48.52', 3),
(10149, 23, 34, '156.40', 11),
(10149, 27, 24, '50.85', 10),
(10149, 29, 33, '125.86', 8),
(10149, 33, 23, '167.06', 5),
(10149, 44, 42, '89.29', 2),
(10149, 61, 36, '31.20', 7),
(10149, 64, 49, '39.87', 6),
(10149, 80, 26, '38.57', 9),
(10149, 82, 20, '90.57', 1),
(10150, 2, 45, '182.16', 8),
(10150, 6, 20, '121.15', 1),
(10150, 9, 30, '135.30', 5),
(10150, 17, 34, '95.67', 7),
(10150, 35, 47, '93.21', 9),
(10150, 36, 30, '56.21', 11),
(10150, 38, 26, '97.39', 10),
(10150, 52, 49, '111.39', 2),
(10150, 53, 30, '47.29', 6),
(10150, 90, 49, '62.05', 4),
(10150, 103, 20, '95.08', 3),
(10151, 15, 24, '114.95', 3),
(10151, 26, 43, '152.27', 2),
(10151, 28, 49, '106.78', 6),
(10151, 30, 39, '58.34', 9),
(10151, 40, 21, '167.65', 7),
(10151, 65, 42, '109.90', 8),
(10151, 68, 30, '29.35', 4),
(10151, 85, 27, '84.75', 10),
(10151, 88, 41, '43.29', 5),
(10151, 94, 26, '108.81', 1),
(10152, 49, 35, '117.77', 1),
(10152, 57, 25, '49.13', 4),
(10152, 81, 23, '112.37', 3),
(10152, 89, 33, '57.17', 2),
(10153, 8, 20, '201.57', 11),
(10153, 11, 42, '128.42', 12),
(10153, 13, 49, '155.72', 10),
(10153, 39, 31, '125.66', 7),
(10153, 42, 29, '82.69', 9),
(10153, 51, 22, '82.50', 6),
(10153, 63, 40, '111.83', 5),
(10153, 95, 31, '53.31', 13),
(10153, 97, 43, '58.00', 1),
(10153, 99, 31, '80.55', 8),
(10153, 106, 50, '87.15', 2),
(10153, 107, 20, '85.41', 3),
(10153, 110, 50, '51.87', 4),
(10154, 72, 31, '75.23', 2),
(10154, 102, 36, '59.27', 1),
(10155, 5, 32, '129.20', 13),
(10155, 22, 38, '138.77', 5),
(10155, 37, 44, '83.44', 11),
(10155, 48, 29, '105.87', 10),
(10155, 69, 23, '62.34', 6),
(10155, 75, 34, '56.55', 7),
(10155, 77, 37, '76.31', 12),
(10155, 79, 44, '58.69', 4),
(10155, 100, 32, '89.61', 9),
(10155, 101, 20, '87.75', 2),
(10155, 105, 43, '76.80', 1),
(10155, 108, 44, '70.33', 3),
(10155, 109, 34, '49.16', 8),
(10156, 93, 20, '43.64', 1),
(10156, 98, 48, '77.64', 2),
(10157, 31, 33, '69.27', 3),
(10157, 60, 40, '89.72', 5),
(10157, 83, 33, '66.65', 4),
(10157, 86, 34, '83.91', 1),
(10157, 91, 28, '56.41', 6),
(10157, 104, 48, '109.16', 2),
(10158, 62, 22, '67.79', 1),
(10159, 1, 49, '81.35', 14),
(10159, 3, 37, '101.10', 17),
(10159, 4, 22, '170.42', 16),
(10159, 7, 41, '188.73', 2),
(10159, 10, 38, '131.04', 13),
(10159, 14, 24, '67.03', 3),
(10159, 32, 42, '51.48', 18),
(10159, 43, 21, '66.74', 5),
(10159, 45, 25, '129.35', 4),
(10159, 47, 21, '54.71', 8),
(10159, 54, 32, '142.85', 7),
(10159, 58, 44, '100.30', 15),
(10159, 66, 27, '67.18', 11),
(10159, 74, 50, '49.60', 1),
(10159, 84, 23, '80.84', 6),
(10159, 87, 35, '39.43', 9),
(10159, 92, 23, '86.74', 12),
(10159, 96, 31, '78.11', 10),
(10160, 12, 46, '96.30', 6),
(10160, 16, 50, '93.28', 5),
(10160, 24, 38, '70.84', 4),
(10160, 40, 20, '140.55', 1),
(10160, 71, 42, '30.59', 2),
(10160, 78, 35, '130.60', 3),
(10161, 18, 28, '121.72', 12),
(10161, 21, 43, '102.04', 8),
(10161, 25, 48, '139.41', 11),
(10161, 34, 23, '125.40', 9),
(10161, 46, 36, '132.80', 10),
(10161, 55, 25, '62.72', 1),
(10161, 56, 37, '73.49', 5),
(10161, 59, 23, '47.29', 7),
(10161, 67, 20, '82.69', 3),
(10161, 70, 25, '108.04', 2),
(10161, 73, 20, '72.77', 4),
(10161, 76, 30, '94.23', 6),
(10162, 19, 48, '87.33', 2),
(10162, 20, 45, '45.28', 1),
(10162, 23, 29, '141.10', 9),
(10162, 27, 27, '53.28', 8),
(10162, 29, 38, '113.15', 6),
(10162, 33, 48, '156.94', 3),
(10162, 50, 39, '86.51', 10),
(10162, 61, 37, '27.55', 5),
(10162, 64, 43, '38.98', 4),
(10162, 80, 37, '32.82', 7),
(10163, 2, 21, '212.16', 1),
(10163, 35, 31, '101.31', 2),
(10163, 36, 48, '59.96', 4),
(10163, 38, 40, '101.58', 3),
(10163, 44, 43, '80.36', 6),
(10163, 82, 42, '96.42', 5),
(10164, 6, 21, '143.31', 2),
(10164, 9, 49, '121.64', 6),
(10164, 17, 36, '103.84', 8),
(10164, 52, 45, '107.76', 3),
(10164, 53, 25, '46.29', 7),
(10164, 85, 24, '91.49', 1),
(10164, 90, 49, '57.53', 5),
(10164, 103, 39, '86.99', 4),
(10165, 8, 44, '168.32', 3),
(10165, 11, 34, '123.89', 4),
(10165, 13, 27, '152.26', 2),
(10165, 15, 48, '109.02', 12),
(10165, 26, 29, '134.26', 11),
(10165, 28, 46, '120.28', 15),
(10165, 30, 31, '60.77', 18),
(10165, 40, 47, '154.10', 16),
(10165, 42, 50, '84.71', 1),
(10165, 49, 28, '123.51', 6),
(10165, 57, 25, '46.82', 9),
(10165, 65, 32, '117.57', 17),
(10165, 68, 27, '31.12', 13),
(10165, 81, 24, '106.45', 8),
(10165, 88, 48, '50.86', 14),
(10165, 89, 44, '55.30', 7),
(10165, 94, 48, '106.49', 10),
(10165, 95, 38, '49.21', 5),
(10166, 39, 43, '136.59', 2),
(10166, 51, 26, '72.85', 1),
(10166, 99, 29, '76.22', 3),
(10167, 5, 44, '123.76', 9),
(10167, 22, 43, '141.92', 1),
(10167, 37, 46, '69.68', 7),
(10167, 48, 34, '84.70', 6),
(10167, 63, 33, '110.60', 16),
(10167, 69, 21, '54.81', 2),
(10167, 72, 20, '77.00', 11),
(10167, 75, 32, '64.44', 3),
(10167, 77, 29, '73.80', 8),
(10167, 97, 43, '66.00', 12),
(10167, 100, 29, '87.80', 5),
(10167, 102, 46, '62.16', 10),
(10167, 106, 24, '85.14', 13),
(10167, 107, 28, '83.42', 14),
(10167, 109, 40, '42.71', 4),
(10167, 110, 38, '43.68', 15),
(10168, 1, 36, '94.74', 1),
(10168, 3, 27, '97.53', 4),
(10168, 4, 20, '160.74', 3),
(10168, 31, 21, '75.19', 9),
(10168, 32, 46, '49.06', 5),
(10168, 58, 50, '103.68', 2),
(10168, 60, 49, '93.01', 11),
(10168, 62, 29, '72.36', 6),
(10168, 79, 27, '57.32', 18),
(10168, 83, 48, '68.10', 10),
(10168, 86, 28, '89.90', 7),
(10168, 91, 31, '57.78', 12),
(10168, 93, 48, '39.71', 13),
(10168, 98, 28, '91.34', 14),
(10168, 101, 31, '87.75', 16),
(10168, 104, 36, '94.92', 8),
(10168, 105, 48, '72.00', 15),
(10168, 108, 39, '67.37', 17),
(10169, 7, 30, '163.44', 2),
(10169, 10, 35, '126.52', 13),
(10169, 14, 36, '71.82', 3),
(10169, 43, 32, '65.13', 5),
(10169, 45, 36, '136.70', 4),
(10169, 47, 38, '52.84', 8),
(10169, 54, 33, '120.53', 7),
(10169, 66, 38, '66.49', 11),
(10169, 74, 34, '53.27', 1),
(10169, 84, 24, '77.61', 6),
(10169, 87, 26, '37.01', 9),
(10169, 92, 34, '83.68', 12),
(10169, 96, 48, '75.66', 10),
(10170, 12, 47, '116.27', 4),
(10170, 16, 41, '93.28', 3),
(10170, 24, 20, '70.07', 2),
(10170, 78, 34, '130.60', 1),
(10171, 18, 35, '134.46', 2),
(10171, 25, 35, '128.03', 1),
(10171, 40, 39, '165.95', 3),
(10171, 71, 36, '34.74', 4),
(10172, 21, 42, '109.51', 6),
(10172, 34, 39, '117.48', 7),
(10172, 46, 48, '139.87', 8),
(10172, 56, 32, '61.00', 3),
(10172, 59, 34, '43.27', 5),
(10172, 67, 22, '79.97', 1),
(10172, 73, 24, '77.91', 2),
(10172, 76, 22, '87.81', 4),
(10173, 19, 43, '101.71', 6),
(10173, 20, 48, '51.75', 5),
(10173, 23, 24, '168.30', 13),
(10173, 27, 26, '55.09', 12),
(10173, 29, 31, '127.13', 10),
(10173, 33, 22, '140.06', 7),
(10173, 36, 28, '56.84', 2),
(10173, 38, 31, '86.92', 1),
(10173, 44, 29, '90.28', 4),
(10173, 50, 21, '77.31', 14),
(10173, 55, 39, '58.44', 15),
(10173, 61, 31, '29.87', 9),
(10173, 64, 27, '39.42', 8),
(10173, 70, 23, '98.65', 16),
(10173, 80, 35, '35.70', 11),
(10173, 82, 22, '93.49', 3),
(10174, 2, 34, '207.87', 4),
(10174, 9, 43, '113.44', 1),
(10174, 17, 48, '108.50', 3),
(10174, 35, 46, '100.30', 5),
(10174, 53, 49, '44.27', 2),
(10175, 6, 33, '119.67', 9),
(10175, 15, 26, '109.02', 1),
(10175, 28, 48, '101.87', 4),
(10175, 30, 41, '59.55', 7),
(10175, 40, 29, '150.71', 5),
(10175, 52, 47, '102.92', 10),
(10175, 65, 28, '121.40', 6),
(10175, 68, 37, '32.18', 2),
(10175, 85, 22, '89.57', 8),
(10175, 88, 50, '50.86', 3),
(10175, 90, 29, '56.24', 12),
(10175, 103, 42, '80.92', 11),
(10176, 8, 33, '166.24', 2),
(10176, 11, 47, '145.04', 3),
(10176, 13, 50, '160.91', 1),
(10176, 26, 20, '139.17', 10),
(10176, 49, 36, '140.75', 5),
(10176, 57, 27, '55.49', 8),
(10176, 81, 29, '101.72', 7),
(10176, 89, 22, '62.14', 6),
(10176, 94, 23, '109.96', 9),
(10176, 95, 38, '52.14', 4),
(10177, 39, 23, '113.37', 9),
(10177, 42, 29, '92.77', 11),
(10177, 51, 35, '82.50', 8),
(10177, 63, 50, '115.52', 7),
(10177, 72, 45, '79.66', 2),
(10177, 97, 24, '58.67', 3),
(10177, 99, 31, '77.95', 10),
(10177, 102, 32, '64.33', 1),
(10177, 106, 44, '88.15', 4),
(10177, 107, 24, '83.42', 5),
(10177, 110, 40, '52.96', 6),
(10178, 5, 24, '131.92', 12),
(10178, 22, 42, '127.73', 4),
(10178, 37, 41, '70.54', 10),
(10178, 48, 48, '104.81', 9),
(10178, 69, 34, '67.82', 5),
(10178, 75, 27, '65.75', 6),
(10178, 77, 21, '68.77', 11),
(10178, 79, 30, '64.15', 3),
(10178, 100, 34, '86.90', 8),
(10178, 101, 22, '91.74', 1),
(10178, 108, 45, '68.11', 2),
(10178, 109, 45, '41.71', 7),
(10179, 31, 24, '82.79', 3),
(10179, 60, 47, '105.04', 5),
(10179, 83, 27, '66.65', 4),
(10179, 86, 45, '86.90', 1),
(10179, 91, 24, '63.97', 6),
(10179, 93, 34, '43.20', 7),
(10179, 98, 23, '75.81', 8),
(10179, 104, 25, '98.48', 2),
(10179, 105, 39, '80.00', 9),
(10180, 1, 29, '76.56', 9),
(10180, 3, 42, '99.91', 12),
(10180, 4, 41, '164.61', 11),
(10180, 10, 40, '131.04', 8),
(10180, 32, 25, '48.46', 13),
(10180, 47, 21, '59.06', 3),
(10180, 54, 44, '147.31', 2),
(10180, 58, 48, '98.05', 10),
(10180, 62, 28, '61.70', 14),
(10180, 66, 35, '60.95', 6),
(10180, 84, 28, '68.71', 1),
(10180, 87, 34, '33.39', 4),
(10180, 92, 22, '102.05', 7),
(10180, 96, 21, '74.85', 5),
(10181, 7, 27, '155.66', 14),
(10181, 12, 28, '113.92', 12),
(10181, 14, 20, '67.03', 15),
(10181, 16, 36, '107.10', 11),
(10181, 18, 44, '124.56', 6),
(10181, 21, 42, '124.44', 2),
(10181, 24, 22, '74.69', 10),
(10181, 25, 21, '129.45', 5),
(10181, 34, 27, '130.68', 3),
(10181, 40, 45, '147.33', 7),
(10181, 43, 30, '73.17', 17),
(10181, 45, 22, '120.53', 16),
(10181, 46, 39, '137.04', 4),
(10181, 59, 34, '45.28', 1),
(10181, 71, 37, '32.85', 8),
(10181, 74, 23, '54.49', 13),
(10181, 78, 25, '122.17', 9),
(10182, 19, 25, '83.22', 3),
(10182, 20, 32, '44.21', 2),
(10182, 23, 44, '159.80', 10),
(10182, 27, 38, '54.49', 9),
(10182, 29, 20, '105.52', 7),
(10182, 33, 21, '135.00', 4),
(10182, 44, 33, '86.31', 1),
(10182, 50, 36, '88.35', 11),
(10182, 55, 44, '61.29', 12),
(10182, 56, 47, '63.20', 16),
(10182, 61, 39, '31.86', 6),
(10182, 64, 31, '39.87', 5),
(10182, 67, 36, '87.24', 14),
(10182, 70, 20, '116.27', 13),
(10182, 73, 33, '73.62', 15),
(10182, 76, 49, '95.30', 17),
(10182, 80, 23, '34.88', 8),
(10183, 2, 23, '180.01', 8),
(10183, 6, 28, '127.06', 1),
(10183, 9, 41, '114.80', 5),
(10183, 17, 21, '108.50', 7),
(10183, 35, 37, '91.18', 9),
(10183, 36, 39, '51.22', 11),
(10183, 38, 22, '90.06', 10),
(10183, 52, 21, '118.66', 2),
(10183, 53, 40, '42.26', 6),
(10183, 82, 47, '81.81', 12),
(10183, 90, 49, '52.36', 4),
(10183, 103, 23, '85.98', 3),
(10184, 15, 37, '105.47', 6),
(10184, 26, 46, '145.72', 5),
(10184, 28, 46, '119.05', 9),
(10184, 30, 44, '60.77', 12),
(10184, 40, 28, '165.95', 10),
(10184, 57, 31, '57.22', 3),
(10184, 65, 24, '117.57', 11),
(10184, 68, 42, '30.06', 7),
(10184, 81, 49, '114.73', 2),
(10184, 85, 46, '84.75', 13),
(10184, 88, 33, '52.49', 8),
(10184, 89, 48, '59.03', 1),
(10184, 94, 45, '92.60', 4),
(10185, 8, 21, '195.33', 13),
(10185, 11, 33, '146.55', 14),
(10185, 13, 43, '147.07', 12),
(10185, 39, 28, '124.30', 9),
(10185, 42, 49, '94.79', 11),
(10185, 49, 39, '127.82', 16),
(10185, 51, 47, '87.77', 8),
(10185, 63, 30, '105.69', 7),
(10185, 72, 33, '83.20', 2),
(10185, 95, 20, '46.86', 15),
(10185, 97, 21, '64.67', 3),
(10185, 99, 30, '79.68', 10),
(10185, 102, 39, '61.44', 1),
(10185, 106, 37, '99.17', 4),
(10185, 107, 22, '93.35', 5),
(10185, 110, 28, '47.50', 6),
(10186, 5, 26, '108.80', 9),
(10186, 22, 32, '137.19', 1),
(10186, 37, 32, '73.12', 7),
(10186, 48, 46, '98.46', 6),
(10186, 69, 22, '60.29', 2),
(10186, 75, 21, '59.83', 3),
(10186, 77, 36, '68.77', 8),
(10186, 100, 24, '80.56', 5),
(10186, 109, 28, '42.71', 4),
(10187, 31, 45, '70.12', 1),
(10187, 60, 46, '96.29', 3),
(10187, 79, 43, '55.96', 10),
(10187, 83, 33, '64.48', 2),
(10187, 91, 31, '61.22', 4),
(10187, 93, 41, '39.71', 5),
(10187, 98, 34, '84.95', 6),
(10187, 101, 44, '95.73', 8),
(10187, 105, 34, '72.00', 7),
(10187, 108, 44, '70.33', 9),
(10188, 1, 48, '95.70', 1),
(10188, 3, 38, '111.80', 4),
(10188, 4, 45, '182.04', 3),
(10188, 32, 32, '52.09', 5),
(10188, 58, 25, '95.80', 2),
(10188, 62, 40, '61.70', 6),
(10188, 86, 44, '81.91', 7),
(10188, 104, 29, '96.11', 8),
(10189, 10, 28, '138.57', 1),
(10190, 66, 42, '58.87', 3),
(10190, 87, 46, '38.62', 1),
(10190, 92, 42, '89.80', 4),
(10190, 96, 40, '67.53', 2),
(10191, 7, 21, '155.66', 3),
(10191, 12, 40, '104.52', 1),
(10191, 14, 30, '70.22', 4),
(10191, 43, 36, '75.59', 6),
(10191, 45, 23, '119.06', 5),
(10191, 47, 43, '60.93', 9),
(10191, 54, 32, '136.90', 8),
(10191, 74, 48, '53.27', 2),
(10191, 84, 44, '77.61', 7),
(10192, 16, 27, '99.04', 16),
(10192, 18, 22, '140.12', 11),
(10192, 21, 29, '100.80', 7),
(10192, 24, 45, '70.84', 15),
(10192, 25, 47, '128.03', 10),
(10192, 34, 38, '110.88', 8),
(10192, 40, 26, '137.17', 12),
(10192, 46, 45, '125.74', 9),
(10192, 56, 37, '72.02', 4),
(10192, 59, 47, '49.30', 6),
(10192, 67, 46, '86.33', 2),
(10192, 70, 23, '112.74', 1),
(10192, 71, 30, '33.23', 13),
(10192, 73, 32, '69.34', 3),
(10192, 76, 46, '93.16', 5),
(10192, 78, 45, '112.34', 14),
(10193, 19, 28, '92.47', 7),
(10193, 20, 46, '46.36', 6),
(10193, 23, 21, '153.00', 14),
(10193, 27, 42, '60.54', 13),
(10193, 29, 44, '115.69', 11),
(10193, 33, 22, '143.44', 8),
(10193, 35, 28, '87.13', 1),
(10193, 36, 24, '53.09', 3),
(10193, 38, 23, '97.39', 2),
(10193, 44, 32, '79.37', 5),
(10193, 50, 24, '92.03', 15),
(10193, 55, 25, '66.28', 16),
(10193, 61, 26, '32.19', 10),
(10193, 64, 20, '44.80', 9),
(10193, 80, 22, '38.16', 12),
(10193, 82, 20, '92.52', 4),
(10194, 2, 42, '203.59', 11),
(10194, 6, 26, '134.44', 4),
(10194, 9, 38, '124.37', 8),
(10194, 17, 21, '103.84', 10),
(10194, 30, 45, '51.05', 2),
(10194, 52, 32, '113.82', 5),
(10194, 53, 41, '47.79', 9),
(10194, 65, 49, '112.46', 1),
(10194, 85, 37, '77.05', 3),
(10194, 90, 39, '61.41', 7),
(10194, 103, 26, '80.92', 6),
(10195, 15, 49, '118.50', 6),
(10195, 26, 27, '139.17', 5),
(10195, 28, 35, '112.91', 9),
(10195, 40, 50, '150.71', 10),
(10195, 57, 44, '54.33', 3),
(10195, 68, 32, '31.82', 7),
(10195, 81, 34, '95.81', 2),
(10195, 88, 32, '51.95', 8),
(10195, 89, 33, '59.03', 1),
(10195, 94, 49, '97.23', 4),
(10196, 8, 47, '203.64', 5),
(10196, 11, 24, '151.08', 6),
(10196, 13, 38, '147.07', 4),
(10196, 39, 49, '127.03', 1),
(10196, 42, 35, '81.68', 3),
(10196, 49, 27, '126.39', 8),
(10196, 95, 46, '56.82', 7),
(10196, 99, 50, '84.88', 2),
(10197, 5, 45, '118.32', 6),
(10197, 37, 46, '83.44', 4),
(10197, 48, 22, '85.75', 3),
(10197, 51, 50, '78.99', 14),
(10197, 63, 41, '109.37', 13),
(10197, 72, 47, '83.20', 8),
(10197, 77, 22, '67.93', 5),
(10197, 97, 23, '60.00', 9),
(10197, 100, 24, '78.75', 2),
(10197, 102, 50, '66.50', 7),
(10197, 106, 27, '100.17', 10),
(10197, 107, 35, '88.39', 11),
(10197, 109, 29, '39.73', 1),
(10197, 110, 42, '48.59', 12),
(10198, 22, 42, '149.81', 4),
(10198, 69, 48, '60.97', 5),
(10198, 75, 27, '61.81', 6),
(10198, 79, 43, '65.51', 3),
(10198, 101, 42, '94.73', 1),
(10198, 108, 40, '74.03', 2),
(10199, 93, 29, '37.97', 1),
(10199, 98, 48, '81.29', 2),
(10199, 105, 38, '70.40', 3),
(10200, 31, 28, '74.34', 3),
(10200, 60, 33, '99.57', 5),
(10200, 83, 39, '70.28', 4),
(10200, 86, 35, '80.91', 1),
(10200, 91, 27, '65.35', 6),
(10200, 104, 39, '115.09', 2),
(10201, 1, 22, '82.30', 2),
(10201, 3, 24, '116.56', 5),
(10201, 4, 49, '191.72', 4),
(10201, 10, 25, '126.52', 1),
(10201, 32, 30, '48.46', 6),
(10201, 58, 39, '93.54', 3),
(10201, 62, 25, '66.27', 7),
(10202, 47, 30, '55.33', 3),
(10202, 54, 43, '124.99', 2),
(10202, 66, 50, '56.10', 6),
(10202, 84, 50, '75.18', 1),
(10202, 87, 27, '33.39', 4),
(10202, 92, 31, '81.64', 7),
(10202, 96, 40, '79.73', 5),
(10203, 7, 20, '161.49', 8),
(10203, 12, 20, '111.57', 6),
(10203, 14, 44, '63.84', 9),
(10203, 16, 47, '115.16', 5),
(10203, 24, 45, '73.15', 4),
(10203, 40, 48, '157.49', 1),
(10203, 43, 33, '66.74', 11),
(10203, 45, 32, '127.88', 10),
(10203, 71, 21, '33.23', 2),
(10203, 74, 34, '56.94', 7),
(10203, 78, 47, '140.43', 3),
(10204, 18, 42, '114.65', 17),
(10204, 21, 40, '113.24', 13),
(10204, 23, 33, '153.00', 4),
(10204, 25, 38, '133.72', 16),
(10204, 27, 23, '59.33', 3),
(10204, 29, 26, '119.50', 1),
(10204, 34, 27, '106.92', 14),
(10204, 46, 35, '132.80', 15),
(10204, 50, 29, '83.75', 5),
(10204, 55, 45, '69.84', 6),
(10204, 56, 20, '69.82', 10),
(10204, 59, 45, '46.79', 12),
(10204, 67, 47, '79.06', 8),
(10204, 70, 42, '112.74', 7),
(10204, 73, 40, '84.75', 9),
(10204, 76, 48, '104.94', 11),
(10204, 80, 39, '34.88', 2),
(10205, 19, 36, '98.63', 2),
(10205, 20, 48, '45.82', 1),
(10205, 33, 40, '138.38', 3),
(10205, 61, 32, '27.88', 5),
(10205, 64, 24, '36.74', 4),
(10206, 2, 47, '203.59', 6),
(10206, 9, 28, '109.34', 3),
(10206, 17, 34, '115.50', 5),
(10206, 35, 37, '98.27', 7),
(10206, 36, 28, '51.84', 9),
(10206, 38, 30, '102.63', 8),
(10206, 44, 28, '99.21', 11),
(10206, 53, 21, '45.78', 4),
(10206, 82, 33, '95.44', 10),
(10206, 90, 36, '54.94', 2),
(10206, 103, 33, '89.01', 1),
(10207, 6, 31, '125.58', 15),
(10207, 15, 34, '95.99', 7),
(10207, 26, 44, '140.81', 6),
(10207, 28, 43, '109.23', 10),
(10207, 30, 37, '60.77', 13),
(10207, 40, 25, '140.55', 11),
(10207, 49, 40, '143.62', 1),
(10207, 52, 47, '119.87', 16),
(10207, 57, 49, '57.80', 4),
(10207, 65, 46, '127.79', 12),
(10207, 68, 42, '30.76', 8),
(10207, 81, 28, '108.82', 3),
(10207, 85, 49, '84.75', 14),
(10207, 88, 27, '51.95', 9),
(10207, 89, 45, '55.30', 2),
(10207, 94, 28, '106.49', 5),
(10208, 8, 46, '176.63', 13),
(10208, 11, 26, '128.42', 14),
(10208, 13, 20, '152.26', 12),
(10208, 39, 24, '117.47', 9),
(10208, 42, 48, '96.81', 11),
(10208, 51, 45, '72.85', 8),
(10208, 63, 35, '122.89', 7),
(10208, 72, 20, '80.54', 2),
(10208, 95, 30, '57.99', 15),
(10208, 97, 38, '56.67', 3),
(10208, 99, 40, '73.62', 10),
(10208, 102, 46, '63.61', 1),
(10208, 106, 37, '95.16', 4),
(10208, 107, 33, '95.34', 5),
(10208, 110, 42, '48.05', 6),
(10209, 5, 39, '129.20', 8),
(10209, 37, 28, '82.58', 6),
(10209, 48, 20, '97.40', 5),
(10209, 69, 43, '66.45', 1),
(10209, 75, 36, '56.55', 2),
(10209, 77, 22, '79.67', 7),
(10209, 100, 33, '90.52', 4),
(10209, 109, 48, '44.20', 3),
(10210, 3, 23, '112.99', 2),
(10210, 4, 34, '189.79', 1),
(10210, 22, 31, '141.92', 17),
(10210, 31, 50, '68.43', 7),
(10210, 32, 40, '51.48', 3),
(10210, 60, 27, '100.67', 9),
(10210, 62, 30, '63.22', 4),
(10210, 79, 29, '56.64', 16),
(10210, 83, 40, '68.10', 8),
(10210, 86, 46, '84.91', 5),
(10210, 91, 39, '57.10', 10),
(10210, 93, 43, '43.20', 11),
(10210, 98, 21, '87.69', 12),
(10210, 101, 26, '93.74', 14),
(10210, 104, 25, '98.48', 6),
(10210, 105, 31, '64.00', 13),
(10210, 108, 42, '60.70', 15),
(10211, 1, 41, '90.92', 14),
(10211, 7, 41, '171.22', 2),
(10211, 10, 36, '126.52', 13),
(10211, 14, 28, '79.80', 3),
(10211, 43, 35, '73.17', 5),
(10211, 45, 28, '138.17', 4),
(10211, 47, 46, '60.30', 8),
(10211, 54, 41, '148.80', 7),
(10211, 58, 25, '109.32', 15),
(10211, 66, 21, '62.33', 11),
(10211, 74, 48, '52.66', 1),
(10211, 84, 22, '80.84', 6),
(10211, 87, 41, '39.83', 9),
(10211, 92, 37, '94.91', 12),
(10211, 96, 40, '70.78', 10),
(10212, 12, 39, '99.82', 16),
(10212, 16, 33, '110.55', 15),
(10212, 18, 29, '117.48', 10),
(10212, 21, 38, '105.77', 6),
(10212, 24, 20, '64.68', 14),
(10212, 25, 41, '133.72', 9),
(10212, 34, 40, '117.48', 7),
(10212, 40, 40, '155.79', 11),
(10212, 46, 45, '115.85', 8),
(10212, 56, 41, '61.73', 3),
(10212, 59, 45, '43.27', 5),
(10212, 67, 45, '81.78', 1),
(10212, 71, 34, '37.38', 12),
(10212, 73, 27, '77.91', 2),
(10212, 76, 46, '100.66', 4),
(10212, 78, 49, '117.96', 13),
(10213, 50, 38, '84.67', 1),
(10213, 55, 25, '58.44', 2),
(10213, 70, 27, '97.48', 3),
(10214, 23, 30, '166.60', 7),
(10214, 27, 21, '53.28', 6),
(10214, 29, 27, '125.86', 4),
(10214, 33, 50, '167.06', 1),
(10214, 61, 20, '32.19', 3),
(10214, 64, 49, '39.87', 2),
(10214, 80, 44, '38.57', 5),
(10215, 2, 35, '205.73', 3),
(10215, 17, 46, '100.34', 2),
(10215, 19, 27, '92.47', 10),
(10215, 20, 33, '53.91', 9),
(10215, 35, 49, '97.26', 4),
(10215, 36, 31, '56.21', 6),
(10215, 38, 49, '89.01', 5),
(10215, 44, 41, '84.33', 8),
(10215, 53, 46, '42.76', 1),
(10215, 82, 39, '94.47', 7),
(10216, 9, 43, '133.94', 1),
(10217, 6, 48, '132.97', 4),
(10217, 30, 35, '58.34', 2),
(10217, 52, 38, '118.66', 5),
(10217, 65, 28, '103.51', 1),
(10217, 85, 21, '78.97', 3),
(10217, 90, 39, '56.24', 7),
(10217, 103, 31, '90.02', 6),
(10218, 28, 22, '110.46', 1),
(10218, 40, 34, '152.41', 2),
(10219, 15, 48, '94.80', 2),
(10219, 26, 43, '132.62', 1),
(10219, 68, 21, '31.12', 3),
(10219, 88, 35, '47.62', 4),
(10220, 8, 32, '189.10', 2),
(10220, 11, 30, '151.08', 3),
(10220, 13, 27, '166.10', 1),
(10220, 49, 50, '126.39', 5),
(10220, 57, 26, '48.55', 8),
(10220, 81, 37, '101.72', 7),
(10220, 89, 20, '49.71', 6),
(10220, 94, 37, '92.60', 9),
(10220, 95, 30, '56.82', 4),
(10221, 39, 33, '133.86', 3),
(10221, 42, 23, '89.75', 5),
(10221, 51, 39, '84.26', 2),
(10221, 63, 49, '113.06', 1),
(10221, 99, 23, '69.29', 4),
(10222, 5, 49, '133.28', 12),
(10222, 22, 49, '137.19', 4),
(10222, 37, 49, '79.14', 10),
(10222, 48, 45, '88.93', 9),
(10222, 69, 32, '56.86', 5),
(10222, 72, 47, '74.35', 14),
(10222, 75, 43, '61.15', 6),
(10222, 77, 46, '77.99', 11),
(10222, 79, 48, '55.27', 3),
(10222, 97, 31, '58.67', 15),
(10222, 100, 26, '80.56', 8),
(10222, 101, 37, '90.75', 1),
(10222, 102, 36, '69.39', 13),
(10222, 106, 38, '84.14', 16),
(10222, 107, 31, '81.43', 17),
(10222, 108, 43, '66.63', 2),
(10222, 109, 31, '45.19', 7),
(10222, 110, 36, '48.59', 18),
(10223, 1, 37, '80.39', 1),
(10223, 3, 47, '110.61', 4),
(10223, 4, 49, '189.79', 3),
(10223, 31, 47, '67.58', 9),
(10223, 32, 28, '58.75', 5),
(10223, 58, 32, '104.81', 2),
(10223, 60, 34, '87.54', 11),
(10223, 62, 38, '60.94', 6),
(10223, 83, 23, '68.10', 10),
(10223, 86, 21, '90.90', 7),
(10223, 91, 20, '66.73', 12),
(10223, 93, 41, '41.02', 13),
(10223, 98, 25, '84.03', 14),
(10223, 104, 29, '113.90', 8),
(10223, 105, 26, '79.20', 15),
(10224, 10, 43, '141.58', 6),
(10224, 47, 38, '57.20', 1),
(10224, 66, 37, '60.26', 4),
(10224, 87, 43, '37.01', 2),
(10224, 92, 30, '94.91', 5),
(10224, 96, 50, '81.36', 3),
(10225, 7, 27, '157.60', 9),
(10225, 12, 25, '101.00', 7),
(10225, 14, 37, '64.64', 10),
(10225, 16, 21, '100.19', 6),
(10225, 18, 32, '116.06', 1),
(10225, 24, 47, '71.61', 5),
(10225, 40, 43, '162.57', 2),
(10225, 43, 37, '69.96', 12),
(10225, 45, 27, '119.06', 11),
(10225, 54, 35, '135.41', 14),
(10225, 71, 42, '34.74', 3),
(10225, 74, 24, '51.43', 8),
(10225, 78, 40, '130.60', 4),
(10225, 84, 46, '77.61', 13),
(10226, 21, 38, '108.26', 4),
(10226, 25, 24, '129.45', 7),
(10226, 34, 24, '125.40', 5),
(10226, 46, 46, '122.91', 6),
(10226, 56, 21, '65.41', 1),
(10226, 59, 36, '47.79', 3),
(10226, 76, 48, '95.30', 2),
(10227, 19, 25, '85.27', 3),
(10227, 20, 31, '50.14', 2),
(10227, 23, 26, '136.00', 10),
(10227, 27, 28, '59.93', 9),
(10227, 29, 46, '118.23', 7),
(10227, 33, 29, '146.81', 4),
(10227, 44, 33, '99.21', 1),
(10227, 50, 34, '87.43', 11),
(10227, 55, 37, '70.56', 12),
(10227, 61, 42, '27.22', 6),
(10227, 64, 24, '39.42', 5),
(10227, 67, 47, '84.51', 14),
(10227, 70, 33, '102.17', 13),
(10227, 73, 40, '78.76', 15),
(10227, 80, 27, '34.88', 8),
(10228, 2, 29, '214.30', 2),
(10228, 17, 32, '100.34', 1),
(10228, 35, 24, '101.31', 3),
(10228, 36, 45, '57.46', 5),
(10228, 38, 31, '100.53', 4),
(10228, 82, 33, '84.73', 6),
(10229, 6, 50, '138.88', 9),
(10229, 9, 25, '110.70', 13),
(10229, 15, 36, '95.99', 1),
(10229, 28, 26, '104.32', 4),
(10229, 30, 28, '53.48', 7),
(10229, 40, 22, '157.49', 5),
(10229, 52, 41, '119.87', 10),
(10229, 53, 39, '43.77', 14),
(10229, 65, 48, '115.01', 6),
(10229, 68, 33, '34.65', 2),
(10229, 85, 25, '78.97', 8),
(10229, 88, 23, '49.78', 3),
(10229, 90, 30, '52.36', 12),
(10229, 103, 50, '91.04', 11),
(10230, 11, 43, '128.42', 1),
(10230, 26, 49, '153.91', 8),
(10230, 49, 42, '142.18', 3),
(10230, 57, 36, '47.40', 6),
(10230, 81, 45, '99.36', 5),
(10230, 89, 46, '59.03', 4),
(10230, 94, 34, '100.70', 7),
(10230, 95, 43, '57.41', 2),
(10231, 8, 42, '193.25', 2),
(10231, 13, 49, '147.07', 1),
(10232, 39, 22, '133.86', 6),
(10232, 42, 48, '97.81', 8),
(10232, 51, 23, '78.12', 5),
(10232, 63, 46, '113.06', 4),
(10232, 99, 26, '84.88', 7),
(10232, 106, 48, '86.15', 1),
(10232, 107, 35, '81.43', 2),
(10232, 110, 24, '48.59', 3),
(10233, 72, 40, '70.81', 2),
(10233, 97, 36, '66.00', 3),
(10233, 102, 29, '67.94', 1),
(10234, 5, 48, '118.32', 9),
(10234, 22, 50, '146.65', 1),
(10234, 37, 48, '84.30', 7),
(10234, 48, 39, '85.75', 6),
(10234, 69, 44, '67.14', 2),
(10234, 75, 25, '65.09', 3),
(10234, 77, 31, '78.83', 8),
(10234, 100, 29, '83.28', 5),
(10234, 109, 40, '45.69', 4),
(10235, 31, 24, '81.95', 3),
(10235, 60, 23, '89.72', 5),
(10235, 79, 33, '55.27', 12),
(10235, 83, 40, '63.03', 4),
(10235, 86, 41, '90.90', 1),
(10235, 91, 34, '66.73', 6),
(10235, 93, 41, '37.09', 7),
(10235, 98, 25, '88.60', 8),
(10235, 101, 38, '92.74', 10),
(10235, 104, 25, '116.28', 2),
(10235, 105, 32, '73.60', 9),
(10235, 108, 34, '70.33', 11),
(10236, 3, 22, '105.86', 1),
(10236, 32, 23, '52.70', 2),
(10236, 62, 36, '65.51', 3),
(10237, 1, 23, '91.87', 7),
(10237, 4, 39, '158.80', 9),
(10237, 10, 32, '129.53', 6),
(10237, 47, 26, '49.74', 1),
(10237, 58, 20, '109.32', 8),
(10237, 66, 26, '62.33', 4),
(10237, 87, 26, '35.00', 2),
(10237, 92, 27, '94.91', 5),
(10237, 96, 20, '78.92', 3),
(10238, 7, 28, '161.49', 3),
(10238, 12, 29, '104.52', 1),
(10238, 14, 20, '73.42', 4),
(10238, 43, 41, '68.35', 6),
(10238, 45, 49, '144.05', 5),
(10238, 54, 44, '120.53', 8),
(10238, 74, 47, '53.88', 2),
(10238, 84, 22, '67.91', 7),
(10239, 16, 21, '100.19', 5),
(10239, 24, 46, '70.07', 4),
(10239, 40, 47, '135.47', 1),
(10239, 71, 20, '32.47', 2),
(10239, 78, 29, '133.41', 3),
(10240, 18, 41, '125.97', 3),
(10240, 25, 37, '136.56', 2),
(10240, 46, 37, '134.22', 1),
(10241, 21, 21, '119.46', 11),
(10241, 23, 41, '153.00', 2),
(10241, 27, 33, '55.70', 1),
(10241, 34, 44, '126.72', 12),
(10241, 50, 42, '77.31', 3),
(10241, 55, 30, '62.72', 4),
(10241, 56, 22, '72.02', 8),
(10241, 59, 21, '47.29', 10),
(10241, 67, 47, '89.05', 6),
(10241, 70, 28, '117.44', 5),
(10241, 73, 26, '69.34', 7),
(10241, 76, 27, '107.08', 9),
(10242, 80, 46, '36.52', 1),
(10243, 29, 47, '111.87', 2),
(10243, 61, 33, '30.87', 1),
(10244, 19, 40, '99.66', 7),
(10244, 20, 20, '48.52', 6),
(10244, 33, 43, '141.75', 8),
(10244, 35, 30, '87.13', 1),
(10244, 36, 24, '54.96', 3),
(10244, 38, 29, '85.87', 2),
(10244, 44, 36, '87.30', 5),
(10244, 64, 39, '42.11', 9),
(10244, 82, 40, '97.39', 4),
(10245, 2, 34, '195.01', 9),
(10245, 6, 28, '147.74', 2),
(10245, 9, 38, '120.27', 6),
(10245, 17, 29, '114.34', 8),
(10245, 52, 21, '111.39', 3),
(10245, 53, 45, '48.80', 7),
(10245, 85, 37, '81.86', 1),
(10245, 90, 44, '54.94', 5),
(10245, 103, 44, '81.93', 4),
(10246, 15, 46, '99.54', 5),
(10246, 26, 40, '144.08', 4),
(10246, 28, 22, '100.64', 8),
(10246, 30, 30, '57.73', 11),
(10246, 40, 36, '145.63', 9),
(10246, 57, 44, '46.24', 2),
(10246, 65, 29, '118.84', 10),
(10246, 68, 49, '34.65', 6),
(10246, 81, 46, '100.54', 1),
(10246, 88, 35, '45.45', 7),
(10246, 94, 22, '113.44', 3),
(10247, 8, 44, '195.33', 2),
(10247, 11, 25, '140.50', 3),
(10247, 13, 27, '167.83', 1),
(10247, 49, 48, '143.62', 5),
(10247, 89, 40, '58.41', 6),
(10247, 95, 49, '51.55', 4),
(10248, 5, 20, '126.48', 3),
(10248, 37, 21, '80.86', 1),
(10248, 39, 32, '133.86', 12),
(10248, 42, 42, '95.80', 14),
(10248, 51, 42, '87.77', 11),
(10248, 63, 48, '122.89', 10),
(10248, 72, 30, '85.85', 5),
(10248, 77, 23, '83.02', 2),
(10248, 97, 36, '66.00', 6),
(10248, 99, 40, '81.41', 13),
(10248, 102, 32, '69.39', 4),
(10248, 106, 30, '84.14', 7),
(10248, 107, 35, '92.36', 8),
(10248, 110, 23, '53.51', 9),
(10249, 48, 46, '88.93', 5),
(10249, 69, 20, '54.81', 1),
(10249, 75, 25, '65.75', 2),
(10249, 100, 40, '85.99', 4),
(10249, 109, 32, '49.16', 3),
(10250, 22, 45, '148.23', 14),
(10250, 31, 27, '84.48', 4),
(10250, 60, 31, '95.20', 6),
(10250, 62, 32, '63.22', 1),
(10250, 79, 40, '61.42', 13),
(10250, 83, 37, '72.45', 5),
(10250, 86, 31, '99.89', 2),
(10250, 91, 50, '62.60', 7),
(10250, 93, 36, '36.66', 8),
(10250, 98, 31, '91.34', 9),
(10250, 101, 35, '90.75', 11),
(10250, 104, 44, '98.48', 3),
(10250, 105, 44, '76.00', 10),
(10250, 108, 38, '65.89', 12),
(10251, 1, 59, '93.79', 2),
(10251, 3, 44, '115.37', 5),
(10251, 4, 43, '172.36', 4),
(10251, 10, 46, '129.53', 1),
(10251, 32, 44, '58.15', 6),
(10251, 58, 50, '91.29', 3),
(10252, 43, 20, '74.78', 2),
(10252, 45, 41, '145.52', 1),
(10252, 47, 31, '50.36', 5),
(10252, 54, 26, '127.97', 4),
(10252, 66, 47, '63.03', 8),
(10252, 84, 38, '69.52', 3),
(10252, 87, 36, '36.21', 6),
(10252, 92, 25, '93.89', 9),
(10252, 96, 48, '72.41', 7),
(10253, 7, 24, '157.60', 13),
(10253, 12, 22, '102.17', 11),
(10253, 14, 25, '67.03', 14),
(10253, 16, 41, '109.40', 10),
(10253, 18, 26, '130.22', 5),
(10253, 21, 24, '103.29', 1),
(10253, 24, 23, '67.76', 9),
(10253, 25, 33, '130.87', 4),
(10253, 34, 37, '114.84', 2),
(10253, 40, 40, '145.63', 6),
(10253, 46, 31, '139.87', 3),
(10253, 71, 40, '34.74', 7),
(10253, 74, 24, '50.82', 12),
(10253, 78, 39, '115.15', 8),
(10254, 23, 49, '137.70', 5),
(10254, 27, 36, '55.09', 4),
(10254, 29, 41, '102.98', 2),
(10254, 50, 34, '80.99', 6),
(10254, 55, 30, '59.87', 7),
(10254, 56, 34, '66.88', 11),
(10254, 59, 32, '43.27', 13),
(10254, 61, 38, '28.88', 1),
(10254, 67, 31, '85.42', 9),
(10254, 70, 33, '111.57', 8),
(10254, 73, 42, '69.34', 10),
(10254, 76, 49, '101.73', 12),
(10254, 80, 20, '39.80', 3),
(10255, 33, 24, '135.00', 1),
(10255, 64, 37, '37.63', 2),
(10256, 19, 34, '93.49', 2),
(10256, 20, 29, '52.83', 1),
(10257, 35, 50, '92.19', 1),
(10257, 36, 49, '59.34', 3),
(10257, 38, 37, '83.78', 2),
(10257, 44, 26, '91.27', 5),
(10257, 82, 46, '81.81', 4),
(10258, 2, 32, '177.87', 6),
(10258, 9, 41, '133.94', 3),
(10258, 17, 41, '113.17', 5),
(10258, 53, 21, '49.81', 4),
(10258, 90, 20, '62.70', 2),
(10258, 103, 45, '86.99', 1),
(10259, 6, 26, '121.15', 12),
(10259, 15, 46, '117.32', 4),
(10259, 26, 30, '134.26', 3),
(10259, 28, 34, '120.28', 7),
(10259, 30, 30, '59.55', 10),
(10259, 40, 27, '152.41', 8),
(10259, 52, 41, '107.76', 13),
(10259, 57, 28, '46.82', 1),
(10259, 65, 47, '121.40', 9),
(10259, 68, 31, '31.47', 5),
(10259, 85, 45, '95.35', 11),
(10259, 88, 40, '45.99', 6),
(10259, 94, 29, '105.33', 2),
(10260, 8, 46, '180.79', 5),
(10260, 11, 30, '140.50', 6),
(10260, 13, 44, '169.56', 4),
(10260, 39, 32, '121.57', 1),
(10260, 42, 29, '92.77', 3),
(10260, 49, 23, '137.88', 8),
(10260, 81, 23, '117.10', 10),
(10260, 89, 27, '55.30', 9),
(10260, 95, 21, '56.24', 7),
(10260, 99, 33, '80.55', 2),
(10261, 5, 27, '116.96', 1),
(10261, 51, 20, '80.75', 9),
(10261, 63, 36, '105.69', 8),
(10261, 72, 22, '79.66', 3),
(10261, 97, 34, '64.00', 4),
(10261, 102, 44, '58.55', 2),
(10261, 106, 25, '89.15', 5),
(10261, 107, 50, '88.39', 6),
(10261, 110, 29, '43.68', 7),
(10262, 22, 49, '157.69', 9),
(10262, 37, 32, '81.72', 15),
(10262, 48, 34, '85.75', 14),
(10262, 60, 34, '98.48', 1),
(10262, 69, 24, '63.71', 10),
(10262, 75, 46, '65.75', 11),
(10262, 77, 49, '82.18', 16),
(10262, 79, 48, '58.69', 8),
(10262, 91, 40, '63.97', 2),
(10262, 93, 49, '35.78', 3),
(10262, 98, 40, '87.69', 4),
(10262, 100, 44, '83.28', 13),
(10262, 101, 33, '81.77', 6),
(10262, 105, 27, '64.80', 5),
(10262, 108, 35, '64.41', 7),
(10262, 109, 21, '41.71', 12),
(10263, 1, 34, '89.00', 2),
(10263, 3, 40, '107.05', 5),
(10263, 4, 41, '193.66', 4),
(10263, 10, 48, '123.51', 1),
(10263, 31, 33, '67.58', 10),
(10263, 32, 34, '50.27', 6),
(10263, 58, 42, '109.32', 3),
(10263, 62, 37, '67.03', 7),
(10263, 83, 24, '59.41', 11),
(10263, 86, 31, '93.90', 8),
(10263, 104, 47, '117.46', 9),
(10264, 47, 48, '58.44', 3),
(10264, 54, 20, '124.99', 2),
(10264, 66, 37, '61.64', 6),
(10264, 84, 47, '75.18', 1),
(10264, 87, 20, '39.02', 4),
(10264, 92, 34, '100.01', 7),
(10264, 96, 47, '67.53', 5),
(10265, 43, 45, '74.78', 2),
(10265, 45, 49, '123.47', 1),
(10266, 7, 44, '188.73', 14),
(10266, 12, 22, '110.39', 12),
(10266, 14, 35, '67.83', 15),
(10266, 16, 40, '112.86', 11),
(10266, 18, 21, '131.63', 6),
(10266, 21, 36, '99.55', 2),
(10266, 24, 33, '77.00', 10),
(10266, 25, 49, '139.41', 5),
(10266, 34, 20, '113.52', 3),
(10266, 40, 29, '137.17', 7),
(10266, 46, 33, '127.15', 4),
(10266, 59, 28, '40.25', 1),
(10266, 71, 34, '35.12', 8),
(10266, 74, 47, '56.33', 13),
(10266, 78, 24, '119.37', 9),
(10267, 55, 36, '71.27', 1),
(10267, 56, 40, '72.02', 5),
(10267, 67, 38, '76.33', 3),
(10267, 70, 43, '93.95', 2),
(10267, 73, 44, '83.90', 4),
(10267, 76, 43, '98.51', 6),
(10268, 19, 49, '93.49', 3),
(10268, 20, 26, '45.82', 2),
(10268, 23, 34, '164.90', 10),
(10268, 27, 31, '60.54', 9),
(10268, 29, 50, '124.59', 7),
(10268, 33, 35, '148.50', 4),
(10268, 44, 39, '96.23', 1),
(10268, 50, 35, '84.67', 11),
(10268, 61, 33, '31.86', 6),
(10268, 64, 40, '36.29', 5),
(10268, 80, 30, '37.75', 8),
(10269, 36, 32, '57.46', 1),
(10269, 82, 48, '95.44', 2),
(10270, 2, 21, '171.44', 9),
(10270, 6, 32, '124.10', 2),
(10270, 9, 28, '135.30', 6),
(10270, 17, 43, '94.50', 8),
(10270, 35, 31, '81.05', 10),
(10270, 38, 38, '85.87', 11),
(10270, 52, 38, '107.76', 3),
(10270, 53, 44, '40.25', 7),
(10270, 85, 32, '93.42', 1),
(10270, 90, 21, '52.36', 5),
(10270, 103, 46, '101.15', 4),
(10271, 15, 31, '99.54', 5),
(10271, 26, 50, '147.36', 4),
(10271, 28, 50, '121.50', 8),
(10271, 30, 25, '59.55', 11),
(10271, 40, 20, '169.34', 9),
(10271, 57, 45, '49.71', 2),
(10271, 65, 43, '122.68', 10),
(10271, 68, 38, '28.64', 6),
(10271, 81, 22, '110.00', 1),
(10271, 88, 35, '51.95', 7),
(10271, 94, 34, '93.76', 3),
(10272, 8, 35, '187.02', 2),
(10272, 11, 27, '123.89', 3),
(10272, 13, 39, '148.80', 1),
(10272, 49, 25, '126.39', 5),
(10272, 89, 45, '56.55', 6),
(10272, 95, 43, '53.89', 4),
(10273, 5, 30, '136.00', 4),
(10273, 37, 34, '84.30', 2),
(10273, 39, 40, '117.47', 13),
(10273, 42, 47, '87.73', 15),
(10273, 48, 50, '105.87', 1),
(10273, 51, 33, '72.85', 12),
(10273, 63, 22, '103.23', 11),
(10273, 72, 27, '84.08', 6),
(10273, 77, 48, '83.86', 3),
(10273, 97, 21, '66.00', 7),
(10273, 99, 21, '77.95', 14),
(10273, 102, 42, '57.82', 5),
(10273, 106, 40, '91.15', 8),
(10273, 107, 26, '89.38', 9),
(10273, 110, 37, '51.32', 10),
(10274, 22, 41, '129.31', 1),
(10274, 69, 40, '56.86', 2),
(10274, 75, 24, '65.09', 3),
(10274, 100, 24, '75.13', 5),
(10274, 109, 32, '49.66', 4),
(10275, 1, 45, '81.35', 1),
(10275, 3, 22, '115.37', 4),
(10275, 4, 36, '154.93', 3),
(10275, 31, 35, '70.12', 9),
(10275, 32, 37, '52.09', 5),
(10275, 58, 21, '105.94', 2),
(10275, 60, 25, '97.38', 11),
(10275, 62, 30, '61.70', 6),
(10275, 79, 41, '58.00', 18),
(10275, 83, 27, '67.38', 10),
(10275, 86, 23, '89.90', 7),
(10275, 91, 28, '58.47', 12),
(10275, 93, 38, '40.15', 13),
(10275, 98, 32, '85.86', 14),
(10275, 101, 39, '82.77', 16),
(10275, 104, 48, '102.04', 8),
(10275, 105, 43, '72.00', 15),
(10275, 108, 31, '59.96', 17),
(10276, 7, 50, '184.84', 3),
(10276, 10, 43, '150.62', 14),
(10276, 12, 47, '104.52', 1),
(10276, 14, 38, '67.83', 4),
(10276, 43, 38, '78.00', 6),
(10276, 45, 30, '139.64', 5),
(10276, 47, 33, '54.71', 9),
(10276, 54, 48, '120.53', 8),
(10276, 66, 46, '61.64', 12),
(10276, 74, 20, '58.17', 2),
(10276, 84, 48, '67.10', 7),
(10276, 87, 27, '35.40', 10),
(10276, 92, 38, '94.91', 13),
(10276, 96, 21, '67.53', 11),
(10277, 16, 28, '93.28', 1),
(10278, 18, 34, '114.65', 6),
(10278, 21, 23, '107.02', 2),
(10278, 24, 29, '73.15', 10),
(10278, 25, 29, '118.07', 5),
(10278, 34, 39, '117.48', 3),
(10278, 40, 42, '167.65', 7),
(10278, 46, 31, '114.44', 4),
(10278, 59, 35, '48.80', 1),
(10278, 71, 31, '37.38', 8),
(10278, 78, 25, '136.22', 9),
(10279, 55, 26, '68.42', 1),
(10279, 56, 32, '68.35', 5),
(10279, 67, 49, '76.33', 3),
(10279, 70, 48, '106.87', 2),
(10279, 73, 33, '78.76', 4),
(10279, 76, 48, '95.30', 6),
(10280, 2, 34, '205.73', 2),
(10280, 17, 24, '98.00', 1),
(10280, 19, 50, '87.33', 9),
(10280, 20, 27, '47.44', 8),
(10280, 23, 26, '161.50', 16),
(10280, 27, 25, '53.28', 15),
(10280, 29, 37, '109.33', 13),
(10280, 33, 22, '158.63', 10),
(10280, 35, 46, '82.06', 3),
(10280, 36, 43, '54.34', 5),
(10280, 38, 29, '102.63', 4),
(10280, 44, 34, '99.21', 7),
(10280, 50, 35, '77.31', 17),
(10280, 61, 20, '29.87', 12),
(10280, 64, 45, '36.29', 11),
(10280, 80, 33, '35.29', 14),
(10280, 82, 21, '79.86', 6),
(10281, 6, 44, '132.97', 9),
(10281, 9, 25, '127.10', 13),
(10281, 15, 41, '98.36', 1),
(10281, 28, 48, '114.14', 4),
(10281, 30, 29, '56.52', 7),
(10281, 40, 25, '135.47', 5),
(10281, 52, 25, '96.86', 10),
(10281, 53, 44, '42.76', 14),
(10281, 65, 25, '112.46', 6),
(10281, 68, 20, '33.95', 2),
(10281, 85, 29, '80.90', 8),
(10281, 88, 31, '44.91', 3),
(10281, 90, 36, '59.47', 12),
(10281, 103, 27, '89.01', 11),
(10282, 8, 41, '176.63', 5),
(10282, 11, 27, '142.02', 6),
(10282, 13, 24, '169.56', 4),
(10282, 26, 23, '147.36', 13),
(10282, 39, 43, '122.93', 1),
(10282, 42, 36, '88.74', 3),
(10282, 49, 31, '132.13', 8),
(10282, 57, 29, '49.71', 11),
(10282, 81, 39, '96.99', 10),
(10282, 89, 36, '51.58', 9),
(10282, 94, 38, '114.59', 12),
(10282, 95, 37, '56.24', 7),
(10282, 99, 43, '77.95', 2),
(10283, 5, 25, '130.56', 6),
(10283, 37, 21, '78.28', 4),
(10283, 48, 46, '100.58', 3),
(10283, 51, 34, '71.97', 14),
(10283, 63, 42, '99.54', 13),
(10283, 72, 34, '80.54', 8),
(10283, 77, 33, '77.15', 5),
(10283, 97, 45, '62.00', 9),
(10283, 100, 20, '74.23', 2),
(10283, 102, 47, '68.67', 7),
(10283, 106, 22, '88.15', 10),
(10283, 107, 38, '85.41', 11),
(10283, 109, 43, '41.22', 1),
(10283, 110, 33, '49.14', 12),
(10284, 22, 45, '137.19', 11),
(10284, 31, 31, '68.43', 1),
(10284, 60, 22, '101.76', 3),
(10284, 69, 30, '65.08', 12),
(10284, 75, 39, '59.83', 13),
(10284, 79, 21, '65.51', 10),
(10284, 83, 21, '66.65', 2),
(10284, 91, 50, '60.54', 4),
(10284, 93, 33, '35.78', 5),
(10284, 98, 24, '87.69', 6),
(10284, 101, 45, '95.73', 8),
(10284, 105, 25, '68.00', 7),
(10284, 108, 32, '73.29', 9),
(10285, 1, 36, '95.70', 6),
(10285, 3, 47, '110.61', 9),
(10285, 4, 27, '166.55', 8),
(10285, 10, 49, '131.04', 5),
(10285, 32, 20, '50.88', 10),
(10285, 58, 34, '91.29', 7),
(10285, 62, 39, '61.70', 11),
(10285, 66, 38, '64.41', 3),
(10285, 86, 37, '82.91', 12),
(10285, 87, 37, '36.61', 1),
(10285, 92, 26, '100.01', 4),
(10285, 96, 39, '76.48', 2),
(10285, 104, 45, '102.04', 13),
(10286, 47, 38, '51.60', 1),
(10287, 7, 21, '190.68', 12),
(10287, 12, 45, '117.44', 10),
(10287, 14, 41, '74.21', 13),
(10287, 16, 23, '107.10', 9),
(10287, 18, 41, '113.23', 4),
(10287, 24, 44, '61.60', 8),
(10287, 25, 24, '123.76', 3),
(10287, 34, 44, '114.84', 1),
(10287, 40, 36, '137.17', 5),
(10287, 43, 43, '68.35', 15),
(10287, 45, 40, '127.88', 14),
(10287, 46, 27, '139.87', 2),
(10287, 54, 34, '119.04', 17),
(10287, 71, 36, '31.34', 6),
(10287, 74, 20, '58.17', 11),
(10287, 78, 36, '137.62', 7),
(10287, 84, 40, '79.22', 16),
(10288, 21, 20, '120.71', 14),
(10288, 23, 32, '168.30', 5),
(10288, 27, 28, '50.25', 4),
(10288, 29, 31, '102.98', 2),
(10288, 50, 35, '90.19', 6),
(10288, 55, 23, '57.02', 7),
(10288, 56, 36, '66.88', 11),
(10288, 59, 50, '49.30', 13),
(10288, 61, 29, '32.19', 1),
(10288, 67, 35, '81.78', 9),
(10288, 70, 48, '109.22', 8),
(10288, 73, 34, '76.19', 10),
(10288, 76, 41, '101.73', 12),
(10288, 80, 33, '37.75', 3),
(10289, 19, 38, '92.47', 2),
(10289, 20, 24, '44.75', 1),
(10289, 33, 43, '141.75', 3),
(10289, 64, 45, '41.22', 4),
(10290, 44, 26, '80.36', 2),
(10290, 82, 45, '83.76', 1),
(10291, 2, 37, '210.01', 11),
(10291, 6, 30, '141.83', 4),
(10291, 9, 41, '123.00', 8),
(10291, 17, 41, '96.84', 10),
(10291, 30, 26, '52.26', 2),
(10291, 35, 47, '99.28', 12),
(10291, 36, 37, '56.21', 14),
(10291, 38, 23, '93.20', 13),
(10291, 52, 48, '96.86', 5),
(10291, 53, 29, '45.28', 9),
(10291, 65, 48, '109.90', 1),
(10291, 85, 26, '82.83', 3),
(10291, 90, 32, '53.00', 7),
(10291, 103, 28, '86.99', 6),
(10292, 15, 21, '94.80', 8),
(10292, 26, 26, '140.81', 7),
(10292, 28, 41, '103.09', 11),
(10292, 40, 21, '147.33', 12),
(10292, 49, 44, '114.90', 2),
(10292, 57, 40, '48.55', 5),
(10292, 68, 39, '34.30', 9),
(10292, 81, 27, '113.55', 4),
(10292, 88, 50, '54.11', 10),
(10292, 89, 31, '59.65', 3),
(10292, 94, 41, '113.44', 6),
(10292, 95, 35, '49.79', 1),
(10293, 8, 46, '187.02', 8),
(10293, 11, 24, '129.93', 9),
(10293, 13, 45, '171.29', 7),
(10293, 39, 24, '110.64', 4),
(10293, 42, 22, '91.76', 6),
(10293, 51, 49, '72.85', 3),
(10293, 63, 21, '111.83', 2),
(10293, 99, 29, '77.95', 5),
(10293, 110, 32, '51.32', 1),
(10294, 107, 45, '98.32', 1),
(10295, 5, 24, '136.00', 1),
(10295, 72, 46, '84.08', 3),
(10295, 97, 26, '62.00', 4),
(10295, 102, 44, '71.56', 2),
(10295, 106, 34, '93.16', 5),
(10296, 22, 36, '146.65', 7),
(10296, 37, 21, '69.68', 13),
(10296, 48, 22, '105.87', 12),
(10296, 69, 21, '60.97', 8),
(10296, 75, 31, '63.78', 9),
(10296, 77, 22, '83.02', 14),
(10296, 79, 32, '63.46', 6),
(10296, 93, 26, '41.02', 1),
(10296, 98, 42, '75.81', 2),
(10296, 100, 34, '89.61', 11),
(10296, 101, 24, '96.73', 4),
(10296, 105, 22, '74.40', 3),
(10296, 108, 47, '61.44', 5),
(10296, 109, 21, '46.68', 10),
(10297, 31, 25, '81.95', 4),
(10297, 60, 32, '107.23', 6),
(10297, 62, 32, '70.08', 1),
(10297, 83, 23, '71.73', 5),
(10297, 86, 26, '88.90', 2),
(10297, 91, 28, '63.29', 7),
(10297, 104, 35, '111.53', 3),
(10298, 3, 39, '105.86', 1),
(10298, 32, 32, '60.57', 2),
(10299, 1, 23, '76.56', 9),
(10299, 4, 29, '164.61', 11),
(10299, 10, 24, '123.51', 8),
(10299, 47, 39, '62.17', 3),
(10299, 54, 49, '119.04', 2),
(10299, 58, 47, '107.07', 10),
(10299, 66, 33, '58.87', 6),
(10299, 84, 32, '66.29', 1),
(10299, 87, 24, '36.21', 4),
(10299, 92, 38, '84.70', 7),
(10299, 96, 44, '77.29', 5),
(10300, 7, 33, '184.84', 5),
(10300, 12, 29, '116.27', 3),
(10300, 14, 22, '76.61', 6),
(10300, 16, 23, '95.58', 2),
(10300, 24, 41, '63.14', 1),
(10300, 43, 49, '65.94', 8),
(10300, 45, 23, '144.05', 7),
(10300, 74, 31, '52.05', 4),
(10301, 18, 37, '114.65', 8),
(10301, 21, 32, '118.22', 4),
(10301, 25, 47, '119.49', 7),
(10301, 34, 22, '113.52', 5),
(10301, 40, 23, '135.47', 9),
(10301, 46, 39, '137.04', 6),
(10301, 56, 27, '64.67', 1),
(10301, 59, 22, '40.75', 3),
(10301, 71, 48, '32.10', 10),
(10301, 76, 22, '86.73', 2),
(10301, 78, 50, '122.17', 11),
(10302, 23, 43, '166.60', 1),
(10302, 50, 38, '82.83', 2),
(10302, 55, 23, '70.56', 3),
(10302, 67, 49, '75.42', 5),
(10302, 70, 45, '104.52', 4),
(10302, 73, 48, '74.48', 6),
(10303, 27, 46, '56.91', 2),
(10303, 80, 24, '35.70', 1),
(10304, 2, 47, '201.44', 6),
(10304, 9, 39, '117.54', 3),
(10304, 17, 46, '106.17', 5),
(10304, 19, 37, '95.55', 13),
(10304, 20, 37, '46.90', 12),
(10304, 29, 24, '102.98', 17),
(10304, 33, 20, '141.75', 14),
(10304, 35, 46, '98.27', 7),
(10304, 36, 24, '54.34', 9),
(10304, 38, 26, '90.06', 8),
(10304, 44, 38, '95.24', 11),
(10304, 53, 34, '44.27', 4),
(10304, 61, 23, '29.21', 16),
(10304, 64, 44, '42.11', 15),
(10304, 82, 33, '80.83', 10),
(10304, 90, 36, '52.36', 2),
(10304, 103, 40, '80.92', 1),
(10305, 6, 38, '130.01', 13),
(10305, 15, 38, '107.84', 5),
(10305, 26, 27, '132.62', 4),
(10305, 28, 36, '117.82', 8),
(10305, 30, 41, '58.95', 11),
(10305, 40, 37, '160.87', 9),
(10305, 52, 22, '112.60', 14),
(10305, 57, 45, '48.55', 2),
(10305, 65, 24, '107.34', 10),
(10305, 68, 48, '30.76', 6),
(10305, 81, 36, '118.28', 1),
(10305, 85, 28, '94.38', 12),
(10305, 88, 40, '48.70', 7),
(10305, 94, 42, '109.96', 3),
(10306, 8, 31, '182.86', 13),
(10306, 11, 34, '145.04', 14),
(10306, 13, 20, '145.34', 12),
(10306, 39, 32, '114.74', 9),
(10306, 42, 40, '83.70', 11),
(10306, 49, 23, '126.39', 16),
(10306, 51, 39, '85.14', 8),
(10306, 63, 29, '109.37', 7),
(10306, 72, 31, '76.12', 2),
(10306, 89, 46, '60.28', 17),
(10306, 95, 34, '51.55', 15),
(10306, 97, 50, '61.34', 3),
(10306, 99, 38, '73.62', 10),
(10306, 102, 43, '62.16', 1),
(10306, 106, 32, '99.17', 4),
(10306, 107, 30, '87.39', 5),
(10306, 110, 35, '48.05', 6),
(10307, 5, 22, '118.32', 9),
(10307, 22, 39, '135.61', 1),
(10307, 37, 31, '71.40', 7),
(10307, 48, 48, '92.11', 6),
(10307, 69, 25, '58.23', 2),
(10307, 75, 22, '64.44', 3),
(10307, 77, 22, '75.47', 8),
(10307, 100, 34, '81.47', 5),
(10307, 109, 34, '44.20', 4),
(10308, 3, 34, '115.37', 2),
(10308, 4, 20, '187.85', 1),
(10308, 31, 27, '81.95', 7),
(10308, 32, 34, '48.46', 3),
(10308, 60, 31, '99.57', 9),
(10308, 62, 47, '68.55', 4),
(10308, 79, 43, '58.00', 16),
(10308, 83, 44, '71.73', 8),
(10308, 86, 24, '99.89', 5),
(10308, 91, 46, '61.22', 10),
(10308, 93, 47, '37.09', 11),
(10308, 98, 21, '73.07', 12),
(10308, 101, 35, '88.75', 14),
(10308, 104, 31, '100.85', 6),
(10308, 105, 21, '79.20', 13),
(10308, 108, 39, '62.93', 15),
(10309, 1, 41, '94.74', 5),
(10309, 10, 26, '144.60', 4),
(10309, 58, 21, '96.92', 6),
(10309, 66, 24, '59.56', 2),
(10309, 92, 50, '93.89', 3),
(10309, 96, 28, '74.04', 1),
(10310, 7, 33, '165.38', 10),
(10310, 12, 24, '105.70', 8),
(10310, 14, 49, '77.41', 11),
(10310, 16, 25, '101.34', 7),
(10310, 18, 37, '128.80', 2),
(10310, 24, 20, '66.99', 6),
(10310, 25, 24, '129.45', 1),
(10310, 40, 48, '159.18', 3),
(10310, 43, 27, '70.76', 13),
(10310, 45, 49, '122.00', 12),
(10310, 47, 42, '59.06', 16),
(10310, 54, 40, '133.92', 15),
(10310, 71, 33, '33.23', 4),
(10310, 74, 38, '50.21', 9),
(10310, 78, 45, '139.03', 5),
(10310, 84, 49, '75.18', 14),
(10310, 87, 36, '38.62', 17),
(10311, 21, 29, '124.44', 9),
(10311, 34, 43, '114.84', 10),
(10311, 46, 32, '134.22', 11),
(10311, 50, 41, '92.03', 1),
(10311, 55, 25, '66.99', 2),
(10311, 56, 26, '70.55', 6),
(10311, 59, 45, '48.80', 8),
(10311, 67, 28, '89.05', 4),
(10311, 70, 43, '116.27', 3),
(10311, 73, 25, '85.61', 5),
(10311, 76, 46, '91.02', 7),
(10312, 2, 48, '214.30', 3),
(10312, 17, 32, '101.50', 2),
(10312, 19, 43, '102.74', 10),
(10312, 20, 25, '43.67', 9),
(10312, 23, 48, '146.20', 17),
(10312, 27, 30, '48.43', 16),
(10312, 29, 31, '111.87', 14),
(10312, 33, 25, '150.19', 11),
(10312, 35, 37, '91.18', 4),
(10312, 36, 35, '54.34', 6),
(10312, 38, 38, '93.20', 5),
(10312, 44, 33, '84.33', 8),
(10312, 53, 39, '44.27', 1),
(10312, 61, 39, '27.88', 13),
(10312, 64, 23, '43.46', 12),
(10312, 80, 31, '40.21', 15),
(10312, 82, 44, '96.42', 7),
(10313, 6, 40, '141.83', 7),
(10313, 9, 21, '131.20', 11),
(10313, 28, 29, '109.23', 2),
(10313, 30, 34, '52.87', 5),
(10313, 40, 25, '143.94', 3),
(10313, 52, 28, '110.18', 8),
(10313, 65, 42, '102.23', 4),
(10313, 85, 27, '96.31', 6),
(10313, 88, 38, '48.70', 1),
(10313, 90, 34, '55.59', 10),
(10313, 103, 30, '96.09', 9),
(10314, 8, 38, '176.63', 5),
(10314, 11, 46, '125.40', 6),
(10314, 13, 36, '169.56', 4),
(10314, 15, 45, '95.99', 14),
(10314, 26, 42, '135.90', 13),
(10314, 39, 20, '129.76', 1),
(10314, 42, 23, '84.71', 3),
(10314, 49, 29, '129.26', 8),
(10314, 57, 44, '51.44', 11),
(10314, 68, 39, '31.82', 15),
(10314, 81, 38, '111.18', 10),
(10314, 89, 35, '58.41', 9),
(10314, 94, 28, '115.75', 12),
(10314, 95, 38, '50.38', 7),
(10314, 99, 23, '83.15', 2),
(10315, 51, 36, '78.12', 7),
(10315, 63, 35, '111.83', 6),
(10315, 72, 24, '78.77', 1),
(10315, 97, 41, '60.67', 2),
(10315, 106, 31, '99.17', 3),
(10315, 107, 37, '88.39', 4),
(10315, 110, 40, '51.32', 5),
(10316, 5, 33, '126.48', 17),
(10316, 22, 27, '140.34', 9),
(10316, 37, 21, '72.26', 15),
(10316, 48, 47, '89.99', 14),
(10316, 60, 25, '93.01', 1),
(10316, 69, 34, '67.14', 10),
(10316, 75, 47, '55.23', 11),
(10316, 77, 25, '77.15', 16),
(10316, 79, 30, '67.56', 8),
(10316, 91, 24, '59.16', 2),
(10316, 93, 34, '36.66', 3),
(10316, 98, 34, '74.90', 4),
(10316, 100, 45, '73.32', 13),
(10316, 101, 23, '85.76', 6),
(10316, 102, 48, '67.22', 18),
(10316, 105, 48, '77.60', 5),
(10316, 108, 44, '68.11', 7),
(10316, 109, 34, '43.70', 12),
(10317, 83, 35, '69.55', 1),
(10318, 1, 46, '84.22', 1),
(10318, 3, 45, '102.29', 4),
(10318, 4, 37, '189.79', 3),
(10318, 31, 31, '81.95', 9),
(10318, 32, 42, '49.67', 5),
(10318, 58, 48, '93.54', 2),
(10318, 62, 26, '60.94', 6),
(10318, 86, 47, '81.91', 7),
(10318, 104, 50, '102.04', 8),
(10319, 10, 30, '134.05', 9),
(10319, 43, 46, '77.19', 1),
(10319, 47, 44, '54.71', 4),
(10319, 54, 45, '120.53', 3),
(10319, 66, 31, '65.80', 7),
(10319, 84, 43, '78.41', 2),
(10319, 87, 29, '35.00', 5),
(10319, 92, 22, '96.95', 8),
(10319, 96, 45, '79.73', 6),
(10320, 7, 31, '184.84', 3),
(10320, 12, 35, '102.17', 1),
(10320, 14, 38, '63.84', 4),
(10320, 45, 25, '139.64', 5),
(10320, 74, 26, '60.62', 2),
(10321, 16, 24, '105.95', 15),
(10321, 18, 41, '123.14', 10),
(10321, 21, 44, '120.71', 6),
(10321, 24, 37, '73.92', 14),
(10321, 25, 25, '142.25', 9),
(10321, 34, 27, '126.72', 7),
(10321, 40, 33, '164.26', 11),
(10321, 46, 28, '138.45', 8),
(10321, 56, 30, '68.35', 3),
(10321, 59, 48, '42.76', 5),
(10321, 67, 30, '74.51', 1),
(10321, 71, 37, '31.72', 12),
(10321, 73, 39, '81.33', 2),
(10321, 76, 21, '103.87', 4),
(10321, 78, 26, '137.62', 13),
(10322, 2, 40, '180.01', 1),
(10322, 6, 46, '141.83', 8),
(10322, 9, 27, '136.67', 9),
(10322, 17, 22, '101.50', 10),
(10322, 19, 43, '92.47', 14),
(10322, 20, 41, '44.21', 5),
(10322, 29, 50, '120.77', 6),
(10322, 30, 35, '57.12', 11),
(10322, 33, 36, '158.63', 2),
(10322, 35, 33, '100.30', 12),
(10322, 36, 41, '54.34', 13),
(10322, 38, 48, '90.06', 7),
(10322, 61, 20, '26.55', 3),
(10322, 64, 30, '40.77', 4),
(10323, 44, 33, '88.30', 2),
(10323, 52, 47, '96.86', 1),
(10324, 11, 27, '148.06', 1),
(10324, 15, 26, '100.73', 7),
(10324, 26, 47, '142.45', 8),
(10324, 28, 33, '105.55', 10),
(10324, 40, 27, '137.17', 12),
(10324, 49, 49, '120.64', 13),
(10324, 53, 38, '49.81', 6),
(10324, 57, 25, '49.71', 14),
(10324, 65, 31, '107.34', 2),
(10324, 68, 30, '29.35', 9),
(10324, 82, 33, '95.44', 3),
(10324, 85, 20, '91.49', 11),
(10324, 90, 48, '60.76', 4),
(10324, 103, 34, '80.92', 5),
(10325, 5, 47, '111.52', 6),
(10325, 8, 42, '193.25', 8),
(10325, 13, 24, '166.10', 1),
(10325, 39, 24, '114.74', 9),
(10325, 81, 44, '114.73', 5),
(10325, 88, 38, '44.37', 3),
(10325, 89, 28, '55.30', 2),
(10325, 94, 38, '99.55', 4),
(10325, 95, 44, '56.24', 7),
(10326, 42, 32, '94.79', 6),
(10326, 51, 50, '73.73', 5),
(10326, 63, 41, '120.43', 4),
(10326, 72, 41, '86.74', 3),
(10326, 77, 20, '81.34', 2),
(10326, 97, 39, '60.67', 1),
(10327, 22, 25, '154.54', 6),
(10327, 31, 45, '74.34', 8),
(10327, 37, 25, '74.84', 5),
(10327, 99, 20, '79.68', 7),
(10327, 102, 21, '65.05', 1),
(10327, 106, 43, '85.14', 2),
(10327, 107, 37, '83.42', 3),
(10327, 110, 37, '48.05', 4),
(10328, 48, 34, '104.81', 6),
(10328, 60, 47, '87.54', 14),
(10328, 69, 48, '67.82', 1),
(10328, 75, 20, '56.55', 2),
(10328, 79, 35, '55.96', 3),
(10328, 83, 43, '69.55', 4),
(10328, 91, 24, '57.10', 5),
(10328, 93, 34, '42.33', 7),
(10328, 98, 27, '84.03', 8),
(10328, 100, 41, '75.13', 9),
(10328, 101, 37, '95.73', 10),
(10328, 104, 33, '117.46', 11),
(10328, 105, 33, '71.20', 13),
(10328, 108, 39, '69.59', 12),
(10329, 1, 42, '80.39', 1),
(10329, 3, 20, '109.42', 2),
(10329, 4, 26, '164.61', 3),
(10329, 7, 41, '182.90', 5),
(10329, 10, 24, '128.03', 6),
(10329, 12, 46, '117.44', 13),
(10329, 14, 33, '74.21', 14),
(10329, 16, 39, '102.49', 15),
(10329, 24, 29, '66.22', 9),
(10329, 32, 38, '55.72', 12),
(10329, 43, 38, '65.13', 10),
(10329, 58, 30, '104.81', 7),
(10329, 62, 37, '71.60', 4),
(10329, 86, 45, '80.91', 11),
(10329, 109, 44, '41.22', 8),
(10330, 45, 37, '136.70', 3),
(10330, 47, 29, '59.06', 2),
(10330, 54, 50, '133.92', 4),
(10330, 66, 42, '56.10', 1),
(10331, 18, 46, '120.31', 6),
(10331, 21, 44, '99.55', 14),
(10331, 23, 44, '154.70', 7),
(10331, 25, 30, '135.14', 8),
(10331, 34, 26, '130.68', 10),
(10331, 40, 27, '169.34', 11),
(10331, 46, 26, '132.80', 12),
(10331, 71, 27, '37.00', 13),
(10331, 74, 25, '55.11', 9),
(10331, 78, 21, '139.03', 1),
(10331, 84, 41, '70.33', 2),
(10331, 87, 28, '33.39', 3),
(10331, 92, 32, '100.01', 4),
(10331, 96, 20, '74.04', 5),
(10332, 19, 46, '89.38', 15),
(10332, 20, 27, '51.21', 16),
(10332, 27, 38, '53.88', 9),
(10332, 29, 35, '116.96', 8),
(10332, 33, 24, '138.38', 1),
(10332, 36, 26, '53.09', 17),
(10332, 38, 40, '100.53', 18),
(10332, 50, 50, '92.03', 2),
(10332, 55, 21, '70.56', 3),
(10332, 56, 23, '61.73', 4),
(10332, 59, 20, '47.29', 5),
(10332, 61, 45, '29.87', 6),
(10332, 64, 26, '43.01', 10),
(10332, 67, 39, '84.51', 7),
(10332, 70, 44, '108.04', 11),
(10332, 73, 45, '77.91', 12),
(10332, 76, 31, '94.23', 13),
(10332, 80, 41, '34.47', 14),
(10333, 2, 26, '188.58', 3),
(10333, 9, 33, '121.64', 6),
(10333, 17, 29, '110.84', 7),
(10333, 35, 31, '95.23', 5),
(10333, 44, 46, '95.24', 2),
(10333, 53, 24, '42.26', 8),
(10333, 82, 39, '95.44', 1),
(10333, 90, 33, '62.05', 4),
(10334, 6, 26, '130.01', 2),
(10334, 28, 46, '108.00', 6),
(10334, 30, 34, '52.87', 1),
(10334, 40, 20, '147.33', 3),
(10334, 52, 49, '101.71', 4),
(10334, 65, 42, '117.57', 5),
(10335, 68, 33, '32.88', 2),
(10335, 85, 44, '77.05', 1),
(10335, 88, 40, '49.78', 3),
(10336, 8, 33, '176.63', 10),
(10336, 11, 33, '126.91', 11),
(10336, 13, 49, '141.88', 1),
(10336, 15, 38, '95.99', 3),
(10336, 26, 49, '153.91', 6),
(10336, 39, 48, '135.22', 12),
(10336, 42, 21, '100.84', 7),
(10336, 57, 45, '49.71', 4),
(10336, 81, 31, '113.55', 5),
(10336, 89, 31, '59.03', 9),
(10336, 94, 23, '109.96', 8),
(10336, 103, 46, '94.07', 2),
(10337, 5, 25, '131.92', 8),
(10337, 49, 36, '140.75', 3),
(10337, 51, 29, '76.36', 2),
(10337, 63, 29, '119.20', 4),
(10337, 95, 21, '54.48', 6),
(10337, 99, 36, '73.62', 9),
(10337, 106, 31, '84.14', 1),
(10337, 107, 36, '83.42', 7),
(10337, 110, 42, '49.14', 5),
(10338, 22, 41, '137.19', 1),
(10338, 37, 28, '80.86', 3),
(10338, 48, 45, '93.17', 2),
(10339, 3, 40, '117.75', 4),
(10339, 4, 39, '178.17', 3),
(10339, 31, 27, '79.41', 2),
(10339, 32, 30, '48.46', 1),
(10339, 58, 27, '96.92', 10),
(10339, 60, 21, '106.14', 7),
(10339, 69, 55, '67.82', 12),
(10339, 72, 55, '73.46', 13),
(10339, 75, 29, '57.86', 14),
(10339, 77, 42, '72.96', 16),
(10339, 79, 45, '57.32', 11),
(10339, 97, 22, '53.34', 5),
(10339, 100, 55, '86.90', 15),
(10339, 102, 50, '62.16', 9),
(10339, 108, 50, '66.63', 8),
(10339, 109, 27, '49.66', 6),
(10340, 62, 55, '62.46', 8),
(10340, 83, 40, '63.76', 1),
(10340, 86, 55, '95.89', 2),
(10340, 91, 39, '67.41', 3),
(10340, 93, 40, '37.09', 4),
(10340, 98, 30, '73.99', 5),
(10340, 101, 55, '81.77', 7),
(10340, 104, 29, '98.48', 6),
(10341, 1, 41, '84.22', 9),
(10341, 7, 45, '192.62', 2),
(10341, 10, 55, '120.50', 8),
(10341, 12, 44, '111.57', 1),
(10341, 14, 36, '77.41', 10),
(10341, 16, 55, '109.40', 7),
(10341, 66, 32, '63.03', 6),
(10341, 92, 31, '95.93', 4),
(10341, 96, 38, '78.11', 3),
(10341, 105, 34, '70.40', 5),
(10342, 18, 40, '118.89', 2),
(10342, 24, 55, '63.14', 1),
(10342, 25, 22, '115.22', 3),
(10342, 40, 30, '167.65', 4),
(10342, 43, 25, '76.39', 5),
(10342, 45, 55, '136.70', 7),
(10342, 47, 26, '57.82', 8),
(10342, 54, 38, '124.99', 11),
(10342, 71, 39, '30.59', 9),
(10342, 74, 48, '60.01', 10),
(10342, 78, 42, '112.34', 6),
(10343, 21, 36, '109.51', 4),
(10343, 34, 25, '118.80', 3),
(10343, 46, 44, '127.15', 2),
(10343, 59, 27, '44.78', 6),
(10343, 84, 30, '76.80', 1),
(10343, 87, 29, '37.41', 5),
(10344, 23, 45, '168.30', 1),
(10344, 27, 40, '49.04', 2),
(10344, 29, 30, '118.23', 3),
(10344, 50, 21, '80.99', 4),
(10344, 55, 26, '68.42', 5),
(10344, 56, 29, '61.00', 7),
(10344, 61, 20, '27.88', 6),
(10345, 64, 43, '38.98', 1),
(10346, 19, 42, '88.36', 3),
(10346, 67, 25, '87.24', 1),
(10346, 70, 24, '117.44', 5),
(10346, 73, 24, '80.47', 2),
(10346, 76, 26, '103.87', 6),
(10346, 80, 22, '38.57', 4),
(10347, 2, 30, '188.58', 1),
(10347, 6, 27, '132.97', 2),
(10347, 9, 29, '132.57', 3),
(10347, 17, 42, '113.17', 5),
(10347, 20, 21, '46.36', 7),
(10347, 30, 50, '51.05', 8),
(10347, 33, 21, '136.69', 6),
(10347, 35, 48, '84.09', 9),
(10347, 36, 34, '60.59', 10),
(10347, 38, 45, '95.30', 11),
(10347, 44, 26, '84.33', 12),
(10347, 52, 45, '115.03', 4),
(10348, 8, 48, '207.80', 8),
(10348, 11, 47, '122.37', 4),
(10348, 53, 29, '43.77', 6),
(10348, 65, 37, '107.34', 1),
(10348, 82, 39, '82.78', 2),
(10348, 85, 42, '90.53', 3),
(10348, 90, 31, '62.70', 5),
(10348, 103, 32, '100.14', 7),
(10349, 13, 26, '166.10', 10),
(10349, 15, 48, '114.95', 9),
(10349, 26, 38, '142.45', 8),
(10349, 28, 38, '117.82', 7),
(10349, 40, 48, '164.26', 6),
(10349, 49, 34, '140.75', 5),
(10349, 57, 48, '50.29', 4),
(10349, 68, 36, '31.47', 3),
(10349, 81, 23, '111.18', 2),
(10349, 88, 33, '44.37', 1),
(10350, 5, 26, '110.16', 5),
(10350, 37, 43, '84.30', 6),
(10350, 39, 44, '135.22', 1),
(10350, 42, 41, '94.79', 2),
(10350, 51, 30, '70.22', 3),
(10350, 63, 34, '98.31', 7),
(10350, 72, 30, '86.74', 9),
(10350, 77, 25, '77.15', 10),
(10350, 89, 27, '61.52', 14),
(10350, 94, 31, '104.18', 8),
(10350, 95, 44, '56.82', 17),
(10350, 97, 46, '56.00', 11),
(10350, 99, 28, '76.22', 4),
(10350, 102, 29, '68.67', 12),
(10350, 106, 31, '87.15', 13),
(10350, 107, 25, '97.32', 16),
(10350, 110, 20, '48.05', 15),
(10351, 22, 39, '143.50', 1),
(10351, 48, 20, '104.81', 2),
(10351, 69, 25, '64.40', 5),
(10351, 75, 38, '53.92', 4),
(10351, 79, 34, '68.24', 3),
(10352, 100, 23, '75.13', 3),
(10352, 101, 49, '87.75', 2),
(10352, 108, 22, '62.19', 1),
(10352, 109, 49, '46.18', 4),
(10353, 31, 27, '71.81', 1),
(10353, 60, 28, '107.23', 2),
(10353, 83, 35, '69.55', 3),
(10353, 86, 46, '86.90', 5),
(10353, 91, 40, '68.10', 7),
(10353, 93, 40, '35.78', 8),
(10353, 98, 39, '73.07', 9),
(10353, 104, 48, '98.48', 4),
(10353, 105, 43, '74.40', 6),
(10354, 1, 42, '84.22', 6),
(10354, 3, 20, '95.15', 2),
(10354, 4, 42, '178.17', 3),
(10354, 7, 31, '157.60', 9),
(10354, 10, 35, '141.58', 4),
(10354, 12, 29, '98.65', 11),
(10354, 14, 23, '76.61', 12),
(10354, 16, 28, '100.19', 13),
(10354, 24, 21, '76.23', 8),
(10354, 32, 28, '49.06', 10),
(10354, 43, 36, '69.15', 7),
(10354, 58, 21, '96.92', 5),
(10354, 62, 28, '62.46', 1),
(10355, 45, 23, '117.59', 7),
(10355, 47, 31, '60.30', 1),
(10355, 54, 25, '124.99', 2),
(10355, 66, 41, '56.10', 3),
(10355, 71, 36, '37.38', 4),
(10355, 74, 44, '60.62', 6),
(10355, 78, 32, '137.62', 8),
(10355, 84, 28, '75.18', 9),
(10355, 87, 38, '32.99', 10),
(10355, 92, 40, '93.89', 5),
(10356, 18, 43, '120.31', 8),
(10356, 19, 50, '82.19', 9),
(10356, 20, 22, '44.75', 6),
(10356, 25, 27, '130.87', 2),
(10356, 29, 29, '106.79', 3),
(10356, 33, 30, '158.63', 1),
(10356, 61, 48, '31.86', 5),
(10356, 64, 26, '42.11', 7),
(10356, 96, 26, '78.11', 4),
(10357, 2, 32, '199.30', 10),
(10357, 6, 43, '135.92', 9),
(10357, 9, 49, '109.34', 8),
(10357, 17, 39, '112.00', 1),
(10357, 30, 41, '58.95', 7),
(10357, 35, 41, '91.18', 6),
(10357, 36, 49, '59.34', 5),
(10357, 38, 44, '104.72', 4),
(10357, 44, 25, '84.33', 3),
(10357, 52, 28, '105.34', 2),
(10358, 11, 49, '129.93', 5),
(10358, 15, 42, '98.36', 9),
(10358, 26, 20, '142.45', 10),
(10358, 28, 20, '99.41', 11),
(10358, 40, 32, '137.17', 12),
(10358, 49, 25, '117.77', 13),
(10358, 53, 30, '46.29', 8),
(10358, 57, 44, '56.07', 14),
(10358, 65, 41, '127.79', 7),
(10358, 68, 36, '33.59', 4),
(10358, 82, 41, '88.62', 6),
(10358, 85, 41, '82.83', 1),
(10358, 90, 36, '51.71', 2),
(10358, 103, 27, '85.98', 3),
(10359, 5, 48, '122.40', 6),
(10359, 8, 42, '180.79', 8),
(10359, 13, 49, '162.64', 5),
(10359, 81, 22, '108.82', 7),
(10359, 88, 36, '45.45', 3),
(10359, 89, 22, '62.14', 1),
(10359, 94, 46, '99.55', 2),
(10359, 95, 25, '47.45', 4),
(10360, 22, 50, '126.15', 12),
(10360, 31, 41, '68.43', 13),
(10360, 37, 46, '71.40', 14),
(10360, 39, 29, '122.93', 8),
(10360, 42, 29, '94.79', 18),
(10360, 48, 40, '101.64', 15),
(10360, 51, 40, '76.36', 1),
(10360, 60, 22, '106.14', 17),
(10360, 63, 31, '100.77', 2),
(10360, 69, 49, '55.49', 16),
(10360, 72, 36, '70.81', 3),
(10360, 77, 22, '78.83', 4),
(10360, 97, 32, '64.67', 5),
(10360, 99, 26, '86.61', 6),
(10360, 102, 30, '70.11', 7),
(10360, 106, 35, '83.14', 9),
(10360, 107, 31, '92.36', 10),
(10360, 110, 31, '54.05', 11),
(10361, 1, 20, '92.83', 13),
(10361, 3, 26, '114.18', 8),
(10361, 75, 34, '62.46', 6),
(10361, 79, 26, '61.42', 7),
(10361, 83, 25, '68.83', 1),
(10361, 91, 49, '56.41', 2),
(10361, 93, 33, '35.78', 3),
(10361, 98, 20, '88.60', 4),
(10361, 100, 24, '85.99', 14),
(10361, 101, 26, '91.74', 9),
(10361, 104, 44, '107.97', 5),
(10361, 105, 44, '76.80', 10),
(10361, 108, 35, '62.19', 11),
(10361, 109, 23, '47.67', 12),
(10362, 4, 22, '182.04', 4),
(10362, 10, 22, '131.04', 1),
(10362, 32, 23, '53.91', 3),
(10362, 58, 50, '91.29', 2),
(10363, 7, 33, '180.95', 3),
(10363, 12, 34, '106.87', 4),
(10363, 14, 34, '68.63', 5),
(10363, 16, 46, '103.64', 6),
(10363, 24, 22, '61.60', 7),
(10363, 43, 46, '69.15', 10),
(10363, 45, 24, '124.94', 11),
(10363, 47, 32, '52.22', 12),
(10363, 54, 28, '123.50', 13),
(10363, 62, 21, '70.08', 8),
(10363, 66, 43, '56.10', 14),
(10363, 74, 21, '52.05', 15),
(10363, 78, 31, '113.75', 1),
(10363, 84, 43, '75.99', 9),
(10363, 86, 50, '92.90', 2),
(10364, 87, 48, '38.22', 1),
(10365, 18, 30, '116.06', 1),
(10365, 92, 22, '82.66', 3),
(10365, 96, 44, '68.34', 2),
(10366, 25, 34, '116.65', 3),
(10366, 34, 49, '105.60', 2),
(10366, 40, 34, '154.10', 1),
(10367, 21, 49, '105.77', 1),
(10367, 23, 37, '144.50', 3),
(10367, 27, 45, '50.25', 4),
(10367, 29, 27, '124.59', 5),
(10367, 33, 32, '140.06', 7),
(10367, 46, 46, '131.39', 6),
(10367, 50, 43, '77.31', 8),
(10367, 55, 44, '66.99', 9),
(10367, 56, 21, '72.76', 10),
(10367, 59, 38, '50.31', 11),
(10367, 61, 23, '29.54', 13),
(10367, 64, 28, '43.01', 12),
(10367, 71, 36, '36.25', 2),
(10368, 67, 40, '73.60', 2),
(10368, 70, 31, '115.09', 5),
(10368, 73, 46, '83.04', 1),
(10368, 76, 20, '93.16', 4),
(10368, 80, 46, '36.52', 3),
(10369, 2, 41, '195.01', 2),
(10369, 19, 44, '89.38', 8),
(10369, 20, 32, '46.36', 7),
(10369, 35, 42, '100.30', 1),
(10369, 36, 28, '51.84', 6),
(10369, 38, 21, '90.06', 5),
(10369, 44, 45, '80.36', 4),
(10369, 82, 40, '93.49', 3),
(10370, 6, 35, '128.53', 4),
(10370, 9, 49, '128.47', 8),
(10370, 17, 27, '100.34', 1),
(10370, 28, 22, '101.87', 5),
(10370, 30, 22, '60.16', 7),
(10370, 40, 27, '167.65', 9),
(10370, 52, 29, '105.34', 6),
(10370, 53, 20, '41.76', 2),
(10370, 90, 25, '63.99', 3),
(10371, 8, 32, '178.71', 6),
(10371, 15, 49, '104.28', 4),
(10371, 26, 25, '160.46', 7),
(10371, 57, 25, '53.75', 12),
(10371, 65, 20, '126.51', 5),
(10371, 68, 45, '35.01', 8),
(10371, 81, 28, '95.81', 9),
(10371, 85, 26, '82.83', 1),
(10371, 88, 20, '44.37', 2),
(10371, 89, 30, '53.44', 11),
(10371, 94, 48, '97.23', 10),
(10371, 103, 34, '83.95', 3),
(10372, 11, 40, '146.55', 4),
(10372, 13, 34, '140.15', 1),
(10372, 39, 28, '131.13', 3),
(10372, 42, 25, '91.76', 5),
(10372, 49, 48, '119.20', 6),
(10372, 51, 41, '78.99', 7),
(10372, 63, 37, '102.00', 8),
(10372, 95, 24, '56.82', 9),
(10372, 99, 44, '74.48', 2),
(10373, 5, 39, '118.32', 3),
(10373, 22, 28, '143.50', 4),
(10373, 37, 22, '75.70', 5),
(10373, 48, 50, '99.52', 6),
(10373, 69, 38, '58.92', 7),
(10373, 72, 33, '82.31', 12),
(10373, 75, 46, '53.92', 11),
(10373, 77, 23, '83.86', 10),
(10373, 79, 39, '62.10', 13),
(10373, 97, 44, '58.00', 14),
(10373, 100, 32, '76.94', 15),
(10373, 102, 41, '69.39', 16),
(10373, 106, 34, '94.16', 2),
(10373, 107, 37, '83.42', 8),
(10373, 108, 45, '68.11', 17),
(10373, 109, 25, '44.20', 9),
(10373, 110, 29, '48.05', 1),
(10374, 3, 39, '115.37', 5),
(10374, 4, 22, '158.80', 1),
(10374, 31, 42, '75.19', 2),
(10374, 32, 22, '48.46', 4),
(10374, 58, 38, '112.70', 6),
(10374, 60, 46, '107.23', 3),
(10375, 1, 21, '76.56', 12),
(10375, 7, 45, '184.84', 7),
(10375, 10, 49, '150.62', 13),
(10375, 62, 23, '67.03', 9),
(10375, 66, 20, '60.26', 14),
(10375, 83, 43, '60.13', 2),
(10375, 86, 37, '87.90', 3),
(10375, 91, 44, '59.85', 4),
(10375, 92, 41, '96.95', 15),
(10375, 93, 49, '36.22', 5),
(10375, 96, 49, '69.16', 8),
(10375, 98, 37, '86.77', 6),
(10375, 101, 33, '94.73', 1),
(10375, 104, 25, '98.48', 10),
(10375, 105, 44, '69.60', 11),
(10376, 12, 35, '98.65', 1),
(10377, 14, 24, '65.44', 5),
(10377, 16, 50, '112.86', 1),
(10377, 18, 35, '124.56', 2),
(10377, 24, 31, '61.60', 4),
(10377, 25, 36, '125.18', 6),
(10377, 40, 39, '143.94', 3),
(10378, 21, 34, '121.95', 5),
(10378, 43, 22, '66.74', 4),
(10378, 45, 43, '146.99', 10),
(10378, 47, 28, '60.30', 9),
(10378, 54, 49, '122.02', 8),
(10378, 71, 41, '30.59', 7),
(10378, 74, 46, '52.66', 6),
(10378, 78, 33, '129.20', 3),
(10378, 84, 41, '80.84', 2),
(10378, 87, 40, '35.80', 1),
(10379, 23, 39, '156.40', 2),
(10379, 27, 27, '50.85', 1),
(10379, 34, 29, '113.52', 5),
(10379, 46, 32, '134.22', 4),
(10379, 59, 32, '48.80', 3),
(10380, 19, 27, '88.36', 13),
(10380, 29, 40, '119.50', 10),
(10380, 33, 21, '156.94', 8),
(10380, 50, 32, '78.23', 1),
(10380, 55, 24, '66.99', 2),
(10380, 56, 34, '66.88', 3),
(10380, 61, 32, '29.87', 4),
(10380, 64, 27, '37.63', 5),
(10380, 67, 36, '77.24', 6),
(10380, 70, 44, '111.57', 7),
(10380, 73, 44, '77.05', 9),
(10380, 76, 34, '91.02', 11),
(10380, 80, 43, '32.82', 12),
(10381, 2, 36, '182.16', 3),
(10381, 6, 37, '138.88', 6),
(10381, 9, 20, '132.57', 1),
(10381, 17, 48, '114.34', 2),
(10381, 20, 25, '49.60', 9),
(10381, 30, 35, '60.77', 7),
(10381, 35, 41, '100.30', 8),
(10381, 36, 40, '51.22', 4),
(10381, 38, 35, '93.20', 5),
(10382, 8, 34, '166.24', 10),
(10382, 11, 37, '145.04', 11),
(10382, 13, 34, '143.61', 12),
(10382, 15, 32, '103.10', 13),
(10382, 26, 25, '160.46', 5),
(10382, 44, 50, '84.33', 7),
(10382, 52, 39, '115.03', 1),
(10382, 53, 39, '46.29', 2),
(10382, 65, 20, '120.12', 3),
(10382, 82, 33, '97.39', 4),
(10382, 85, 26, '85.72', 6),
(10382, 90, 48, '57.53', 8),
(10382, 103, 34, '101.15', 9),
(10383, 28, 27, '119.05', 11),
(10383, 39, 24, '125.66', 9),
(10383, 40, 47, '155.79', 6),
(10383, 42, 26, '83.70', 12),
(10383, 49, 38, '137.88', 1),
(10383, 51, 28, '77.24', 7),
(10383, 57, 22, '52.60', 2),
(10383, 68, 40, '33.24', 3),
(10383, 81, 21, '117.10', 4),
(10383, 88, 32, '53.57', 5),
(10383, 89, 44, '55.93', 8),
(10383, 94, 29, '94.92', 13),
(10383, 95, 38, '48.62', 10),
(10384, 5, 34, '129.20', 4),
(10384, 63, 28, '114.29', 3),
(10384, 72, 43, '71.69', 2),
(10384, 99, 49, '71.02', 1),
(10385, 77, 37, '78.83', 2),
(10385, 97, 25, '62.00', 1),
(10386, 22, 25, '130.88', 7),
(10386, 31, 21, '72.65', 18),
(10386, 37, 37, '73.12', 5),
(10386, 48, 22, '100.58', 6),
(10386, 60, 33, '101.76', 11),
(10386, 69, 39, '56.86', 1),
(10386, 75, 35, '54.57', 9),
(10386, 79, 41, '55.96', 12),
(10386, 83, 50, '71.73', 8),
(10386, 100, 29, '85.09', 13),
(10386, 101, 37, '90.75', 14),
(10386, 102, 37, '67.22', 10),
(10386, 105, 32, '68.00', 17),
(10386, 106, 45, '83.14', 2),
(10386, 107, 30, '80.44', 3),
(10386, 108, 44, '59.22', 15),
(10386, 109, 50, '47.67', 16),
(10386, 110, 43, '52.42', 4),
(10387, 86, 44, '79.91', 1),
(10388, 1, 42, '80.39', 4),
(10388, 3, 50, '118.94', 5),
(10388, 4, 21, '156.86', 7),
(10388, 10, 44, '125.01', 6),
(10388, 91, 35, '58.47', 8),
(10388, 93, 27, '41.02', 1),
(10388, 98, 46, '74.90', 2),
(10388, 104, 50, '111.53', 3),
(10389, 7, 26, '182.90', 4),
(10389, 12, 25, '95.13', 6),
(10389, 14, 36, '76.61', 7),
(10389, 16, 47, '102.49', 8),
(10389, 24, 49, '63.91', 3),
(10389, 32, 39, '52.09', 5),
(10389, 58, 45, '112.70', 1),
(10389, 62, 49, '61.70', 2),
(10390, 18, 36, '117.48', 14),
(10390, 25, 34, '132.29', 15),
(10390, 29, 31, '102.98', 16),
(10390, 33, 26, '162.00', 7),
(10390, 43, 40, '75.59', 9),
(10390, 45, 50, '135.23', 1),
(10390, 47, 36, '54.09', 2),
(10390, 54, 49, '122.02', 3),
(10390, 66, 35, '67.87', 4),
(10390, 71, 37, '35.87', 5),
(10390, 74, 46, '51.43', 6),
(10390, 78, 45, '134.81', 8),
(10390, 84, 30, '66.29', 10),
(10390, 87, 41, '39.02', 11),
(10390, 92, 45, '101.03', 12),
(10390, 96, 22, '81.36', 13),
(10391, 2, 24, '195.01', 4),
(10391, 6, 37, '121.15', 7),
(10391, 9, 39, '110.70', 9),
(10391, 17, 29, '114.34', 10),
(10391, 19, 35, '102.74', 2),
(10391, 20, 42, '47.44', 3),
(10391, 30, 44, '57.73', 5),
(10391, 35, 32, '99.28', 6),
(10391, 61, 33, '26.55', 8),
(10391, 64, 24, '36.29', 1),
(10392, 36, 37, '61.21', 3),
(10392, 38, 29, '103.67', 2),
(10392, 44, 36, '98.22', 1),
(10393, 11, 35, '145.04', 8),
(10393, 15, 32, '99.54', 10),
(10393, 26, 20, '137.53', 11),
(10393, 28, 38, '104.32', 7),
(10393, 52, 30, '106.55', 9),
(10393, 53, 44, '41.76', 1),
(10393, 65, 33, '112.46', 2),
(10393, 82, 33, '88.62', 3),
(10393, 85, 38, '84.75', 4),
(10393, 90, 31, '63.35', 5),
(10393, 103, 21, '83.95', 6),
(10394, 40, 22, '135.47', 5),
(10394, 49, 37, '124.95', 1),
(10394, 57, 31, '53.18', 2),
(10394, 68, 46, '35.36', 6),
(10394, 81, 37, '104.09', 7),
(10394, 88, 36, '47.08', 3),
(10394, 89, 30, '55.93', 4),
(10395, 5, 32, '125.12', 2),
(10395, 8, 33, '205.72', 1),
(10395, 94, 46, '98.39', 4),
(10395, 95, 45, '57.99', 3),
(10396, 13, 33, '155.72', 3),
(10396, 39, 33, '129.76', 2),
(10396, 42, 24, '91.76', 4),
(10396, 51, 45, '83.38', 5),
(10396, 63, 49, '100.77', 6),
(10396, 72, 27, '77.00', 7),
(10396, 77, 37, '77.99', 8),
(10396, 97, 39, '62.00', 1),
(10397, 99, 32, '69.29', 5),
(10397, 102, 22, '62.88', 4),
(10397, 106, 48, '86.15', 3),
(10397, 107, 36, '80.44', 2),
(10397, 110, 34, '52.96', 1),
(10398, 22, 33, '130.88', 11),
(10398, 31, 34, '82.79', 15),
(10398, 37, 28, '70.54', 18),
(10398, 48, 45, '92.11', 17),
(10398, 60, 43, '100.67', 16),
(10398, 69, 28, '60.29', 3),
(10398, 75, 34, '61.15', 13),
(10398, 79, 41, '56.64', 2),
(10398, 83, 45, '65.93', 14),
(10398, 91, 22, '60.54', 4),
(10398, 93, 49, '38.84', 5),
(10398, 98, 47, '78.55', 6),
(10398, 100, 36, '75.13', 7),
(10398, 101, 22, '98.72', 8),
(10398, 104, 23, '102.04', 9),
(10398, 105, 29, '76.80', 10),
(10398, 108, 36, '62.19', 12),
(10398, 109, 34, '41.22', 1),
(10399, 1, 40, '77.52', 8),
(10399, 3, 51, '99.91', 7),
(10399, 4, 22, '156.86', 6),
(10399, 10, 29, '123.51', 5),
(10399, 32, 30, '51.48', 4),
(10399, 58, 57, '104.81', 3),
(10399, 62, 58, '75.41', 2),
(10399, 86, 32, '97.89', 1),
(10400, 5, 64, '134.64', 9),
(10400, 22, 34, '129.31', 1),
(10400, 37, 30, '74.84', 7),
(10400, 48, 58, '88.93', 6),
(10400, 69, 24, '55.49', 2),
(10400, 75, 38, '59.18', 3),
(10400, 77, 42, '74.64', 8),
(10400, 100, 46, '82.37', 5),
(10400, 109, 20, '41.71', 4),
(10401, 31, 42, '75.19', 3),
(10401, 60, 38, '87.54', 5),
(10401, 79, 64, '59.37', 12),
(10401, 83, 52, '65.93', 4),
(10401, 86, 49, '81.91', 1),
(10401, 91, 62, '62.60', 6),
(10401, 93, 56, '41.46', 7),
(10401, 98, 11, '77.64', 8),
(10401, 101, 85, '98.72', 10),
(10401, 104, 21, '96.11', 2),
(10401, 105, 77, '73.60', 9),
(10401, 108, 40, '66.63', 11),
(10402, 3, 45, '118.94', 1),
(10402, 32, 55, '58.15', 2),
(10402, 62, 59, '61.70', 3),
(10403, 1, 24, '85.17', 7),
(10403, 4, 66, '174.29', 9),
(10403, 10, 66, '122.00', 6),
(10403, 47, 36, '55.33', 1),
(10403, 58, 46, '109.32', 8),
(10403, 66, 27, '57.49', 4),
(10403, 87, 30, '35.80', 2),
(10403, 92, 45, '88.78', 5),
(10403, 96, 31, '65.09', 3),
(10404, 7, 64, '163.44', 3),
(10404, 12, 43, '102.17', 1),
(10404, 14, 77, '67.03', 4),
(10404, 43, 90, '67.54', 6),
(10404, 45, 28, '127.88', 5),
(10404, 54, 48, '124.99', 8),
(10404, 74, 49, '53.27', 2),
(10404, 84, 48, '65.48', 7),
(10405, 16, 97, '115.16', 5),
(10405, 24, 61, '72.38', 4),
(10405, 40, 55, '147.33', 1),
(10405, 71, 47, '37.38', 2),
(10405, 78, 76, '127.79', 3),
(10406, 18, 61, '124.56', 3),
(10406, 25, 48, '133.72', 2),
(10406, 46, 65, '117.26', 1),
(10407, 21, 59, '114.48', 11),
(10407, 23, 76, '141.10', 2),
(10407, 27, 42, '58.12', 1),
(10407, 34, 41, '132.00', 12),
(10407, 50, 6, '91.11', 3),
(10407, 55, 66, '64.14', 4),
(10407, 56, 26, '68.35', 8),
(10407, 59, 64, '45.78', 10),
(10407, 67, 76, '81.78', 6),
(10407, 70, 59, '98.65', 5),
(10407, 73, 13, '77.05', 7),
(10407, 76, 43, '101.73', 9),
(10408, 80, 15, '41.03', 1),
(10409, 29, 6, '104.25', 2),
(10409, 61, 61, '27.88', 1),
(10410, 19, 65, '99.66', 7),
(10410, 20, 44, '51.21', 6),
(10410, 33, 56, '145.13', 8),
(10410, 35, 47, '93.21', 1),
(10410, 36, 53, '49.97', 3),
(10410, 38, 34, '84.82', 2),
(10410, 44, 44, '81.35', 5),
(10410, 64, 31, '42.56', 9),
(10410, 82, 50, '95.44', 4),
(10411, 2, 23, '205.73', 9),
(10411, 6, 27, '144.79', 2),
(10411, 9, 40, '110.70', 6),
(10411, 17, 27, '109.67', 8),
(10411, 52, 46, '106.55', 3),
(10411, 53, 35, '41.25', 7),
(10411, 85, 26, '78.01', 1),
(10411, 90, 27, '60.76', 5),
(10411, 103, 34, '89.01', 4),
(10412, 15, 54, '100.73', 5),
(10412, 26, 41, '150.63', 4),
(10412, 28, 56, '120.28', 8),
(10412, 30, 47, '49.83', 11),
(10412, 40, 60, '157.49', 9),
(10412, 57, 21, '47.40', 2),
(10412, 65, 70, '109.90', 10),
(10412, 68, 30, '32.88', 6),
(10412, 81, 31, '108.82', 1),
(10412, 88, 19, '50.86', 7),
(10412, 94, 26, '105.33', 3),
(10413, 8, 36, '201.57', 2),
(10413, 11, 47, '145.04', 3),
(10413, 13, 22, '173.02', 1),
(10413, 49, 49, '133.57', 5),
(10413, 89, 24, '56.55', 6),
(10413, 95, 51, '53.31', 4),
(10414, 5, 49, '114.24', 3),
(10414, 37, 44, '77.42', 1),
(10414, 39, 41, '128.39', 12),
(10414, 42, 48, '85.71', 14),
(10414, 51, 56, '83.38', 11),
(10414, 63, 43, '108.14', 10),
(10414, 72, 60, '72.58', 5),
(10414, 77, 51, '72.96', 2),
(10414, 97, 37, '62.00', 6),
(10414, 99, 34, '74.48', 13),
(10414, 102, 31, '61.44', 4),
(10414, 106, 28, '84.14', 7),
(10414, 107, 40, '84.41', 8),
(10414, 110, 47, '54.60', 9),
(10415, 48, 51, '86.81', 5),
(10415, 69, 21, '60.97', 1),
(10415, 75, 18, '59.83', 2),
(10415, 100, 32, '73.32', 4),
(10415, 109, 42, '43.20', 3),
(10416, 22, 24, '129.31', 14),
(10416, 31, 15, '70.96', 4),
(10416, 60, 47, '90.82', 6),
(10416, 62, 32, '62.46', 1),
(10416, 79, 18, '64.83', 13),
(10416, 83, 48, '70.28', 5),
(10416, 86, 45, '86.90', 2),
(10416, 91, 26, '68.10', 7),
(10416, 93, 37, '39.71', 8),
(10416, 98, 23, '88.60', 9),
(10416, 101, 22, '84.76', 11),
(10416, 104, 41, '98.48', 3),
(10416, 105, 39, '65.60', 10),
(10416, 108, 43, '63.67', 12),
(10417, 1, 66, '79.43', 2),
(10417, 3, 45, '116.56', 5),
(10417, 4, 56, '162.67', 4),
(10417, 10, 21, '144.60', 1),
(10417, 32, 36, '58.75', 6),
(10417, 58, 35, '109.32', 3),
(10418, 43, 16, '70.76', 2),
(10418, 45, 27, '139.64', 1),
(10418, 47, 33, '56.57', 5),
(10418, 54, 28, '120.53', 4),
(10418, 66, 52, '64.41', 8),
(10418, 84, 10, '66.29', 3),
(10418, 87, 43, '36.61', 6),
(10418, 92, 50, '100.01', 9),
(10418, 96, 40, '72.41', 7),
(10419, 7, 12, '182.90', 13),
(10419, 12, 10, '111.57', 11),
(10419, 14, 34, '64.64', 14),
(10419, 16, 32, '99.04', 10),
(10419, 18, 38, '117.48', 5),
(10419, 21, 37, '100.80', 1),
(10419, 24, 39, '67.76', 9),
(10419, 25, 34, '133.72', 4),
(10419, 34, 55, '116.16', 2),
(10419, 40, 35, '165.95', 6),
(10419, 46, 43, '114.44', 3),
(10419, 71, 15, '32.10', 7),
(10419, 74, 55, '52.66', 12),
(10419, 78, 70, '112.34', 8),
(10420, 23, 37, '153.00', 5),
(10420, 27, 36, '52.06', 4),
(10420, 29, 45, '116.96', 2),
(10420, 50, 66, '73.62', 6),
(10420, 55, 36, '68.42', 7),
(10420, 56, 60, '60.26', 11),
(10420, 59, 37, '48.80', 13),
(10420, 61, 45, '32.19', 1),
(10420, 67, 39, '76.33', 9),
(10420, 70, 55, '115.09', 8),
(10420, 73, 35, '77.05', 10),
(10420, 76, 26, '104.94', 12),
(10420, 80, 15, '35.29', 3),
(10421, 33, 35, '167.06', 1),
(10421, 64, 40, '44.80', 2),
(10422, 19, 51, '91.44', 2),
(10422, 20, 25, '47.44', 1),
(10423, 35, 10, '89.15', 1),
(10423, 36, 31, '56.21', 3),
(10423, 38, 21, '98.44', 2),
(10423, 44, 21, '80.36', 5),
(10423, 82, 28, '78.89', 4),
(10424, 2, 50, '201.44', 6),
(10424, 9, 49, '121.64', 3),
(10424, 17, 54, '108.50', 5),
(10424, 53, 26, '40.25', 4),
(10424, 90, 44, '54.94', 2),
(10424, 103, 46, '85.98', 1),
(10425, 6, 38, '131.49', 12),
(10425, 15, 33, '95.99', 4),
(10425, 26, 28, '147.36', 3),
(10425, 28, 38, '117.82', 7),
(10425, 30, 19, '48.62', 10),
(10425, 40, 28, '140.55', 8),
(10425, 52, 38, '107.76', 13),
(10425, 57, 55, '53.75', 1),
(10425, 65, 49, '127.79', 9),
(10425, 68, 31, '31.82', 5),
(10425, 85, 41, '83.79', 11),
(10425, 88, 11, '50.32', 6),
(10425, 94, 18, '94.92', 2) ON CONFLICT ("order_id", "product_id") DO NOTHING;
/* Data for the table "payment" */
insert into "payment"("customer_number", "check_number", "payment_date", "invoice_amount", "caching_date") values
(103, 'HQ336336', '2004-10-19', '6066.78', '2004-10-19'),
(103, 'JM555205', '2003-06-05', '14571.44', '2003-06-05'),
(103, 'OM314933', '2004-12-18', '1676.14', '2004-12-18'),
(112, 'BO864823', '2004-12-17', '14191.12', '2004-12-17'),
(112, 'HQ55022', '2003-06-06', '32641.98', '2003-06-06'),
(112, 'ND748579', '2004-08-20', '33347.88', '2004-08-20'),
(114, 'GG31455', '2003-05-20', '45864.03', '2003-05-20'),
(114, 'MA765515', '2004-12-15', '82261.22', '2004-12-15'),
(114, 'NP603840', '2003-05-31', '7565.08', '2003-05-31'),
(114, 'NR27552', '2004-03-10', '44894.74', '2004-03-10'),
(119, 'DB933704', '2004-11-14', '19501.82', '2004-11-14'),
(119, 'LN373447', '2004-08-08', '47924.19', '2004-08-08'),
(119, 'NG94694', '2005-02-22', '49523.67', '2005-02-22'),
(121, 'DB889831', '2003-02-16', '50218.95', '2003-02-16'),
(121, 'FD317790', '2003-10-28', '1491.38', '2003-10-28'),
(121, 'KI831359', '2004-11-04', '17876.32', '2004-11-04'),
(121, 'MA302151', '2004-11-28', '34638.14', '2004-11-28'),
(124, 'AE215433', '2005-03-05', '101244.59', '2005-03-05'),
(124, 'BG255406', '2004-08-28', '85410.87', '2004-08-28'),
(124, 'CQ287967', '2003-04-11', '11044.30', '2003-04-11'),
(124, 'ET64396', '2005-04-16', '83598.04', '2005-04-16'),
(124, 'HI366474', '2004-12-27', '47142.70', '2004-12-27'),
(124, 'HR86578', '2004-11-02', '55639.66', '2004-11-02'),
(124, 'KI131716', '2003-08-15', '111654.40', '2003-08-15'),
(124, 'LF217299', '2004-03-26', '43369.30', '2004-03-26'),
(124, 'NT141748', '2003-11-25', '45084.38', '2003-11-25'),
(128, 'DI925118', '2003-01-28', '10549.01', '2003-01-28'),
(128, 'FA465482', '2003-10-18', '24101.81', '2003-10-18'),
(128, 'FH668230', '2004-03-24', '33820.62', '2004-03-24'),
(128, 'IP383901', '2004-11-18', '7466.32', '2004-11-18'),
(129, 'DM826140', '2004-12-08', '26248.78', '2004-12-08'),
(129, 'ID449593', '2003-12-11', '23923.93', '2003-12-11'),
(129, 'PI42991', '2003-04-09', '16537.85', '2003-04-09'),
(131, 'CL442705', '2003-03-12', '22292.62', '2003-03-12'),
(131, 'MA724562', '2004-12-02', '50025.35', '2004-12-02'),
(131, 'NB445135', '2004-09-11', '35321.97', '2004-09-11'),
(141, 'AU364101', '2003-07-19', '36251.03', '2003-07-19'),
(141, 'DB583216', '2004-11-01', '36140.38', '2004-11-01'),
(141, 'DL460618', '2005-05-19', '46895.48', '2005-05-19'),
(141, 'HJ32686', '2004-01-30', '59830.55', '2004-01-30'),
(141, 'ID10962', '2004-12-31', '116208.40', '2004-12-31'),
(141, 'IN446258', '2005-03-25', '65071.26', '2005-03-25'),
(141, 'JE105477', '2005-03-18', '120166.58', '2005-03-18'),
(141, 'JN355280', '2003-10-26', '49539.37', '2003-10-26'),
(141, 'JN722010', '2003-02-25', '40206.20', '2003-02-25'),
(141, 'KT52578', '2003-12-09', '63843.55', '2003-12-09'),
(141, 'MC46946', '2004-07-09', '35420.74', '2004-07-09'),
(141, 'MF629602', '2004-08-16', '20009.53', '2004-08-16'),
(141, 'NU627706', '2004-05-17', '26155.91', '2004-05-17'),
(144, 'IR846303', '2004-12-12', '36005.71', '2004-12-12'),
(144, 'LA685678', '2003-04-09', '7674.94', '2003-04-09'),
(145, 'CN328545', '2004-07-03', '4710.73', '2004-07-03'),
(145, 'ED39322', '2004-04-26', '28211.70', '2004-04-26'),
(145, 'HR182688', '2004-12-01', '20564.86', '2004-12-01'),
(145, 'JJ246391', '2003-02-20', '53959.21', '2003-02-20'),
(146, 'FP549817', '2004-03-18', '40978.53', '2004-03-18'),
(146, 'FU793410', '2004-01-16', '49614.72', '2004-01-16'),
(146, 'LJ160635', '2003-12-10', '39712.10', '2003-12-10'),
(148, 'BI507030', '2003-04-22', '44380.15', '2003-04-22'),
(148, 'DD635282', '2004-08-11', '2611.84', '2004-08-11'),
(148, 'KM172879', '2003-12-26', '105743.00', '2003-12-26'),
(148, 'ME497970', '2005-03-27', '3516.04', '2005-03-27'),
(151, 'BF686658', '2003-12-22', '58793.53', '2003-12-22'),
(151, 'GB852215', '2004-07-26', '20314.44', '2004-07-26'),
(151, 'IP568906', '2003-06-18', '58841.35', '2003-06-18'),
(151, 'KI884577', '2004-12-14', '39964.63', '2004-12-14'),
(157, 'HI618861', '2004-11-19', '35152.12', '2004-11-19'),
(157, 'NN711988', '2004-09-07', '63357.13', '2004-09-07'),
(161, 'BR352384', '2004-11-14', '2434.25', '2004-11-14'),
(161, 'BR478494', '2003-11-18', '50743.65', '2003-11-18'),
(161, 'KG644125', '2005-02-02', '12692.19', '2005-02-02'),
(161, 'NI908214', '2003-08-05', '38675.13', '2003-08-05'),
(166, 'BQ327613', '2004-09-16', '38785.48', '2004-09-16'),
(166, 'DC979307', '2004-07-07', '44160.92', '2004-07-07'),
(166, 'LA318629', '2004-02-28', '22474.17', '2004-02-28'),
(167, 'ED743615', '2004-09-19', '12538.01', '2004-09-19'),
(167, 'GN228846', '2003-12-03', '85024.46', '2003-12-03'),
(171, 'GB878038', '2004-03-15', '18997.89', '2004-03-15'),
(171, 'IL104425', '2003-11-22', '42783.81', '2003-11-22'),
(172, 'AD832091', '2004-09-09', '1960.80', '2004-09-09'),
(172, 'CE51751', '2004-12-04', '51209.58', '2004-12-04'),
(172, 'EH208589', '2003-04-20', '33383.14', '2003-04-20'),
(173, 'GP545698', '2004-05-13', '11843.45', '2004-05-13'),
(173, 'IG462397', '2004-03-29', '20355.24', '2004-03-29'),
(175, 'CITI3434344', '2005-05-19', '28500.78', '2005-05-19'),
(175, 'IO448913', '2003-11-19', '24879.08', '2003-11-19'),
(175, 'PI15215', '2004-07-10', '42044.77', '2004-07-10'),
(177, 'AU750837', '2004-04-17', '15183.63', '2004-04-17'),
(177, 'CI381435', '2004-01-19', '47177.59', '2004-01-19'),
(181, 'CM564612', '2004-04-25', '22602.36', '2004-04-25'),
(181, 'GQ132144', '2003-01-30', '5494.78', '2003-01-30'),
(181, 'OH367219', '2004-11-16', '44400.50', '2004-11-16'),
(186, 'AE192287', '2005-03-10', '23602.90', '2005-03-10'),
(186, 'AK412714', '2003-10-27', '37602.48', '2003-10-27'),
(186, 'KA602407', '2004-10-21', '34341.08', '2004-10-21'),
(187, 'AM968797', '2004-11-03', '52825.29', '2004-11-03'),
(187, 'BQ39062', '2004-12-08', '47159.11', '2004-12-08'),
(187, 'KL124726', '2003-03-27', '48425.69', '2003-03-27'),
(189, 'BO711618', '2004-10-03', '17359.53', '2004-10-03'),
(189, 'NM916675', '2004-03-01', '32538.74', '2004-03-01'),
(198, 'FI192930', '2004-12-06', '9658.74', '2004-12-06'),
(198, 'HQ920205', '2003-07-06', '6036.96', '2003-07-06'),
(198, 'IS946883', '2004-09-21', '5858.56', '2004-09-21'),
(201, 'DP677013', '2003-10-20', '23908.24', '2003-10-20'),
(201, 'OO846801', '2004-06-15', '37258.94', '2004-06-15'),
(202, 'HI358554', '2003-12-18', '36527.61', '2003-12-18'),
(202, 'IQ627690', '2004-11-08', '33594.58', '2004-11-08'),
(204, 'GC697638', '2004-08-13', '51152.86', '2004-08-13'),
(204, 'IS150005', '2004-09-24', '4424.40', '2004-09-24'),
(205, 'GL756480', '2003-12-04', '3879.96', '2003-12-04'),
(205, 'LL562733', '2003-09-05', '50342.74', '2003-09-05'),
(205, 'NM739638', '2005-02-06', '39580.60', '2005-02-06'),
(209, 'BOAF82044', '2005-05-03', '35157.75', '2005-05-03'),
(209, 'ED520529', '2004-06-21', '4632.31', '2004-06-21'),
(209, 'PH785937', '2004-05-04', '36069.26', '2004-05-04'),
(211, 'BJ535230', '2003-12-09', '45480.79', '2003-12-09'),
(216, 'BG407567', '2003-05-09', '3101.40', '2003-05-09'),
(216, 'ML780814', '2004-12-06', '24945.21', '2004-12-06'),
(216, 'MM342086', '2003-12-14', '40473.86', '2003-12-14'),
(219, 'BN17870', '2005-03-02', '3452.75', '2005-03-02'),
(219, 'BR941480', '2003-10-18', '4465.85', '2003-10-18'),
(227, 'MQ413968', '2003-10-31', '36164.46', '2003-10-31'),
(227, 'NU21326', '2004-11-02', '53745.34', '2004-11-02'),
(233, 'BOFA23232', '2005-05-20', '29070.38', '2005-05-20'),
(233, 'II180006', '2004-07-01', '22997.45', '2004-07-01'),
(233, 'JG981190', '2003-11-18', '16909.84', '2003-11-18'),
(239, 'NQ865547', '2004-03-15', '80375.24', '2004-03-15'),
(240, 'IF245157', '2004-11-16', '46788.14', '2004-11-16'),
(240, 'JO719695', '2004-03-28', '24995.61', '2004-03-28'),
(242, 'AF40894', '2003-11-22', '33818.34', '2003-11-22'),
(242, 'HR224331', '2005-06-03', '12432.32', '2005-06-03'),
(242, 'KI744716', '2003-07-21', '14232.70', '2003-07-21'),
(249, 'IJ399820', '2004-09-19', '33924.24', '2004-09-19'),
(249, 'NE404084', '2004-09-04', '48298.99', '2004-09-04'),
(250, 'EQ12267', '2005-05-17', '17928.09', '2005-05-17'),
(250, 'HD284647', '2004-12-30', '26311.63', '2004-12-30'),
(250, 'HN114306', '2003-07-18', '23419.47', '2003-07-18'),
(256, 'EP227123', '2004-02-10', '5759.42', '2004-02-10'),
(256, 'HE84936', '2004-10-22', '53116.99', '2004-10-22'),
(259, 'EU280955', '2004-11-06', '61234.67', '2004-11-06'),
(259, 'GB361972', '2003-12-07', '27988.47', '2003-12-07'),
(260, 'IO164641', '2004-08-30', '37527.58', '2004-08-30'),
(260, 'NH776924', '2004-04-24', '29284.42', '2004-04-24'),
(276, 'EM979878', '2005-02-09', '27083.78', '2005-02-09'),
(276, 'KM841847', '2003-11-13', '38547.19', '2003-11-13'),
(276, 'LE432182', '2003-09-28', '41554.73', '2003-09-28'),
(276, 'OJ819725', '2005-04-30', '29848.52', '2005-04-30'),
(278, 'BJ483870', '2004-12-05', '37654.09', '2004-12-05'),
(278, 'GP636783', '2003-03-02', '52151.81', '2003-03-02'),
(278, 'NI983021', '2003-11-24', '37723.79', '2003-11-24'),
(282, 'IA793562', '2003-08-03', '24013.52', '2003-08-03'),
(282, 'JT819493', '2004-08-02', '35806.73', '2004-08-02'),
(282, 'OD327378', '2005-01-03', '31835.36', '2005-01-03'),
(286, 'DR578578', '2004-10-28', '47411.33', '2004-10-28'),
(286, 'KH910279', '2004-09-05', '43134.04', '2004-09-05'),
(298, 'AJ574927', '2004-03-13', '47375.92', '2004-03-13'),
(298, 'LF501133', '2004-09-18', '61402.00', '2004-09-18'),
(299, 'AD304085', '2003-10-24', '36798.88', '2003-10-24'),
(299, 'NR157385', '2004-09-05', '32260.16', '2004-09-05'),
(311, 'DG336041', '2005-02-15', '46770.52', '2005-02-15'),
(311, 'FA728475', '2003-10-06', '32723.04', '2003-10-06'),
(311, 'NQ966143', '2004-04-25', '16212.59', '2004-04-25'),
(314, 'LQ244073', '2004-08-09', '45352.47', '2004-08-09'),
(314, 'MD809704', '2004-03-03', '16901.38', '2004-03-03'),
(319, 'HL685576', '2004-11-06', '42339.76', '2004-11-06'),
(319, 'OM548174', '2003-12-07', '36092.40', '2003-12-07'),
(320, 'GJ597719', '2005-01-18', '8307.28', '2005-01-18'),
(320, 'HO576374', '2003-08-20', '41016.75', '2003-08-20'),
(320, 'MU817160', '2003-11-24', '52548.49', '2003-11-24'),
(321, 'DJ15149', '2003-11-03', '85559.12', '2003-11-12'),
(321, 'LA556321', '2005-03-15', '46781.66', '2005-03-15'),
(323, 'AL493079', '2005-05-23', '75020.13', '2005-05-23'),
(323, 'ES347491', '2004-06-24', '37281.36', '2004-06-24'),
(323, 'HG738664', '2003-07-05', '2880.00', '2003-07-05'),
(323, 'PQ803830', '2004-12-24', '39440.59', '2004-12-24'),
(324, 'DQ409197', '2004-12-13', '13671.82', '2004-12-13'),
(324, 'FP443161', '2003-07-07', '29429.14', '2003-07-07'),
(324, 'HB150714', '2003-11-23', '37455.77', '2003-11-23'),
(328, 'EN930356', '2004-04-16', '7178.66', '2004-04-16'),
(328, 'NR631421', '2004-05-30', '31102.85', '2004-05-30'),
(333, 'HL209210', '2003-11-15', '23936.53', '2003-11-15'),
(333, 'JK479662', '2003-10-17', '9821.32', '2003-10-17'),
(333, 'NF959653', '2005-03-01', '21432.31', '2005-03-01'),
(334, 'CS435306', '2005-01-27', '45785.34', '2005-01-27'),
(334, 'HH517378', '2003-08-16', '29716.86', '2003-08-16'),
(334, 'LF737277', '2004-05-22', '28394.54', '2004-05-22'),
(339, 'AP286625', '2004-10-24', '23333.06', '2004-10-24'),
(339, 'DA98827', '2003-11-28', '34606.28', '2003-11-28'),
(344, 'AF246722', '2003-11-24', '31428.21', '2003-11-24'),
(344, 'NJ906924', '2004-04-02', '15322.93', '2004-04-02'),
(347, 'DG700707', '2004-01-18', '21053.69', NULL),
(347, 'LG808674', '2003-10-24', '20452.50', '2003-10-24'),
(350, 'BQ602907', '2004-12-11', '18888.31', '2004-12-11'),
(350, 'CI471510', '2003-05-25', '50824.66', '2003-05-25'),
(350, 'OB648482', '2005-01-29', '1834.56', '2005-01-29'),
(353, 'CO351193', '2005-01-10', '49705.52', '2005-01-10'),
(353, 'ED878227', '2003-07-21', '13920.26', '2003-07-21'),
(353, 'GT878649', '2003-05-21', '16700.47', '2003-05-21'),
(353, 'HJ618252', '2005-06-09', '46656.94', '2005-06-09'),
(357, 'AG240323', '2003-12-16', '20220.04', '2003-12-16'),
(357, 'NB291497', '2004-05-15', '36442.34', '2004-05-15'),
(362, 'FP170292', '2004-07-11', '18473.71', '2004-07-11'),
(362, 'OG208861', '2004-09-21', '15059.76', '2004-09-21'),
(363, 'HL575273', '2004-11-17', '50799.69', '2004-11-17'),
(363, 'IS232033', '2003-01-16', '10223.83', '2003-01-16'),
(363, 'PN238558', '2003-12-05', '55425.77', '2003-12-05'),
(379, 'CA762595', '2005-02-12', '28322.83', '2005-02-12'),
(379, 'FR499138', '2003-09-16', '32680.31', '2003-09-16'),
(379, 'GB890854', '2004-08-02', '12530.51', '2004-08-02'),
(381, 'BC726082', '2004-12-03', '12081.52', '2004-12-03'),
(381, 'CC475233', '2003-04-19', '1627.56', '2003-04-19'),
(381, 'GB117430', '2005-02-03', '14379.90', '2005-03-05'),
(381, 'MS154481', '2003-08-22', '1128.20', '2003-08-22'),
(382, 'CC871084', '2003-05-12', '35826.33', '2003-05-12'),
(382, 'CT821147', '2004-08-01', '6419.84', '2004-08-01'),
(382, 'PH29054', '2004-11-27', '42813.83', '2004-11-27'),
(385, 'BN347084', '2003-12-02', '20644.24', '2003-12-02'),
(385, 'CP804873', '2004-11-19', '15822.84', '2004-11-19'),
(385, 'EK785462', '2003-03-09', '51001.22', '2003-03-09'),
(386, 'DO106109', '2003-11-18', '38524.29', '2003-11-18'),
(386, 'HG438769', '2004-07-18', '51619.02', '2004-07-18'),
(398, 'AJ478695', '2005-02-14', '33967.73', '2005-02-14'),
(398, 'DO787644', '2004-06-21', '22037.91', '2004-06-21'),
(398, 'JPMR4544', '2005-05-18', '615.45', '2005-05-18'),
(398, 'KB54275', '2004-11-29', '48927.64', '2004-11-29'),
(406, 'BJMPR4545', '2005-04-23', '12190.85', '2005-04-23'),
(406, 'HJ217687', '2004-01-28', '49165.16', '2004-01-28'),
(406, 'NA197101', '2004-06-17', '25080.96', '2004-06-17'),
(412, 'GH197075', '2004-07-25', '35034.57', '2004-07-25'),
(412, 'PJ434867', '2004-04-14', '31670.37', '2004-04-14'),
(415, 'ER54537', '2004-09-28', '31310.09', '2004-09-28'),
(424, 'KF480160', '2004-12-07', '25505.98', '2004-12-07'),
(424, 'LM271923', '2003-04-16', '21665.98', '2003-04-18'),
(424, 'OA595449', '2003-10-31', '22042.37', '2003-10-31'),
(447, 'AO757239', '2003-09-15', '6631.36', '2003-09-15'),
(447, 'ER615123', '2003-06-25', '17032.29', '2003-06-25'),
(447, 'OU516561', '2004-12-17', '26304.13', '2004-12-17'),
(448, 'FS299615', '2005-04-18', '27966.54', '2005-04-18'),
(448, 'KR822727', '2004-09-30', '48809.90', '2004-09-30'),
(450, 'EF485824', '2004-06-21', '59551.38', '2004-06-21'),
(452, 'ED473873', '2003-11-15', '27121.90', '2003-11-15'),
(452, 'FN640986', '2003-11-20', '15130.97', '2003-11-20'),
(452, 'HG635467', '2005-05-03', '8807.12', '2005-05-03'),
(455, 'HA777606', '2003-12-05', '38139.18', '2003-12-05'),
(455, 'IR662429', '2004-05-12', '32239.47', '2004-05-12'),
(456, 'GJ715659', '2004-11-13', '27550.51', '2004-11-13'),
(456, 'MO743231', '2004-04-30', '1679.92', '2004-04-30'),
(458, 'DD995006', '2004-11-15', '33145.56', '2004-11-15'),
(458, 'NA377824', '2004-02-06', '22162.61', '2004-02-06'),
(458, 'OO606861', '2003-06-13', '57131.92', '2003-06-13'),
(462, 'ED203908', '2005-04-15', '30293.77' , '2005-04-25'),
(462, 'GC60330', '2003-11-08', '9977.85', '2003-11-08'),
(462, 'PE176846', '2004-11-27', '48355.87', '2004-11-27'),
(471, 'AB661578', '2004-07-28', '9415.13', '2004-07-28'),
(471, 'CO645196', '2003-12-10', '35505.63', '2003-12-10'),
(473, 'LL427009', '2004-02-17', '7612.06', '2004-02-17'),
(473, 'PC688499', '2003-10-27', '17746.26', '2003-10-27'),
(475, 'JP113227', '2003-12-09', '7678.25', '2003-12-09'),
(475, 'PB951268', '2004-02-13', '36070.47', '2004-02-13'),
(484, 'GK294076', '2004-10-26', '3474.66', '2004-10-26'),
(484, 'JH546765', '2003-11-29', '47513.19', '2003-11-29'),
(486, 'BL66528', '2004-04-14', '5899.38', '2004-04-14'),
(486, 'HS86661', '2004-11-23', '45994.07', '2004-11-23'),
(486, 'JB117768', '2003-03-20', '25833.14', '2003-03-20'),
(487, 'AH612904', '2003-09-28', '29997.09', '2003-09-28'),
(487, 'PT550181', '2004-02-29', '12573.28', NULL),
(489, 'OC773849', '2003-12-04', '22275.73', '2003-12-04'),
(489, 'PO860906', '2004-01-31', '7310.42', '2004-01-31'),
(495, 'BH167026', '2003-12-26', '59265.14', '2003-12-26'),
(495, 'FN155234', '2004-05-14', '6276.60', '2004-05-14'),
(496, 'EU531600', '2005-05-25', '30253.75', '2005-05-25'),
(496, 'MB342426', '2003-07-16', '32077.44', '2003-07-16'),
(496, 'MN89921', '2004-12-31', '52166.00', '2004-12-31') ON CONFLICT ("customer_number", "check_number") DO NOTHING;
insert into "sale"("sale_id", "fiscal_year", "sale", "employee_number") values
(1, 2003, 5282.64, 1370),
(2, 2004, 1938.24, 1370),
(3, 2004, 1676.14, 1370),
(4, 2003, 3213, 1166),
(5, 2004, 2121.35, 1166),
(6, 2004, 3711.12, 1166),
(7, 2003, 3449.26, 1611),
(8, 2003, 4704.92, 1611),
(9, 2004, 2974.43, 1611),
(10, 2004, 4755.6, 1611),
(11, 2004, 5657.4, 1611),
(12, 2004, 3660.75, 1370),
(13, 2004, 2812.32, 1370),
(14, 2005, 1607.76, 1370),
(15, 2005, 4996.62, 1370),
(16, 2003, 5571.8, 1504),
(17, 2003, 1491.38, 1504),
(18, 2004, 3884.34, 1504),
(19, 2004, 5241.44, 1504) ON CONFLICT ("sale_id") DO NOTHING;
/* END */
/*
*********************************************************************
http://www.mysqltutorial.org
*********************************************************************
Name: MySQL Sample Database classicmodels
Link: http://www.mysqltutorial.org/mysql-sample-database.aspx
*********************************************************************
This is a modified version of the original schema
*/
|
<filename>db_smoke.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.127.12
-- Generation Time: Apr 28, 2021 at 01:38 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.3.27
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: `db_smoke`
--
-- --------------------------------------------------------
--
-- Table structure for table `aduan_ormas`
--
CREATE TABLE `aduan_ormas` (
`id` int(11) NOT NULL,
`nama` varchar(50) NOT NULL,
`nama_organisasi` varchar(50) NOT NULL,
`no_telp` int(15) NOT NULL,
`email` varchar(50) NOT NULL,
`judul` varchar(50) NOT NULL,
`isi` text NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `daftar_kecamatan`
--
CREATE TABLE `daftar_kecamatan` (
`id` int(11) NOT NULL,
`nama` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `daftar_kecamatan`
--
INSERT INTO `daftar_kecamatan` (`id`, `nama`) VALUES
(1, 'Ambarawa'),
(2, 'Bancak'),
(3, 'Bandungan'),
(4, 'Banyubiru'),
(5, 'Bawen'),
(6, 'Bergas'),
(7, 'Bringin'),
(8, 'Getasan'),
(9, 'Jambu'),
(10, 'Kaliwungu'),
(11, 'Pabetan'),
(12, 'Pringapus'),
(13, 'Suruh'),
(14, 'Susukan'),
(15, 'Sumowono'),
(16, 'Tengaran'),
(17, 'Tuntang'),
(18, '<NAME>at'),
(19, 'Ungaran Timur');
-- --------------------------------------------------------
--
-- Table structure for table `form_pendaftaran`
--
CREATE TABLE `form_pendaftaran` (
`id` int(11) NOT NULL,
`nama_organisasi` varchar(80) NOT NULL,
`bidang_kegiatan` varchar(40) NOT NULL,
`ruang_lingkup` varchar(40) NOT NULL,
`alamat` varchar(50) NOT NULL,
`kecamatan` int(3) NOT NULL,
`waktu` date NOT NULL,
`asas` text NOT NULL,
`tujuan` text NOT NULL,
`pendiri` varchar(30) NOT NULL,
`pembina` varchar(30) NOT NULL,
`penasihat` varchar(30) NOT NULL,
`ketua` varchar(30) NOT NULL,
`sekretaris` varchar(30) NOT NULL,
`bendahara` varchar(30) NOT NULL,
`masa_bhakti` varchar(20) NOT NULL,
`keputusan_tertinggi` varchar(30) NOT NULL,
`unit_organisasi` varchar(25) NOT NULL,
`usaha` varchar(50) NOT NULL,
`sumber` varchar(25) NOT NULL,
`logo` text DEFAULT NULL,
`bendera` text DEFAULT NULL,
`email` varchar(30) NOT NULL,
`no_telepon` int(15) NOT NULL,
`status` varchar(20) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `form_pendaftaran`
--
INSERT INTO `form_pendaftaran` (`id`, `nama_organisasi`, `bidang_kegiatan`, `ruang_lingkup`, `alamat`, `kecamatan`, `waktu`, `asas`, `tujuan`, `pendiri`, `pembina`, `penasihat`, `ketua`, `sekretaris`, `bendahara`, `masa_bhakti`, `keputusan_tertinggi`, `unit_organisasi`, `usaha`, `sumber`, `logo`, `bendera`, `email`, `no_telepon`, `status`, `created_at`, `updated_at`) VALUES
(2, 'test', 'test', 'test', 'test', 1, '2021-04-27', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 'test', 1235123132, '0', '2021-04-26 21:41:32', '2021-04-26 21:41:32');
-- --------------------------------------------------------
--
-- Table structure for table `laporan_ormas`
--
CREATE TABLE `laporan_ormas` (
`id` int(11) NOT NULL,
`nama_organisasi` varchar(50) NOT NULL,
`judul` varchar(50) NOT NULL,
`deskripsi` text NOT NULL,
`foto` text NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `laporan_ormas`
--
INSERT INTO `laporan_ormas` (`id`, `nama_organisasi`, `judul`, `deskripsi`, `foto`, `created_at`, `updated_at`) VALUES
(1, '-', 'asdfwqer', 'asdfasdf', 'Curiculum Vitae.png', NULL, NULL),
(2, 'Test Organisasi', 'asdf', 'asfasdfasdf', 'Curiculum Vitae.png', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `struktur_pegawai`
--
CREATE TABLE `struktur_pegawai` (
`id` int(11) NOT NULL,
`nama` varchar(30) NOT NULL,
`tempat_lahir` varchar(20) NOT NULL,
`tanggal_lahir` date NOT NULL,
`nip` bigint(30) NOT NULL,
`nip_lama` int(20) NOT NULL,
`golongan` varchar(10) NOT NULL,
`tmt_golongan` date NOT NULL,
`esl` varchar(10) NOT NULL,
`jabatan` text NOT NULL,
`unit_kerja` varchar(50) NOT NULL,
`tmt_jabatan` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `struktur_pegawai`
--
INSERT INTO `struktur_pegawai` (`id`, `nama`, `tempat_lahir`, `tanggal_lahir`, `nip`, `nip_lama`, `golongan`, `tmt_golongan`, `esl`, `jabatan`, `unit_kerja`, `tmt_jabatan`) VALUES
(1, '<NAME>, S.IP.', 'Jakarta', '1966-03-28', 196603281990011001, 131873490, 'III/d', '2007-04-01', '-', 'Analis Wawasan Kebangsaan Pada Seksi Kesatuan Bangsa', 'Kantor Kesatuan Bangsa dan Politik', '2020-03-10'),
(2, 'Ristotok, S.E.', 'Kulon Progo', '1964-09-22', 196409221988031004, 30196256, 'III/d', '2017-10-01', 'IV.A', 'Kepala Seksi Kesatuan Bangsa Pada Seksi Kesatuan Bangsa', 'Kantor Kesatuan Bangsa dan Politik', '2013-12-31'),
(3, '<NAME>., M.H.', 'Jayapura', '1981-12-28', 198112282002122001, 120161948, 'III/d', '2017-10-01', 'IV.A', 'Kepala Subbagian Tata Usaha Pada Subbagian Tata Usaha', 'Kantor Kesatuan Bangsa dan politik', '2018-04-19'),
(4, '<NAME>', 'Semarang', '1965-08-10', 196508101986071001, 10208338, 'III/c', '2014-10-01', '-', 'Analis Wawasan Kebangsaan Pada Seksi Kesatuan Bangsa', 'Kantor Kesatuan Bangsa dan Politik', '2018-05-01'),
(5, '<NAME>, S.Sos., M.Si.', '<NAME>', '1977-06-10', 197706102009022004, 0, 'III/c', '2017-04-01', 'IV.A', 'Kepala Seksi bina Organisasi Masyarakat dan Organisasi Politik Pada Seksi Bina Organisasi Masyarakat', 'Kantor Kesatuan Bangsa dan politik', '2018-04-19'),
(6, '<NAME>, S.Kom. ', 'Salatiga', '1987-09-17', 198709172011012010, 0, 'III/c', '2019-04-01', '-', 'Pengadministrasi Umum Pada Subbagian Tata Usaha', 'Kantor Kesatuan Bangsa dan Politik', '2018-05-01'),
(7, '<NAME>', 'Semarang', '1964-06-09', 196406091986112001, 500084078, 'III/b', '2013-04-01', '-', 'Pengadministrasi Umum Pada Subbagian Tata Usaha', 'Kantor Kesatuan Bangsa dan politik', '2018-05-01'),
(8, '<NAME>, S.H.', 'Banyumas', '1981-08-21', 1981082120080110003, 500170868, 'III/a', '2019-04-01', '-', 'Pengelola Organisasi Politik dan Organisasi Kemasyarakatan Pada Seksi Bina Organisasi Masyarakat dan', 'Kantor Kesatuan Bangsa dan Politik', '2018-05-01'),
(9, 'Sutarto, S.E.', 'Banyumas', '1977-05-27', 197705272010011001, 0, 'III/a', '2019-10-01', '-', 'Pranata Barang dan Jasa Pada Subbagian Tata Usaha', 'Kantor Kesatuan Bangsa dan politik', '2018-05-01'),
(10, '<NAME>', 'Bandung', '1975-07-08', 197507082007011012, 500145778, 'II/d', '2019-04-01', '-', 'Pengadministrasi Umum Pada Seksi Kesatuan Bangsa', 'Kantor Kesatuan Bangsa dan Politik', '2018-05-01'),
(11, 'Tohir', 'Kabupaten Semarang', '1969-10-07', 196910072008011014, 500173455, 'II/d', '2020-04-01', '-', 'Pranata Barang dan Jasa Pada Subbagian Tata Usaha', 'Kantor Kesatuan Bangsa dan Politik', '2018-05-01'),
(12, '<NAME>, A.Md.Kom.', 'Salatiga', '1988-06-18', 198806182020121005, 0, 'II/c', '2020-12-01', '-', 'Pranata Komputer Pelaksana Pada Subbagian Tata usaha', 'Kantor Kesatuan Bangsa dan Politik', '2020-12-01');
-- --------------------------------------------------------
--
-- Table structure for table `syarat_pendaftaran`
--
CREATE TABLE `syarat_pendaftaran` (
`id` int(11) NOT NULL,
`surat_pemberitahuan` text NOT NULL,
`sk_kemenkumham` text NOT NULL,
`sk_kepengurusan` text NOT NULL,
`akte` text NOT NULL,
`ad_art` text NOT NULL,
`program_kerja` text NOT NULL,
`biodata` text NOT NULL,
`ktp` text NOT NULL,
`formulir` text NOT NULL,
`surat_keterangan` text NOT NULL,
`npwp` text NOT NULL,
`foto` text NOT NULL,
`keabsahan` text NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(30) NOT NULL,
`email` varchar(50) NOT NULL,
`password` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `email`, `password`) VALUES
(5, 'adminadminadmin', '<EMAIL>', '<PASSWORD>');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `aduan_ormas`
--
ALTER TABLE `aduan_ormas`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `daftar_kecamatan`
--
ALTER TABLE `daftar_kecamatan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `form_pendaftaran`
--
ALTER TABLE `form_pendaftaran`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `laporan_ormas`
--
ALTER TABLE `laporan_ormas`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `struktur_pegawai`
--
ALTER TABLE `struktur_pegawai`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `syarat_pendaftaran`
--
ALTER TABLE `syarat_pendaftaran`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `aduan_ormas`
--
ALTER TABLE `aduan_ormas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `daftar_kecamatan`
--
ALTER TABLE `daftar_kecamatan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `form_pendaftaran`
--
ALTER TABLE `form_pendaftaran`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `laporan_ormas`
--
ALTER TABLE `laporan_ormas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `struktur_pegawai`
--
ALTER TABLE `struktur_pegawai`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `syarat_pendaftaran`
--
ALTER TABLE `syarat_pendaftaran`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SET DEFINE OFF;
CREATE INDEX AFW_30_CARNT_SPRIN_FK1 ON AFW_30_CARNT_SPRIN
(REF_CARNT_PRODT)
LOGGING
/
|
REM /**********************************************************/
REM SCRIPT
REM stat_estim_anal_as.sql
REM TITLE
REM Advanced analyze operations
REM HINT
REM Advanced analyze operations
REM DESCRIPTION
REM Performs advanced ANALYZE operations
REM COMPATIBILITY
REM 805, 815, 816, 817, 901, 920
REM /**********************************************************/
PROMPT
ACCEPT ownr PROMPT "Schema name LIKE (Enter for <All>): "
ACCEPT name PROMPT "Object name LIKE (Enter for <All>): "
ACCEPT type PROMPT "Object type ((T)able, (I)ndex, (C)luster, Enter for <All>): "
PROMPT
PROMPT
PROMPT POSSIBLE ANALYZE ACTION:
PROMPT
PROMPT D = delete statistics
PROMPT
PROMPT E = estimate statistics
PROMPT ET = estimate statistics for table
PROMPT EI = estimate statistics for all indexes
PROMPT EL = estimate statistics for all indexed columns
PROMPT
PROMPT C = compute statistics
PROMPT CT = compute statistics for table
PROMPT CI = compute statistics for all indexes
PROMPT CL = compute statistics for all indexed columns
PROMPT
PROMPT VS = validate structure
PROMPT VC = validate structure cascade
PROMPT LC = list chained rows
PROMPT
PROMPT
ACCEPT actn PROMPT "Statistics action: "
PROMPT
@../../util/_BEGIN
SET HEADING OFF
SET ECHO OFF
SET FEEDBACK OFF
SET PAGESIZE 0
SET LINESIZE 120
SET TRIMSPOOL ON
DEFINE ty = "UPPER('&&type%')"
DEFINE ac = "UPPER('&&actn')"
DEFINE ft = "DECODE(o.object_type, 'TABLE', 'FOR TABLE')"
DEFINE fi = "DECODE(o.object_type, 'TABLE', 'FOR ALL INDEXES')"
DEFINE fc = "DECODE(o.object_type, 'TABLE', 'FOR ALL INDEXED COLUMNS')"
SELECT 'ANALYZE '||o.object_type||' '||o.owner||'.'||o.object_name||&&LF||
DECODE(&&ac,
'D' , 'DELETE STATISTICS',
'E' , 'ESTIMATE STATISTICS',
'ET', 'ESTIMATE STATISTICS ' || &&ft,
'EI', 'ESTIMATE STATISTICS ' || &&fi,
'EC', 'ESTIMATE STATISTICS ' || &&fc,
'C' , 'COMPUTE STATISTICS',
'CT', 'COMPUTE STATISTICS ' || &&ft,
'CI', 'COMPUTE STATISTICS ' || &&fi,
'CC', 'COMPUTE STATISTICS ' || &&fc,
'VS', 'VALIDATE STRUCTURE',
'VC', 'VALIDATE STRUCTURE CASCADE',
'LC', 'LIST CHAINED ROWS'
) || ';'
FROM dba_objects o
WHERE o.owner NOT IN ('SYS', 'SYSTEM')
AND o.owner LIKE NVL(UPPER('&&ownr'), '%')
AND o.object_name LIKE NVL(UPPER('&&name'), '%')
AND o.object_type LIKE &&ty
AND o.object_type IN ('TABLE', 'INDEX', 'CLUSTER')
ORDER BY o.owner, o.object_name
/
UNDEFINE ownr name type actn cr ty ac ft fi fc
@../../util/_END
|
drop table if exists GL_TAXRATE_DEFINE;
/*==============================================================*/
/* Table: GL_TAXRATE_DEFINE */
/*==============================================================*/
create table GL_TAXRATE_DEFINE
(
TAXRATE_TYPE varchar(3) not null comment '税率类型',
TAXRATE_DESC varchar(30) not null comment '税率类型描述',
START_METHOD varchar(1) not null comment '启动方式',
COMPANY varchar(20) comment '法人代码',
primary key (TAXRATE_TYPE)
);
alter table GL_TAXRATE_DEFINE comment '增值税税率类型定义表 undefined';
|
SET ANSI_NULLS ON;
SET ANSI_PADDING ON;
SET ANSI_WARNINGS ON;
SET ARITHABORT ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET QUOTED_IDENTIFIER ON;
SET STATISTICS IO OFF;
SET STATISTICS TIME OFF;
GO
IF OBJECT_ID('dbo.sp_AllNightLog_Setup') IS NULL
EXEC ('CREATE PROCEDURE dbo.sp_AllNightLog_Setup AS RETURN 0;');
GO
ALTER PROCEDURE dbo.sp_AllNightLog_Setup
@RPOSeconds BIGINT = 30,
@RTOSeconds BIGINT = 30,
@BackupPath NVARCHAR(MAX) = NULL,
@RestorePath NVARCHAR(MAX) = NULL,
@Jobs TINYINT = 10,
@RunSetup BIT = 0,
@UpdateSetup BIT = 0,
@EnableBackupJobs INT = NULL,
@EnableRestoreJobs INT = NULL,
@Debug BIT = 0,
@FirstFullBackup BIT = 0,
@FirstDiffBackup BIT = 0,
@Help BIT = 0,
@Version VARCHAR(30) = NULL OUTPUT,
@VersionDate DATETIME = NULL OUTPUT,
@VersionCheckMode BIT = 0
WITH RECOMPILE
AS
SET NOCOUNT ON;
BEGIN;
SELECT @Version = '3.8', @VersionDate = '20190922';
IF(@VersionCheckMode = 1)
BEGIN
RETURN;
END;
IF @Help = 1
BEGIN
PRINT '
/*
sp_AllNightLog_Setup from http://FirstResponderKit.org
This script sets up a database, tables, rows, and jobs for sp_AllNightLog, including:
* Creates a database
* Right now it''s hard-coded to use msdbCentral, that might change later
* Creates tables in that database!
* dbo.backup_configuration
* Hold variables used by stored proc to make runtime decisions
* RPO: Seconds, how often we look for databases that need log backups
* Backup Path: The path we feed to Ola H''s backup proc
* dbo.backup_worker
* Holds list of databases and some information that helps our Agent jobs figure out if they need to take another log backup
* Creates tables in msdb
* dbo.restore_configuration
* Holds variables used by stored proc to make runtime decisions
* RTO: Seconds, how often to look for log backups to restore
* Restore Path: The path we feed to sp_DatabaseRestore
* dbo.restore_worker
* Holds list of databases and some information that helps our Agent jobs figure out if they need to look for files to restore
* Creates agent jobs
* 1 job that polls sys.databases for new entries
* 10 jobs that run to take log backups
* Based on a queue table
* Requires Ola Hallengren''s Database Backup stored proc
To learn more, visit http://FirstResponderKit.org where you can download new
versions for free, watch training videos on how it works, get more info on
the findings, contribute your own code, and more.
Known limitations of this version:
- Only Microsoft-supported versions of SQL Server. Sorry, 2005 and 2000! And really, maybe not even anything less than 2016. Heh.
- The repository database name is hard-coded to msdbCentral.
Unknown limitations of this version:
- None. (If we knew them, they would be known. Duh.)
Changes - for the full list of improvements and fixes in this version, see:
https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/
Parameter explanations:
@RunSetup BIT, defaults to 0. When this is set to 1, it will run the setup portion to create database, tables, and worker jobs.
@UpdateSetup BIT, defaults to 0. When set to 1, will update existing configs for RPO/RTO and database backup/restore paths.
@RPOSeconds BIGINT, defaults to 30. Value in seconds you want to use to determine if a new log backup needs to be taken.
@BackupPath NVARCHAR(MAX), defaults to = ''D:\Backup''. You 99.99999% will need to change this path to something else. This tells Ola''s job where to put backups.
@Debug BIT, defaults to 0. Whent this is set to 1, it prints out dynamic SQL commands
Sample call:
EXEC dbo.sp_AllNightLog_Setup
@RunSetup = 1,
@RPOSeconds = 30,
@BackupPath = N''M:\MSSQL\Backup'',
@Debug = 1
For more documentation: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/
MIT License
Copyright (c) 2019 <NAME> Unlimited
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/';
RETURN;
END; /* IF @Help = 1 */
DECLARE @database NVARCHAR(128) = NULL; --Holds the database that's currently being processed
DECLARE @error_number INT = NULL; --Used for TRY/CATCH
DECLARE @error_severity INT; --Used for TRY/CATCH
DECLARE @error_state INT; --Used for TRY/CATCH
DECLARE @msg NVARCHAR(4000) = N''; --Used for RAISERROR
DECLARE @rpo INT; --Used to hold the RPO value in our configuration table
DECLARE @backup_path NVARCHAR(MAX); --Used to hold the backup path in our configuration table
DECLARE @db_sql NVARCHAR(MAX) = N''; --Used to hold the dynamic SQL to create msdbCentral
DECLARE @tbl_sql NVARCHAR(MAX) = N''; --Used to hold the dynamic SQL that creates tables in msdbCentral
DECLARE @database_name NVARCHAR(256) = N'msdbCentral'; --Used to hold the name of the database we create to centralize data
--Right now it's hardcoded to msdbCentral, but I made it dynamic in case that changes down the line
/*These variables control the loop to create/modify jobs*/
DECLARE @job_sql NVARCHAR(MAX) = N''; --Used to hold the dynamic SQL that creates Agent jobs
DECLARE @counter INT = 0; --For looping to create 10 Agent jobs
DECLARE @job_category NVARCHAR(MAX) = N'''Database Maintenance'''; --Job category
DECLARE @job_owner NVARCHAR(128) = QUOTENAME(SUSER_SNAME(0x01), ''''); -- Admin user/owner
DECLARE @jobs_to_change TABLE(name SYSNAME); -- list of jobs we need to enable or disable
DECLARE @current_job_name SYSNAME; -- While looping through Agent jobs to enable or disable
DECLARE @active_start_date INT = (CONVERT(INT, CONVERT(VARCHAR(10), GETDATE(), 112)));
DECLARE @started_waiting_for_jobs DATETIME; --We need to wait for a while when disabling jobs
/*Specifically for Backups*/
DECLARE @job_name_backups NVARCHAR(MAX) = N'''sp_AllNightLog_Backup_Job_'''; --Name of log backup job
DECLARE @job_description_backups NVARCHAR(MAX) = N'''This is a worker for the purposes of taking log backups from msdbCentral.dbo.backup_worker queue table.'''; --Job description
DECLARE @job_command_backups NVARCHAR(MAX) = N'''EXEC sp_AllNightLog @Backup = 1'''; --Command the Agent job will run
/*Specifically for Restores*/
DECLARE @job_name_restores NVARCHAR(MAX) = N'''sp_AllNightLog_Restore_Job_'''; --Name of log backup job
DECLARE @job_description_restores NVARCHAR(MAX) = N'''This is a worker for the purposes of restoring log backups from msdb.dbo.restore_worker queue table.'''; --Job description
DECLARE @job_command_restores NVARCHAR(MAX) = N'''EXEC sp_AllNightLog @Restore = 1'''; --Command the Agent job will run
/*
Sanity check some variables
*/
IF ((@RunSetup = 0 OR @RunSetup IS NULL) AND (@UpdateSetup = 0 OR @UpdateSetup IS NULL))
BEGIN
RAISERROR('You have to either run setup or update setup. You can''t not do neither nor, if you follow. Or not.', 0, 1) WITH NOWAIT;
RETURN;
END;
/*
Should be a positive number
*/
IF (@RPOSeconds < 0)
BEGIN
RAISERROR('Please choose a positive number for @RPOSeconds', 0, 1) WITH NOWAIT;
RETURN;
END;
/*
Probably shouldn't be more than 20
*/
IF (@Jobs > 20) OR (@Jobs < 1)
BEGIN
RAISERROR('We advise sticking with 1-20 jobs.', 0, 1) WITH NOWAIT;
RETURN;
END;
/*
Probably shouldn't be more than 4 hours
*/
IF (@RPOSeconds >= 14400)
BEGIN
RAISERROR('If your RPO is really 4 hours, perhaps you''d be interested in a more modest recovery model, like SIMPLE?', 0, 1) WITH NOWAIT;
RETURN;
END;
/*
Can't enable both the backup and restore jobs at the same time
*/
IF @EnableBackupJobs = 1 AND @EnableRestoreJobs = 1
BEGIN
RAISERROR('You are not allowed to enable both the backup and restore jobs at the same time. Pick one, bucko.', 0, 1) WITH NOWAIT;
RETURN;
END;
/*
Make sure xp_cmdshell is enabled
*/
IF NOT EXISTS (SELECT * FROM sys.configurations WHERE name = 'xp_cmdshell' AND value_in_use = 1)
BEGIN
RAISERROR('xp_cmdshell must be enabled so we can get directory contents to check for new databases to restore.', 0, 1) WITH NOWAIT
RETURN;
END
/*
Make sure Ola Hallengren's scripts are installed in master
*/
IF 2 <> (SELECT COUNT(*) FROM master.sys.procedures WHERE name IN('CommandExecute', 'DatabaseBackup'))
BEGIN
RAISERROR('Ola Hallengren''s CommandExecute and DatabaseBackup must be installed in the master database. More info: http://ola.hallengren.com', 0, 1) WITH NOWAIT
RETURN;
END
/*
Make sure sp_DatabaseRestore is installed in master
*/
IF NOT EXISTS (SELECT * FROM master.sys.procedures WHERE name = 'sp_DatabaseRestore')
BEGIN
RAISERROR('sp_DatabaseRestore must be installed in master. To get it: http://FirstResponderKit.org', 0, 1) WITH NOWAIT
RETURN;
END
/*
Basic path sanity checks
*/
IF (@BackupPath NOT LIKE '[c-zC-Z]:\%') --Local path, don't think anyone has A or B drives
AND (@BackupPath NOT LIKE '\\[a-zA-Z0-9]%\%') --UNC path
BEGIN
RAISERROR('Are you sure that''s a real path?', 0, 1) WITH NOWAIT;
RETURN;
END;
/*
If you want to update the table, one of these has to not be NULL
*/
IF @UpdateSetup = 1
AND ( @RPOSeconds IS NULL
AND @BackupPath IS NULL
AND @RPOSeconds IS NULL
AND @RestorePath IS NULL
AND @EnableBackupJobs IS NULL
AND @EnableRestoreJobs IS NULL
)
BEGIN
RAISERROR('If you want to update configuration settings, they can''t be NULL. Please Make sure @RPOSeconds / @RTOSeconds or @BackupPath / @RestorePath has a value', 0, 1) WITH NOWAIT;
RETURN;
END;
IF @UpdateSetup = 1
GOTO UpdateConfigs;
IF @RunSetup = 1
BEGIN
BEGIN TRY
BEGIN
/*
First check to see if Agent is running -- we'll get errors if it's not
*/
IF ( SELECT 1
FROM sys.all_objects
WHERE name = 'dm_server_services' ) IS NOT NULL
BEGIN
IF EXISTS (
SELECT 1
FROM sys.dm_server_services
WHERE servicename LIKE 'SQL Server Agent%'
AND status_desc = 'Stopped'
)
BEGIN
RAISERROR('SQL Server Agent is not currently running -- it needs to be enabled to add backup worker jobs and the new database polling job', 0, 1) WITH NOWAIT;
RETURN;
END;
END
BEGIN
/*
Check to see if the database exists
*/
RAISERROR('Checking for msdbCentral', 0, 1) WITH NOWAIT;
SET @db_sql += N'
IF DATABASEPROPERTYEX(' + QUOTENAME(@database_name, '''') + ', ''Status'') IS NULL
BEGIN
RAISERROR(''Creating msdbCentral'', 0, 1) WITH NOWAIT;
CREATE DATABASE ' + QUOTENAME(@database_name) + ';
ALTER DATABASE ' + QUOTENAME(@database_name) + ' SET RECOVERY FULL;
END
';
IF @Debug = 1
BEGIN
RAISERROR(@db_sql, 0, 1) WITH NOWAIT;
END;
IF @db_sql IS NULL
BEGIN
RAISERROR('@db_sql is NULL for some reason', 0, 1) WITH NOWAIT;
END;
EXEC sp_executesql @db_sql;
/*
Check for tables and stuff
*/
RAISERROR('Checking for tables in msdbCentral', 0, 1) WITH NOWAIT;
SET @tbl_sql += N'
USE ' + QUOTENAME(@database_name) + '
IF OBJECT_ID(''' + QUOTENAME(@database_name) + '.dbo.backup_configuration'') IS NULL
BEGIN
RAISERROR(''Creating table dbo.backup_configuration'', 0, 1) WITH NOWAIT;
CREATE TABLE dbo.backup_configuration (
database_name NVARCHAR(256),
configuration_name NVARCHAR(512),
configuration_description NVARCHAR(512),
configuration_setting NVARCHAR(MAX)
);
END
ELSE
BEGIN
RAISERROR(''Backup configuration table exists, truncating'', 0, 1) WITH NOWAIT;
TRUNCATE TABLE dbo.backup_configuration
END
RAISERROR(''Inserting configuration values'', 0, 1) WITH NOWAIT;
INSERT dbo.backup_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES (''all'', ''log backup frequency'', ''The length of time in second between Log Backups.'', ''' + CONVERT(NVARCHAR(10), @RPOSeconds) + ''');
INSERT dbo.backup_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES (''all'', ''log backup path'', ''The path to which Log Backups should go.'', ''' + @BackupPath + ''');
INSERT dbo.backup_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES (''all'', ''change backup type'', ''For Ola Hallengren DatabaseBackup @ChangeBackupType param: Y = escalate to fulls, MSDB = escalate by checking msdb backup history.'', ''MSDB'');
INSERT dbo.backup_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES (''all'', ''encrypt'', ''For Ola Hallengren DatabaseBackup: Y = encrypt the backup. N (default) = do not encrypt.'', NULL);
INSERT dbo.backup_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES (''all'', ''encryptionalgorithm'', ''For Ola Hallengren DatabaseBackup: native 2014 choices include TRIPLE_DES_3KEY, AES_128, AES_192, AES_256.'', NULL);
INSERT dbo.backup_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES (''all'', ''servercertificate'', ''For Ola Hallengren DatabaseBackup: server certificate that is used to encrypt the backup.'', NULL);
IF OBJECT_ID(''' + QUOTENAME(@database_name) + '.dbo.backup_worker'') IS NULL
BEGIN
RAISERROR(''Creating table dbo.backup_worker'', 0, 1) WITH NOWAIT;
CREATE TABLE dbo.backup_worker (
id INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
database_name NVARCHAR(256),
last_log_backup_start_time DATETIME DEFAULT ''19000101'',
last_log_backup_finish_time DATETIME DEFAULT ''99991231'',
is_started BIT DEFAULT 0,
is_completed BIT DEFAULT 0,
error_number INT DEFAULT NULL,
last_error_date DATETIME DEFAULT NULL,
ignore_database BIT DEFAULT 0,
full_backup_required BIT DEFAULT ' + CASE WHEN @FirstFullBackup = 0 THEN N'0,' ELSE N'1,' END + CHAR(10) +
N'diff_backup_required BIT DEFAULT ' + CASE WHEN @FirstDiffBackup = 0 THEN N'0' ELSE N'1' END + CHAR(10) +
N');
END;
ELSE
BEGIN
RAISERROR(''Backup worker table exists, truncating'', 0, 1) WITH NOWAIT;
TRUNCATE TABLE dbo.backup_worker
END
RAISERROR(''Inserting databases for backups'', 0, 1) WITH NOWAIT;
INSERT ' + QUOTENAME(@database_name) + '.dbo.backup_worker (database_name)
SELECT d.name
FROM sys.databases d
WHERE NOT EXISTS (
SELECT *
FROM msdbCentral.dbo.backup_worker bw
WHERE bw.database_name = d.name
)
AND d.database_id > 4;
';
IF @Debug = 1
BEGIN
SET @msg = SUBSTRING(@tbl_sql, 0, 2044)
RAISERROR(@msg, 0, 1) WITH NOWAIT;
SET @msg = SUBSTRING(@tbl_sql, 2044, 4088)
RAISERROR(@msg, 0, 1) WITH NOWAIT;
SET @msg = SUBSTRING(@tbl_sql, 4088, 6132)
RAISERROR(@msg, 0, 1) WITH NOWAIT;
SET @msg = SUBSTRING(@tbl_sql, 6132, 8176)
RAISERROR(@msg, 0, 1) WITH NOWAIT;
END;
IF @tbl_sql IS NULL
BEGIN
RAISERROR('@tbl_sql is NULL for some reason', 0, 1) WITH NOWAIT;
END;
EXEC sp_executesql @tbl_sql;
/*
This section creates tables for restore workers to work off of
*/
/*
In search of msdb
*/
RAISERROR('Checking for msdb. Yeah, I know...', 0, 1) WITH NOWAIT;
IF DATABASEPROPERTYEX('msdb', 'Status') IS NULL
BEGIN
RAISERROR('YOU HAVE NO MSDB WHY?!', 0, 1) WITH NOWAIT;
RETURN;
END;
/* In search of restore_configuration */
RAISERROR('Checking for Restore Worker tables in msdb', 0, 1) WITH NOWAIT;
IF OBJECT_ID('msdb.dbo.restore_configuration') IS NULL
BEGIN
RAISERROR('Creating restore_configuration table in msdb', 0, 1) WITH NOWAIT;
CREATE TABLE msdb.dbo.restore_configuration (
database_name NVARCHAR(256),
configuration_name NVARCHAR(512),
configuration_description NVARCHAR(512),
configuration_setting NVARCHAR(MAX)
);
END;
ELSE
BEGIN
RAISERROR('Restore configuration table exists, truncating', 0, 1) WITH NOWAIT;
TRUNCATE TABLE msdb.dbo.restore_configuration;
END;
RAISERROR('Inserting configuration values to msdb.dbo.restore_configuration', 0, 1) WITH NOWAIT;
INSERT msdb.dbo.restore_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES ('all', 'log restore frequency', 'The length of time in second between Log Restores.', @RTOSeconds);
INSERT msdb.dbo.restore_configuration (database_name, configuration_name, configuration_description, configuration_setting)
VALUES ('all', 'log restore path', 'The path to which Log Restores come from.', @RestorePath);
IF OBJECT_ID('msdb.dbo.restore_worker') IS NULL
BEGIN
RAISERROR('Creating table msdb.dbo.restore_worker', 0, 1) WITH NOWAIT;
CREATE TABLE msdb.dbo.restore_worker (
id INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
database_name NVARCHAR(256),
last_log_restore_start_time DATETIME DEFAULT '19000101',
last_log_restore_finish_time DATETIME DEFAULT '99991231',
is_started BIT DEFAULT 0,
is_completed BIT DEFAULT 0,
error_number INT DEFAULT NULL,
last_error_date DATETIME DEFAULT NULL,
ignore_database BIT DEFAULT 0,
full_backup_required BIT DEFAULT 0,
diff_backup_required BIT DEFAULT 0
);
RAISERROR('Inserting databases for restores', 0, 1) WITH NOWAIT;
INSERT msdb.dbo.restore_worker (database_name)
SELECT d.name
FROM sys.databases d
WHERE NOT EXISTS (
SELECT *
FROM msdb.dbo.restore_worker bw
WHERE bw.database_name = d.name
)
AND d.database_id > 4;
END;
/*
Add Jobs
*/
/*
Look for our ten second schedule -- all jobs use this to restart themselves if they fail
Fun fact: you can add the same schedule name multiple times, so we don't want to just stick it in there
*/
RAISERROR('Checking for ten second schedule', 0, 1) WITH NOWAIT;
IF NOT EXISTS (
SELECT 1
FROM msdb.dbo.sysschedules
WHERE name = 'ten_seconds'
)
BEGIN
RAISERROR('Creating ten second schedule', 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_add_schedule @schedule_name= ten_seconds,
@enabled = 1,
@freq_type = 4,
@freq_interval = 1,
@freq_subday_type = 2,
@freq_subday_interval = 10,
@freq_relative_interval = 0,
@freq_recurrence_factor = 0,
@active_start_date = @active_start_date,
@active_end_date = 99991231,
@active_start_time = 0,
@active_end_time = 235959;
END;
/*
Look for Backup Pollster job -- this job sets up our watcher for new databases to back up
*/
RAISERROR('Checking for pollster job', 0, 1) WITH NOWAIT;
IF NOT EXISTS (
SELECT 1
FROM msdb.dbo.sysjobs
WHERE name = 'sp_AllNightLog_PollForNewDatabases'
)
BEGIN
RAISERROR('Creating pollster job', 0, 1) WITH NOWAIT;
IF @EnableBackupJobs = 1
BEGIN
EXEC msdb.dbo.sp_add_job @job_name = sp_AllNightLog_PollForNewDatabases,
@description = 'This is a worker for the purposes of polling sys.databases for new entries to insert to the worker queue table.',
@category_name = 'Database Maintenance',
@owner_login_name = 'sa',
@enabled = 1;
END
ELSE
BEGIN
EXEC msdb.dbo.sp_add_job @job_name = sp_AllNightLog_PollForNewDatabases,
@description = 'This is a worker for the purposes of polling sys.databases for new entries to insert to the worker queue table.',
@category_name = 'Database Maintenance',
@owner_login_name = 'sa',
@enabled = 0;
END
RAISERROR('Adding job step', 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_add_jobstep @job_name = sp_AllNightLog_PollForNewDatabases,
@step_name = sp_AllNightLog_PollForNewDatabases,
@subsystem = 'TSQL',
@command = 'EXEC sp_AllNightLog @PollForNewDatabases = 1';
RAISERROR('Adding job server', 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_add_jobserver @job_name = sp_AllNightLog_PollForNewDatabases;
RAISERROR('Attaching schedule', 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_attach_schedule @job_name = sp_AllNightLog_PollForNewDatabases,
@schedule_name = ten_seconds;
END;
/*
Look for Restore Pollster job -- this job sets up our watcher for new databases to back up
*/
RAISERROR('Checking for restore pollster job', 0, 1) WITH NOWAIT;
IF NOT EXISTS (
SELECT 1
FROM msdb.dbo.sysjobs
WHERE name = 'sp_AllNightLog_PollDiskForNewDatabases'
)
BEGIN
RAISERROR('Creating restore pollster job', 0, 1) WITH NOWAIT;
IF @EnableRestoreJobs = 1
BEGIN
EXEC msdb.dbo.sp_add_job @job_name = sp_AllNightLog_PollDiskForNewDatabases,
@description = 'This is a worker for the purposes of polling your restore path for new entries to insert to the worker queue table.',
@category_name = 'Database Maintenance',
@owner_login_name = 'sa',
@enabled = 1;
END
ELSE
BEGIN
EXEC msdb.dbo.sp_add_job @job_name = sp_AllNightLog_PollDiskForNewDatabases,
@description = 'This is a worker for the purposes of polling your restore path for new entries to insert to the worker queue table.',
@category_name = 'Database Maintenance',
@owner_login_name = 'sa',
@enabled = 0;
END
RAISERROR('Adding restore job step', 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_add_jobstep @job_name = sp_AllNightLog_PollDiskForNewDatabases,
@step_name = sp_AllNightLog_PollDiskForNewDatabases,
@subsystem = 'TSQL',
@command = 'EXEC sp_AllNightLog @PollDiskForNewDatabases = 1';
RAISERROR('Adding restore job server', 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_add_jobserver @job_name = sp_AllNightLog_PollDiskForNewDatabases;
RAISERROR('Attaching schedule', 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_attach_schedule @job_name = sp_AllNightLog_PollDiskForNewDatabases,
@schedule_name = ten_seconds;
END;
/*
This section creates @Jobs (quantity) of worker jobs to take log backups with
They work in a queue
It's queuete
*/
RAISERROR('Checking for sp_AllNightLog backup jobs', 0, 1) WITH NOWAIT;
SELECT @counter = COUNT(*) + 1
FROM msdb.dbo.sysjobs
WHERE name LIKE 'sp[_]AllNightLog[_]Backup[_]%';
SET @msg = 'Found ' + CONVERT(NVARCHAR(10), (@counter - 1)) + ' backup jobs -- ' + CASE WHEN @counter < @Jobs THEN + 'starting loop!'
WHEN @counter >= @Jobs THEN 'skipping loop!'
ELSE 'Oh woah something weird happened!'
END;
RAISERROR(@msg, 0, 1) WITH NOWAIT;
WHILE @counter <= @Jobs
BEGIN
RAISERROR('Setting job name', 0, 1) WITH NOWAIT;
SET @job_name_backups = N'sp_AllNightLog_Backup_' + CASE WHEN @counter < 10 THEN N'0' + CONVERT(NVARCHAR(10), @counter)
WHEN @counter >= 10 THEN CONVERT(NVARCHAR(10), @counter)
END;
RAISERROR('Setting @job_sql', 0, 1) WITH NOWAIT;
SET @job_sql = N'
EXEC msdb.dbo.sp_add_job @job_name = ' + @job_name_backups + ',
@description = ' + @job_description_backups + ',
@category_name = ' + @job_category + ',
@owner_login_name = ' + @job_owner + ',';
IF @EnableBackupJobs = 1
BEGIN
SET @job_sql = @job_sql + ' @enabled = 1; ';
END
ELSE
BEGIN
SET @job_sql = @job_sql + ' @enabled = 0; ';
END
SET @job_sql = @job_sql + '
EXEC msdb.dbo.sp_add_jobstep @job_name = ' + @job_name_backups + ',
@step_name = ' + @job_name_backups + ',
@subsystem = ''TSQL'',
@command = ' + @job_command_backups + ';
EXEC msdb.dbo.sp_add_jobserver @job_name = ' + @job_name_backups + ';
EXEC msdb.dbo.sp_attach_schedule @job_name = ' + @job_name_backups + ',
@schedule_name = ten_seconds;
';
SET @counter += 1;
IF @Debug = 1
BEGIN
RAISERROR(@job_sql, 0, 1) WITH NOWAIT;
END;
IF @job_sql IS NULL
BEGIN
RAISERROR('@job_sql is NULL for some reason', 0, 1) WITH NOWAIT;
END;
EXEC sp_executesql @job_sql;
END;
/*
This section creates @Jobs (quantity) of worker jobs to restore logs with
They too work in a queue
Like a queue-t 3.14
*/
RAISERROR('Checking for sp_AllNightLog Restore jobs', 0, 1) WITH NOWAIT;
SELECT @counter = COUNT(*) + 1
FROM msdb.dbo.sysjobs
WHERE name LIKE 'sp[_]AllNightLog[_]Restore[_]%';
SET @msg = 'Found ' + CONVERT(NVARCHAR(10), (@counter - 1)) + ' restore jobs -- ' + CASE WHEN @counter < @Jobs THEN + 'starting loop!'
WHEN @counter >= @Jobs THEN 'skipping loop!'
ELSE 'Oh woah something weird happened!'
END;
RAISERROR(@msg, 0, 1) WITH NOWAIT;
WHILE @counter <= @Jobs
BEGIN
RAISERROR('Setting job name', 0, 1) WITH NOWAIT;
SET @job_name_restores = N'sp_AllNightLog_Restore_' + CASE WHEN @counter < 10 THEN N'0' + CONVERT(NVARCHAR(10), @counter)
WHEN @counter >= 10 THEN CONVERT(NVARCHAR(10), @counter)
END;
RAISERROR('Setting @job_sql', 0, 1) WITH NOWAIT;
SET @job_sql = N'
EXEC msdb.dbo.sp_add_job @job_name = ' + @job_name_restores + ',
@description = ' + @job_description_restores + ',
@category_name = ' + @job_category + ',
@owner_login_name = ' + @job_owner + ',';
IF @EnableRestoreJobs = 1
BEGIN
SET @job_sql = @job_sql + ' @enabled = 1; ';
END
ELSE
BEGIN
SET @job_sql = @job_sql + ' @enabled = 0; ';
END
SET @job_sql = @job_sql + '
EXEC msdb.dbo.sp_add_jobstep @job_name = ' + @job_name_restores + ',
@step_name = ' + @job_name_restores + ',
@subsystem = ''TSQL'',
@command = ' + @job_command_restores + ';
EXEC msdb.dbo.sp_add_jobserver @job_name = ' + @job_name_restores + ';
EXEC msdb.dbo.sp_attach_schedule @job_name = ' + @job_name_restores + ',
@schedule_name = ten_seconds;
';
SET @counter += 1;
IF @Debug = 1
BEGIN
RAISERROR(@job_sql, 0, 1) WITH NOWAIT;
END;
IF @job_sql IS NULL
BEGIN
RAISERROR('@job_sql is NULL for some reason', 0, 1) WITH NOWAIT;
END;
EXEC sp_executesql @job_sql;
END;
RAISERROR('Setup complete!', 0, 1) WITH NOWAIT;
END; --End for the Agent job creation
END;--End for Database and Table creation
END TRY
BEGIN CATCH
SELECT @msg = N'Error occurred during setup: ' + CONVERT(NVARCHAR(10), ERROR_NUMBER()) + ', error message is ' + ERROR_MESSAGE(),
@error_severity = ERROR_SEVERITY(),
@error_state = ERROR_STATE();
RAISERROR(@msg, @error_severity, @error_state) WITH NOWAIT;
WHILE @@TRANCOUNT > 0
ROLLBACK;
END CATCH;
END; /* IF @RunSetup = 1 */
RETURN;
UpdateConfigs:
IF @UpdateSetup = 1
BEGIN
/* If we're enabling backup jobs, we may need to run restore with recovery on msdbCentral to bring it online: */
IF @EnableBackupJobs = 1 AND EXISTS (SELECT * FROM sys.databases WHERE name = 'msdbCentral' AND state = 1)
BEGIN
RAISERROR('msdbCentral exists, but is in restoring state. Running restore with recovery...', 0, 1) WITH NOWAIT;
BEGIN TRY
RESTORE DATABASE [msdbCentral] WITH RECOVERY;
END TRY
BEGIN CATCH
SELECT @error_number = ERROR_NUMBER(),
@error_severity = ERROR_SEVERITY(),
@error_state = ERROR_STATE();
SELECT @msg = N'Error running restore with recovery on msdbCentral, error number is ' + CONVERT(NVARCHAR(10), ERROR_NUMBER()) + ', error message is ' + ERROR_MESSAGE(),
@error_severity = ERROR_SEVERITY(),
@error_state = ERROR_STATE();
RAISERROR(@msg, @error_severity, @error_state) WITH NOWAIT;
END CATCH;
END
/* Only check for this after trying to restore msdbCentral: */
IF @EnableBackupJobs = 1 AND NOT EXISTS (SELECT * FROM sys.databases WHERE name = 'msdbCentral' AND state = 0)
BEGIN
RAISERROR('msdbCentral is not online. Repair that first, then try to enable backup jobs.', 0, 1) WITH NOWAIT;
RETURN
END
IF OBJECT_ID('msdbCentral.dbo.backup_configuration') IS NOT NULL
RAISERROR('Found backup config, checking variables...', 0, 1) WITH NOWAIT;
BEGIN
BEGIN TRY
IF @RPOSeconds IS NOT NULL
BEGIN
RAISERROR('Attempting to update RPO setting', 0, 1) WITH NOWAIT;
UPDATE c
SET c.configuration_setting = CONVERT(NVARCHAR(10), @RPOSeconds)
FROM msdbCentral.dbo.backup_configuration AS c
WHERE c.configuration_name = N'log backup frequency';
END;
IF @BackupPath IS NOT NULL
BEGIN
RAISERROR('Attempting to update Backup Path setting', 0, 1) WITH NOWAIT;
UPDATE c
SET c.configuration_setting = @BackupPath
FROM msdbCentral.dbo.backup_configuration AS c
WHERE c.configuration_name = N'log backup path';
END;
END TRY
BEGIN CATCH
SELECT @error_number = ERROR_NUMBER(),
@error_severity = ERROR_SEVERITY(),
@error_state = ERROR_STATE();
SELECT @msg = N'Error updating backup configuration setting, error number is ' + CONVERT(NVARCHAR(10), ERROR_NUMBER()) + ', error message is ' + ERROR_MESSAGE(),
@error_severity = ERROR_SEVERITY(),
@error_state = ERROR_STATE();
RAISERROR(@msg, @error_severity, @error_state) WITH NOWAIT;
END CATCH;
END;
IF OBJECT_ID('msdb.dbo.restore_configuration') IS NOT NULL
RAISERROR('Found restore config, checking variables...', 0, 1) WITH NOWAIT;
BEGIN
BEGIN TRY
EXEC msdb.dbo.sp_update_schedule @name = ten_seconds, @active_start_date = @active_start_date, @active_start_time = 000000;
IF @EnableRestoreJobs IS NOT NULL
BEGIN
RAISERROR('Changing restore job status based on @EnableBackupJobs parameter...', 0, 1) WITH NOWAIT;
INSERT INTO @jobs_to_change(name)
SELECT name
FROM msdb.dbo.sysjobs
WHERE name LIKE 'sp_AllNightLog_Restore%' OR name = 'sp_AllNightLog_PollDiskForNewDatabases';
DECLARE jobs_cursor CURSOR FOR
SELECT name
FROM @jobs_to_change
OPEN jobs_cursor
FETCH NEXT FROM jobs_cursor INTO @current_job_name
WHILE @@FETCH_STATUS = 0
BEGIN
RAISERROR(@current_job_name, 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_update_job @job_name=@current_job_name,@enabled = @EnableRestoreJobs;
FETCH NEXT FROM jobs_cursor INTO @current_job_name
END
CLOSE jobs_cursor
DEALLOCATE jobs_cursor
DELETE @jobs_to_change;
END;
/* If they wanted to turn off restore jobs, wait to make sure that finishes before we start enabling the backup jobs */
IF @EnableRestoreJobs = 0
BEGIN
SET @started_waiting_for_jobs = GETDATE();
SELECT @counter = COUNT(*)
FROM [msdb].[dbo].[sysjobactivity] [ja]
INNER JOIN [msdb].[dbo].[sysjobs] [j]
ON [ja].[job_id] = [j].[job_id]
WHERE [ja].[session_id] = (
SELECT TOP 1 [session_id]
FROM [msdb].[dbo].[syssessions]
ORDER BY [agent_start_date] DESC
)
AND [start_execution_date] IS NOT NULL
AND [stop_execution_date] IS NULL
AND [j].[name] LIKE 'sp_AllNightLog_Restore%';
WHILE @counter > 0
BEGIN
IF DATEADD(SS, 120, @started_waiting_for_jobs) < GETDATE()
BEGIN
RAISERROR('OH NOES! We waited 2 minutes and restore jobs are still running. We are stopping here - get a meatbag involved to figure out if restore jobs need to be killed, and the backup jobs will need to be enabled manually.', 16, 1) WITH NOWAIT;
RETURN
END
SET @msg = N'Waiting for ' + CAST(@counter AS NVARCHAR(100)) + N' sp_AllNightLog_Restore job(s) to finish.'
RAISERROR(@msg, 0, 1) WITH NOWAIT;
WAITFOR DELAY '0:00:01'; -- Wait until the restore jobs are fully stopped
SELECT @counter = COUNT(*)
FROM [msdb].[dbo].[sysjobactivity] [ja]
INNER JOIN [msdb].[dbo].[sysjobs] [j]
ON [ja].[job_id] = [j].[job_id]
WHERE [ja].[session_id] = (
SELECT TOP 1 [session_id]
FROM [msdb].[dbo].[syssessions]
ORDER BY [agent_start_date] DESC
)
AND [start_execution_date] IS NOT NULL
AND [stop_execution_date] IS NULL
AND [j].[name] LIKE 'sp_AllNightLog_Restore%';
END
END /* IF @EnableRestoreJobs = 0 */
IF @EnableBackupJobs IS NOT NULL
BEGIN
RAISERROR('Changing backup job status based on @EnableBackupJobs parameter...', 0, 1) WITH NOWAIT;
INSERT INTO @jobs_to_change(name)
SELECT name
FROM msdb.dbo.sysjobs
WHERE name LIKE 'sp_AllNightLog_Backup%' OR name = 'sp_AllNightLog_PollForNewDatabases';
DECLARE jobs_cursor CURSOR FOR
SELECT name
FROM @jobs_to_change
OPEN jobs_cursor
FETCH NEXT FROM jobs_cursor INTO @current_job_name
WHILE @@FETCH_STATUS = 0
BEGIN
RAISERROR(@current_job_name, 0, 1) WITH NOWAIT;
EXEC msdb.dbo.sp_update_job @job_name=@current_job_name,@enabled = @EnableBackupJobs;
FETCH NEXT FROM jobs_cursor INTO @current_job_name
END
CLOSE jobs_cursor
DEALLOCATE jobs_cursor
DELETE @jobs_to_change;
END;
IF @RTOSeconds IS NOT NULL
BEGIN
RAISERROR('Attempting to update RTO setting', 0, 1) WITH NOWAIT;
UPDATE c
SET c.configuration_setting = CONVERT(NVARCHAR(10), @RTOSeconds)
FROM msdb.dbo.restore_configuration AS c
WHERE c.configuration_name = N'log restore frequency';
END;
IF @RestorePath IS NOT NULL
BEGIN
RAISERROR('Attempting to update Restore Path setting', 0, 1) WITH NOWAIT;
UPDATE c
SET c.configuration_setting = @RestorePath
FROM msdb.dbo.restore_configuration AS c
WHERE c.configuration_name = N'log restore path';
END;
END TRY
BEGIN CATCH
SELECT @error_number = ERROR_NUMBER(),
@error_severity = ERROR_SEVERITY(),
@error_state = ERROR_STATE();
SELECT @msg = N'Error updating restore configuration setting, error number is ' + CONVERT(NVARCHAR(10), ERROR_NUMBER()) + ', error message is ' + ERROR_MESSAGE(),
@error_severity = ERROR_SEVERITY(),
@error_state = ERROR_STATE();
RAISERROR(@msg, @error_severity, @error_state) WITH NOWAIT;
END CATCH;
END;
RAISERROR('Update complete!', 0, 1) WITH NOWAIT;
RETURN;
END; --End updates to configuration table
END; -- Final END for stored proc
GO
|
; Original CornellBox converted to PearRay format
(scene
:name 'cornellbox'
:render_width 256
:render_height 256
:camera 'Camera'
; Settings
(integrator
:type 'direct'
:max_ray_depth 16
:max_camera_ray_depth 4
:max_light_ray_depth 4
:mis 'power'
:contract_ratio 0.2
:max_light_ray_depth 16
:soft_max_light_ray_depth 6
)
(sampler
:slot 'aa'
:type 'mjitt'
:sample_count 128
)
; Outputs
(output
:name 'image'
(channel :type 'color' :color 'srgb' )
(channel :type 'var')
)
; Camera
(camera
:name 'Camera'
:type 'standard'
:width 0.720000
:height 0.720000
:local_direction [0,0,-1]
:local_up [0,1,0]
:local_right [1,0,0]
:near 0.100000
:far 100.000000
:transform [1.0,0.0,0.0,0.0,0.0,0.0,-1.0,-3.93462872505188,0.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0]
)
; Lights
;(light
; :name 'sky'
; :type 'sky'
; :turbidity 3
;)
(emission
:name 'light_em'
:type 'standard'
:radiance (smul (illuminant "D65") (illum 17 12 4))
)
; Materials
(material
:name 'backWall'
:type 'diffuse'
:albedo (refl 0.725000 0.710000 0.680000)
)
(material
:name 'ceiling'
:type 'diffuse'
:albedo (refl 0.725000 0.710000 0.680000)
)
(material
:name 'floor'
:type 'diffuse'
:albedo (refl 0.725000 0.710000 0.680000)
)
(material
:name 'leftWall'
:type 'diffuse'
:albedo (refl 0.630000 0.065000 0.050000)
)
(material
:name 'light'
:type 'diffuse'
:albedo (refl 0.780000 0.780000 0.780000)
)
(material
:name 'rightWall'
:type 'diffuse'
:albedo (refl 0.140000 0.450000 0.091000)
)
(material
:name 'shortBox'
:type 'glass'
:index (lookup_index "bk7")
:roughness 0.02
)
(material
:name 'tallBox'
:type 'glass'
:index (lookup_index "bk7")
)
(include "cornellbox_mesh.prc.inc")
)
|
--
-- Version: Each entry records a credit/debit transaction. Supports Azure SQL Server.
-- URL: http://ostlog.org/schema/Payments_log.json
--
CREATE TABLE [dbo].[Payments log]
(
[id] INT IDENTITY (1,1) NOT NULL,
[meta_id] INT NULL,
[calendar_date_id] INT DEFAULT CONVERT (char(8), GETDATE(), 112) NOT NULL,
[timestamp] TIME(0) NULL,
[location_id] INT NULL,
[payer_id] INT NOT NULL,
[payee_id] INT NULL,
[payment_type] NVARCHAR(10) NOT NULL,
[item_description] NVARCHAR(1000) NOT NULL,
[item_category] NVARCHAR(100) NOT NULL,
[amount_usd] FLOAT NOT NULL,
[amount_euro] FLOAT NULL,
[remarks] NVARCHAR(2056) NULL,
CONSTRAINT [PK Payments log] PRIMARY KEY ([id]),
CONSTRAINT [FK Payments log-Calendar dates] FOREIGN KEY ([calendar_date_id]) REFERENCES [dbo].[Calendar dates] ([date_id]),
CONSTRAINT [FK Payments log-People1] FOREIGN KEY ([payer_id]) REFERENCES [dbo].[People] ([id]),
CONSTRAINT [FK Payments log-People2] FOREIGN KEY ([payee_id]) REFERENCES [dbo].[People] ([id]),
CONSTRAINT [FK_Payments log-Meta log] FOREIGN KEY ([meta_id]) REFERENCES [dbo].[Meta log] ([id]),
CHECK ([payment_type]='credit' OR [payment_type]='debit'),
CHECK ([item_category]='arts' OR [item_category]='transport' OR [item_category]='xfer' OR [item_category]='bills' OR [item_category]='projects' OR [item_category]='cash' OR [item_category]='credit-payment' OR [item_category]='education' OR [item_category]='entertainment' OR [item_category]='fees' OR [item_category]='food' OR [item_category]='gifts' OR [item_category]='health' OR [item_category]='home' OR [item_category]='income' OR [item_category]='kids' OR [item_category]='loan' OR [item_category]='loan-payment' OR [item_category]='mortgage-rent' OR [item_category]='shopping' OR [item_category]='taxes' OR [item_category]='travel')
)
|
CREATE PROCEDURE [Pttcd].[RefreshFindACourseIndex]
@CourseRunIds [Pttcd].[GuidIdTable] READONLY,
@Now DATETIME
AS
BEGIN
WITH RecordsCte AS (
SELECT
-- Id is the CourseRun's ID appended with the Region, if there is one
CONVERT(VARCHAR(36), cr.CourseRunId) + CASE WHEN crr.RegionId IS NOT NULL THEN '-' + crr.RegionId ELSE '' END AS Id,
1 AS OfferingType, -- Course
c.CourseId,
cr.CourseRunId,
cr.UpdatedOn,
p.ProviderId,
CASE WHEN p.DisplayNameSource = 1 /* TradingName */ THEN ISNULL(NULLIF(p.Alias, ''), p.ProviderName) ELSE p.ProviderName END AS ProviderDisplayName,
c.ProviderUkprn,
ld.LearnAimRefTitle QualificationCourseTitle,
c.LearnAimRef,
ld.NotionalNVQLevelv2,
c.CourseDescription,
cr.CourseName,
cr.DeliveryMode,
cr.FlexibleStartDate,
cr.StartDate,
cr.Cost,
cr.CostDescription,
cr.DurationUnit,
cr.DurationValue,
CASE WHEN cr.DeliveryMode = 1 THEN cr.StudyMode ELSE null END StudyMode,
CASE WHEN cr.DeliveryMode = 1 THEN cr.AttendancePattern ELSE null END AttendancePattern,
CASE WHEN cr.DeliveryMode = 2 THEN 1 ELSE cr.[National] END AS [National], -- Treat Online as National for the purposes of searching
v.VenueName,
STUFF(
CONCAT(
NULLIF(', ' + v.AddressLine1, ', '),
NULLIF(', ' + v.AddressLine2, ', '),
NULLIF(', ' + v.Town, ', '),
NULLIF(', ' + v.County, ', '),
NULLIF(', ' + v.Postcode, ', ')),
1, 2, NULL) AS VenueAddress,
v.Town AS VenueTown,
COALESCE(v.Position, r.Position) AS Position,
CASE WHEN r.Name IS NOT NULL THEN r.Name WHEN cr.[National] = 1 OR cr.DeliveryMode = 2 THEN 'National' ELSE '' END AS RegionName,
-- Magic numbers and logic from https://github.com/SkillsFundingAgency/dfc-providerportal-changefeedlistener/commit/608340dcfaa5c74ee8b1ae422ad902ee0c529c01#diff-5f9ef9c9ca0b0bc9af8b5c7926cfcfe31fa7e8367b9104357104ad568fbe0302R103-R104
CAST(CASE
WHEN r.RegionId IS NULL THEN 1
WHEN r.ParentRegionId IS NOT NULL THEN 4.5 -- Sub region
ELSE 2.3 -- Region
END AS float) AS ScoreBoost,
v.VenueId,
cc.CampaignCodesJson CampaignCodes,
c.DataIsHtmlEncoded CourseDataIsHtmlEncoded,
cr.DataIsHtmlEncoded CourseRunDataIsHtmlEncoded
FROM @CourseRunIds d
INNER JOIN Pttcd.CourseRuns cr ON d.Id = cr.CourseRunId
INNER JOIN Pttcd.Courses c ON cr.CourseId = c.CourseId
LEFT JOIN Pttcd.CourseRunSubRegions crr ON cr.CourseRunId = crr.CourseRunId AND cr.DeliveryMode = 3 AND cr.[National] = 0
LEFT JOIN Pttcd.Regions r ON crr.RegionId = r.RegionId
INNER JOIN Pttcd.Providers p ON c.ProviderUkprn = p.Ukprn
INNER JOIN LARS.LearningDelivery ld ON c.LearnAimRef = ld.LearnAimRef
LEFT JOIN Pttcd.Venues v ON cr.VenueId = v.VenueId
LEFT JOIN Pttcd.FindACourseIndexCampaignCodes cc ON p.ProviderId = cc.ProviderId AND c.LearnAimRef = cc.LearnAimRef
WHERE cr.CourseRunStatus = 1 -- Live
)
MERGE Pttcd.FindACourseIndex AS target
USING (SELECT * FROM RecordsCte) AS source
ON source.Id = target.Id
WHEN MATCHED THEN UPDATE SET
LastSynced = @Now,
OfferingType = source.OfferingType,
CourseId = source.CourseId,
CourseRunId = source.CourseRunId,
Live = 1,
UpdatedOn = source.UpdatedOn,
ProviderId = source.ProviderId,
ProviderDisplayName = source.ProviderDisplayName,
ProviderUkprn = source.ProviderUkprn,
QualificationCourseTitle = source.QualificationCourseTitle,
LearnAimRef = source.LearnAimRef,
NotionalNVQLevelv2 = source.NotionalNVQLevelv2,
CourseDescription = source.CourseDescription,
CourseName = source.CourseName,
DeliveryMode = source.DeliveryMode,
FlexibleStartDate = source.FlexibleStartDate,
StartDate = source.StartDate,
Cost = source.Cost,
CostDescription = source.CostDescription,
DurationUnit = source.DurationUnit,
DurationValue = source.DurationValue,
StudyMode = source.StudyMode,
AttendancePattern = source.AttendancePattern,
[National] = source.[National],
VenueName = source.VenueName,
VenueAddress = source.VenueAddress,
VenueTown = source.VenueTown,
Position = source.Position,
RegionName = source.RegionName,
ScoreBoost = source.ScoreBoost,
VenueId = source.VenueId,
CampaignCodes = source.CampaignCodes,
CourseDataIsHtmlEncoded = source.CourseDataIsHtmlEncoded,
CourseRunDataIsHtmlEncoded = source.CourseRunDataIsHtmlEncoded
WHEN NOT MATCHED THEN INSERT (
Id,
LastSynced,
OfferingType,
CourseId,
CourseRunId,
Live,
UpdatedOn,
ProviderId,
ProviderDisplayName,
ProviderUkprn,
QualificationCourseTitle,
LearnAimRef,
NotionalNVQLevelv2,
CourseDescription,
CourseName,
DeliveryMode,
FlexibleStartDate,
StartDate,
Cost,
CostDescription,
DurationUnit,
DurationValue,
StudyMode,
AttendancePattern,
[National],
VenueName,
VenueAddress,
VenueTown,
Position,
RegionName,
ScoreBoost,
VenueId,
CampaignCodes,
CourseDataIsHtmlEncoded,
CourseRunDataIsHtmlEncoded)
VALUES (
source.Id,
@Now,
source.OfferingType,
source.CourseId,
source.CourseRunId,
1,
source.UpdatedOn,
source.ProviderId,
source.ProviderDisplayName,
source.ProviderUkprn,
source.QualificationCourseTitle,
source.LearnAimRef,
source.NotionalNVQLevelv2,
source.CourseDescription,
source.CourseName,
source.DeliveryMode,
source.FlexibleStartDate,
source.StartDate,
source.Cost,
source.CostDescription,
source.DurationUnit,
source.DurationValue,
source.StudyMode,
source.AttendancePattern,
source.[National],
source.VenueName,
source.VenueAddress,
source.VenueTown,
source.Position,
source.RegionName,
source.ScoreBoost,
source.VenueId,
source.CampaignCodes,
source.CourseDataIsHtmlEncoded,
source.CourseRunDataIsHtmlEncoded)
WHEN NOT MATCHED BY SOURCE AND target.CourseRunId IN (SELECT Id FROM @CourseRunIds) THEN UPDATE SET
Live = 0,
LastSynced = @Now;
END
|
<reponame>Kahiko/Growthware<filename>SQLServer/2005/GrowthWareDB/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ZFP_SET_FUNCTION_RLS.proc.sql
CREATE PROCEDURE [ZFP_SET_FUNCTION_RLS](
@P_FUNCTION_SEQ_ID INT,
@P_SE_SEQ_ID INT,
@P_ROLES VARCHAR(1000),
@P_PERMISSIONS_SEQ_ID INT,
@P_ADDUPD_BY INT,
@P_ErrorCode int OUTPUT
)
AS
BEGIN TRAN
-- NEED TO DELETE EXISTING ROLE ASSOCITAED WITH THE FUNCTION BEFORE
-- INSERTING NEW ONES.
EXEC ZFP_DEL_FUNCTION_RL_SECURITY @P_FUNCTION_SEQ_ID,@P_SE_SEQ_ID,@P_PERMISSIONS_SEQ_ID,@P_ADDUPD_BY,@P_ErrorCode
DECLARE @V_ROLE_SEQ_ID AS INT
DECLARE @V_SE_RLS_SECURITY_ID AS INT
DECLARE @V_ROLE_NAME AS VARCHAR(50)
DECLARE @V_Pos AS INT
SET @P_ROLES = LTRIM(RTRIM(@P_ROLES))+ ','
SET @V_Pos = CHARINDEX(',', @P_ROLES, 1)
IF REPLACE(@P_ROLES, ',', '') <> ''
WHILE @V_Pos > 0
BEGIN
SET @V_ROLE_NAME = LTRIM(RTRIM(LEFT(@P_ROLES, @V_Pos - 1)))
IF @V_ROLE_NAME <> ''
BEGIN
--select the role seq id first
SELECT @V_ROLE_SEQ_ID = ZFC_SECURITY_RLS.ROLE_SEQ_ID
FROM ZFC_SECURITY_RLS
WHERE [NAME]=@V_ROLE_NAME
SELECT
@V_SE_RLS_SECURITY_ID=RLS_SE_SEQ_ID
FROM
ZFC_SECURITY_RLS_SE
WHERE
ROLE_SEQ_ID = @V_ROLE_SEQ_ID AND
SE_SEQ_ID = @P_SE_SEQ_ID
--PRINT('@V_SE_RLS_SECURITY_ID = ' + CONVERT(VARCHAR,@V_SE_RLS_SECURITY_ID))
IF NOT EXISTS(
SELECT
RLS_SE_SEQ_ID
FROM
ZFC_SECURITY_FUNCT_RLS
WHERE
FUNCTION_SEQ_ID = @P_FUNCTION_SEQ_ID
AND PERMISSIONS_NVP_SEQ_DET_ID = @P_PERMISSIONS_SEQ_ID
AND RLS_SE_SEQ_ID = @V_SE_RLS_SECURITY_ID
)
BEGIN
--PRINT('INSERT RECORD')
INSERT ZFC_SECURITY_FUNCT_RLS (
FUNCTION_SEQ_ID,
RLS_SE_SEQ_ID,
PERMISSIONS_NVP_SEQ_DET_ID,
ADDED_BY
)
VALUES (
@P_FUNCTION_SEQ_ID,
@V_SE_RLS_SECURITY_ID,
@P_PERMISSIONS_SEQ_ID,
@P_ADDUPD_BY
)
END
END
SET @P_ROLES = RIGHT(@P_ROLES, LEN(@P_ROLES) - @V_Pos)
SET @V_Pos = CHARINDEX(',', @P_ROLES, 1)
SELECT @P_ErrorCode = @@error
END
SELECT @P_ErrorCode = @@error
IF @P_ErrorCode <> 0 GOTO ABEND
COMMIT TRAN
ABEND:
IF @P_ErrorCode <> 0
BEGIN
PRINT 'Yikes!'
ROLLBACK TRAN
END
|
SELECT DISTINCT
country_id AS id,
commodity_id,
nodes.id AS node_id,
nodes.context_node_type_id,
year,
iso2,
TRIM(countries.name) AS name,
TO_TSVECTOR('simple', COALESCE(TRIM(countries.name)::TEXT, '')) AS name_tsvector,
profiles.name AS profile
FROM nodes_with_flows_per_year nodes
JOIN countries ON countries.id = country_id
JOIN context_properties ON context_properties.context_id = nodes.context_id
LEFT JOIN profiles ON nodes.context_node_type_id = profiles.context_node_type_id
WHERE NOT is_unknown AND NOT context_properties.is_disabled;
|
<reponame>CarlosSalda/taskcafe
ALTER TABLE project DROP CONSTRAINT project_team_id_fkey;
ALTER TABLE project
ADD CONSTRAINT project_team_id_fkey
FOREIGN KEY (team_id)
REFERENCES team(team_id)
ON DELETE CASCADE;
|
-- delete temp tables
DROP TABLE bcfishpass.pscis_events_prelim1;
DROP TABLE bcfishpass.pscis_events_prelim2;
DROP TABLE bcfishpass.pscis_events_prelim3;
DROP TABLE bcfishpass.pscis_model_match_pts;
|
USE [RailML_3_1]
GO
INSERT [dbo].[TOnOff] ([TOnOffId], [Value]) VALUES (1, N'Both')
GO
INSERT [dbo].[TOnOff] ([TOnOffId], [Value]) VALUES (2, N'On')
GO
INSERT [dbo].[TOnOff] ([TOnOffId], [Value]) VALUES (3, N'Off')
GO
|
<filename>sql/reports/report_login_status.sql
set feedback off
set pagesize 9999
set linesize 9999
column USERNAME format A20
column ACCOUNT_STATUS format A20
column "DAY RANGE" format A20
column PROFILE format A20
DEFINE DAY_RANGE=7
ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT ='MM/DD/YYYY HH24:MI:SS TZR TZD';
ALTER SESSION SET NLS_DATE_FORMAT ='MM-DD-YYYY HH24:MI:SS';
-- accounts expiring in N days from now or due to expire already
-- account that are past expiry_date but still open
-- There is no process that combs through accounts to reset
-- their status vis a vis expiry date. The next time scott logs on his status will be updated accordingly,
-- and the grace period will begin
select
SYSDATE as CURRENT_DT
,CAST(SYS_CONTEXT('USERENV','SERVER_HOST') as VARCHAR2(15)) as "HOST"
,CAST(SYS_CONTEXT('USERENV','DB_NAME') as VARCHAR2(10)) as "DBNAME"
,'&DAY_RANGE' as "DAY RANGE"
,USERNAME, ACCOUNT_STATUS, LOCK_DATE, EXPIRY_DATE
from DBA_USERS
where
EXPIRY_DATE < SYSDATE + &DAY_RANGE
AND
account_status IN ('OPEN', 'EXPIRED(GRACE)' )
AND
LOCK_DATE IS NULL
order by EXPIRY_DATE desc;
select
SYSDATE as CURRENT_DT
,CAST(SYS_CONTEXT('USERENV','SERVER_HOST') as VARCHAR2(15)) as "HOST"
,CAST(SYS_CONTEXT('USERENV','DB_NAME') as VARCHAR2(10)) as "DBNAME"
,USERNAME, ACCOUNT_STATUS, LOCK_DATE, EXPIRY_DATE, PROFILE
from DBA_USERS
order by ACCOUNT_STATUS;
|
INSERT INTO USER (ID, NAME, EMAIL, ROLE) VALUES (1, 'Samuel', '<EMAIL>', 'user,network');
INSERT INTO USER (ID, NAME, EMAIL, ROLE) VALUES (2, 'Roger', '<EMAIL>', 'user');
INSERT INTO USER (ID, NAME, EMAIL, ROLE) VALUES (3, 'Sid', '<EMAIL>', 'user');
INSERT INTO USER (ID, NAME, EMAIL, ROLE) VALUES (4, 'Tammy', '<EMAIL>', 'user');
INSERT INTO BOOK (ID, NAME, AUTHOR, ISBN) VALUES (1, '<NAME> 1', 'JK Rowling', '987316');
INSERT INTO BOOK (ID, NAME, AUTHOR, ISBN) VALUES (2, '<NAME> 2', 'JK Rowling', '672345');
INSERT INTO BOOK (ID, NAME, AUTHOR, ISBN) VALUES (3, 'Lord of the Rings', 'JR TOKIEN', '712312');
--Samuel reserve Harry Porter 1
--INSERT INTO RESERVATION (BOOK_ID, USER_ID) VALUES (1, 1);
--Samuel reserve Harry Porter 2
--INSERT INTO RESERVATION (BOOK_ID, USER_ID) VALUES (2, 1);
--INSERT INTO ISSUE (ACCT_NO, NAME, DATE_ISSUE, TIME_ISSUE, DATE_RETURN, TIME_RETURN, REG_NO) VALUES (001, 'Samuel', '30:03:2020', '11:30','10:04:2020,'11:00','12326');
--INSERT INTO ISSUE (ACCT_NO, NAME, DATE_ISSUE, TIME_ISSUE, DATE_RETURN, TIME_RETURN, REG_NO) VALUES (002, 'Sid', '30:03:2020', '11:30','10:04:2020,'11:00','12327');
--INSERT INTO ISSUE (ACCT_NO, NAME, DATE_ISSUE, TIME_ISSUE, DATE_RETURN, TIME_RETURN, REG_NO) VALUES (003, 'Tammy', '30:03:2020', '11:30','10:04:2020,'11:00','12328');
--
--INSERT INTO RETURN (REG_NO, NAME, DATE_RETURN, TIME_RETURN, DATE_ISSUE, TIME_ISSUE, ACCT_NO) VALUES (12326, 'Samuel', '30:03:2020', '11:00','10:04:2020,'11:30','001');
--INSERT INTO RETURN (REG_NO, NAME, DATE_RETURN, TIME_RETURN, DATE_ISSUE, TIME_ISSUE, ACCT_NO) VALUES (12327, 'Sid', '30:03:2020', '11:00','10:04:2020,'11:30','002');
--INSERT INTO RETURN (REG_NO, NAME, DATE_RETURN, TIME_RETURN, DATE_ISSUE, TIME_iSSUE, ACCT_NO) VALUES (12328, 'Tammy', '30:03:2020', '11:00','10:04:2020,'11:30','003');
|
update users set completed = 'Y';
commit;
|
<gh_stars>1-10
CREATE DATABASE userstor
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Russian_Russia.1251'
LC_CTYPE = 'Russian_Russia.1251'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
|
<reponame>joshlong/bootiful-gcp
drop table if exists reservations ;
create table reservations (
id bigint not null auto_increment primary key,
reservation_name varchar(255) not null
);
|
<reponame>discendum/salava
--name: select-user-badge-by-assertion-url
SELECT ub.id AS user_badge_id, bc.name, bc.image_file, ub.issued_on, ub.status, ub.deleted FROM user_badge AS ub
JOIN badge AS badge ON (badge.id = ub.badge_id)
JOIN badge_badge_content AS bbc ON (bbc.badge_id = badge.id)
JOIN badge_content AS bc ON (bc.id = bbc.badge_content_id AND bc.language_code = badge.default_language_code)
WHERE (ub.assertion_url = :assertion_url OR ub.assertion_url LIKE :p) AND ub.revoked = 0
ORDER BY ctime DESC
--name: select-user-badge-by-id
SELECT id, assertion_url FROM user_badge WHERE id = :id AND revoked = 0
--name: select-completed-metabadges
SELECT ubm.meta_badge AS metabadge_id, ubm.user_badge_id, fm.min_required, fm.name, bc.description, bc.image_file, cc.markdown_text AS criteria_content
FROM user_badge_metabadge AS ubm
JOIN user_badge AS ub ON (ubm.user_badge_id = ub.id)
JOIN factory_metabadge AS fm ON (fm.id = ubm.meta_badge)
JOIN badge AS badge ON (badge.id = ub.badge_id)
JOIN badge_badge_content AS bbc ON (bbc.badge_id = badge.id)
JOIN badge_content AS bc ON (bc.id = bbc.badge_content_id AND bc.language_code = badge.default_language_code)
JOIN badge_criteria_content AS bcc ON (bcc.badge_id = badge.id)
JOIN criteria_content AS cc ON (cc.id = bcc.criteria_content_id AND cc.language_code = badge.default_language_code)
JOIN user as u on (u.id = ub.user_id)
WHERE u.id = :user_id AND ub.revoked = 0
GROUP BY fm.id
--name: select-received-required-badges
SELECT fmr.metabadge_id, fmr.required_badge_id, ubm.user_badge_id, bc.name, bc.image_file, ub.issued_on, ub.status, ub.deleted
FROM user_badge_metabadge AS ubm
JOIN user_badge AS ub ON (ubm.user_badge_id = ub.id)
JOIN factory_metabadge_required AS fmr ON (ubm.meta_badge_req = fmr.required_badge_id)
JOIN badge AS badge ON (badge.id = ub.badge_id)
JOIN badge_badge_content AS bbc ON (bbc.badge_id = badge.id)
JOIN badge_content AS bc ON (bc.id = bbc.badge_content_id AND bc.language_code = badge.default_language_code)
JOIN user as u on (u.id = ub.user_id)
WHERE fmr.metabadge_id = :metabadge_id AND u.id = :user_id AND ub.revoked = 0
GROUP BY ub.id
ORDER BY ub.issued_on ASC
--name: select-all-required-badges
SELECT metabadge_id, required_badge_id, name, description, criteria AS criteria_content, image_file, application_url, not_before, not_after
FROM factory_metabadge_required
WHERE metabadge_id = :metabadge_id;
--name: select-user-required-badges
SELECT ub.id, ubm.meta_badge_req from user_badge AS ub
JOIN user_badge_metabadge as ubm on (ubm.user_badge_id = ub.id)
JOIN user as u on (u.id = ub.user_id)
where u.id = :user_id
GROUP BY ubm.meta_badge_req
--name: select-all-user-metabadges
SELECT fm.id AS metabadge_id, fm.min_required, fm.name, fm.description, fm.image_file, fm.criteria AS criteria_content
FROM user_badge as ub
JOIN user_badge_metabadge as ubm on (ubm.user_badge_id = ub.id)
JOIN factory_metabadge_required as fmr on (fmr.required_badge_id = ubm.meta_badge_req)
JOIN factory_metabadge as fm on (fm.id = fmr.metabadge_id)
JOIN user as u on (u.id = ub.user_id)
WHERE u.id = :user_id
GROUP BY fm.id
--name: select-metabadge-info-from-user-badge
--check if user badge is a milestone badge or a required badge
SELECT meta_badge, meta_badge_req FROM user_badge_metabadge AS ubm WHERE ubm.user_badge_id = :id
--name: select-completed-metabadge-by-badge-id
SELECT ubm.meta_badge AS metabadge_id, ubm.user_badge_id, fm.min_required, fm.name, bc.description, bc.image_file, cc.markdown_text AS criteria_content
FROM user_badge_metabadge AS ubm
JOIN user_badge AS ub ON (ubm.user_badge_id = ub.id)
JOIN factory_metabadge AS fm ON (fm.id = ubm.meta_badge)
JOIN badge AS badge ON (badge.id = ub.badge_id)
JOIN badge_badge_content AS bbc ON (bbc.badge_id = badge.id)
JOIN badge_content AS bc ON (bc.id = bbc.badge_content_id AND bc.language_code = badge.default_language_code)
JOIN badge_criteria_content AS bcc ON (bcc.badge_id = badge.id)
JOIN criteria_content AS cc ON (cc.id = bcc.criteria_content_id AND cc.language_code = badge.default_language_code)
JOIN user as u on (u.id = ub.user_id)
WHERE u.id = :user_id AND ubm.user_badge_id = :user_badge_id
GROUP BY fm.id;
--name: select-required-metatabadge-by-badge-id
SELECT fmr.metabadge_id FROM user_badge_metabadge AS ubm
JOIN user_badge AS ub ON (ubm.user_badge_id = ub.id)
JOIN factory_metabadge_required AS fmr ON (ubm.meta_badge_req = fmr.required_badge_id)
WHERE ubm.user_badge_id = :id
--name: select-received-metabadge-by-badge-id
SELECT ub.id, ub.user_id, ub.assertion_url, ubm.last_modified FROM user_badge_metabadge AS ubm
JOIN user_badge AS ub ON ubm.user_badge_id = ub.id
where ubm.user_badge_id = :id
--name: select-user-received-metabadge-by-metabadge-id
--check if user has received metabadge
SELECT meta_badge AS metabadge_id, user_badge_id FROM user_badge_metabadge AS ubm
JOIN user_badge AS ub ON (ub.id = ubm.user_badge_id)
WHERE ubm.meta_badge = :metabadge_id AND ub.user_id = :user_id
--name: select-completed-metabadge-by-metabadge-id
SELECT ubm.meta_badge AS metabadge_id, ubm.user_badge_id, fm.min_required, fm.name, bc.description, bc.image_file, cc.markdown_text AS criteria_content
FROM user_badge_metabadge AS ubm
JOIN factory_metabadge AS fm ON (fm.id = ubm.meta_badge)
JOIN user_badge AS ub ON (ubm.user_badge_id = ub.id)
JOIN badge AS badge ON (badge.id = ub.badge_id)
JOIN badge_badge_content AS bbc ON (bbc.badge_id = badge.id)
JOIN badge_content AS bc ON (bc.id = bbc.badge_content_id AND bc.language_code = badge.default_language_code)
JOIN badge_criteria_content AS bcc ON (bcc.badge_id = badge.id)
JOIN criteria_content AS cc ON (cc.id = bcc.criteria_content_id AND cc.language_code = badge.default_language_code)
JOIN user as u on (u.id = ub.user_id)
WHERE u.id = :user_id AND ubm.meta_badge = :metabadge_id
GROUP BY fm.id
--name: select-factory-metabadge
--select default factory metabadge info
SELECT id AS metabadge_id, name, description, image_file, criteria AS criteria_content, min_required
FROM factory_metabadge WHERE id = :id
--name: select-user-id-by-user-badge-id
SELECT user_id from user_badge AS ub where ub.id = :id
--name: select-factory-metabadge-required
SELECT name, description, criteria AS criteria_content, image_file, application_url, not_before, not_after
FROM factory_metabadge_required WHERE metabadge_id = :metabadge_id AND required_badge_id = :required_badge_id
--name: select-all-badges
--fix
SELECT id, assertion_url FROM user_badge
WHERE assertion_url IS NOT NULL AND assertion_url LIKE :obf_url
AND revoked = 0 AND status != 'declined'
AND (expires_on IS NULL OR expires_on > UNIX_TIMESTAMP())
ORDER BY last_checked LIMIT 1000
--name: select-all-metabadges
SELECT DISTINCT ub.id, ub.user_id, ub.assertion_url, ubm.last_modified FROM user_badge_metabadge AS ubm
JOIN user_badge AS ub ON ubm.user_badge_id = ub.id
WHERE ubm.meta_badge IS NOT NULL OR ubm.meta_badge_req IS NOT NULL
--name: insert-user-badge-metabadge!
INSERT IGNORE INTO user_badge_metabadge (user_badge_id, meta_badge, meta_badge_req, last_modified)
VALUES (:user_badge_id, :meta_badge, :meta_badge_req, :last_modified)
--name: delete-user-badge-metabadge!
DELETE FROM user_badge_metabadge WHERE user_badge_id = :user_badge_id
--name: insert-factory-metabadge!
INSERT IGNORE INTO factory_metabadge (id, remote_issuer_id, name, description, criteria, image_file, min_required, factory_url, ctime, mtime)
VALUES (:id, :remote_issuer_id, :name, :description, :criteria, :image_file, :min_required, :factory_url, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())
--name: delete-factory-metabadge!
DELETE fm,fmr FROM factory_metabadge AS fm
JOIN factory_metabadge_required AS fmr ON fmr.metabadge_id = fm.id
WHERE fm.id = :id;
--name: insert-factory-metabadge-required-badge!
INSERT IGNORE INTO factory_metabadge_required (metabadge_id, required_badge_id, name, description, criteria, image_file, ctime, mtime)
VALUES (:metabadge_id, :required_badge_id, :name, :description, :criteria, :image_file, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())
--name: replace-factory-metabadge!
REPLACE factory_metabadge (id, remote_issuer_id, name, description, criteria, image_file, min_required, ctime, mtime)
VALUES (:id, :remote_issuer_id, :name, :description, :criteria, :image_file, :min_required, :ctime, :mtime)
--name: replace-factory-metabadge-required!
REPLACE factory_metabadge_required (metabadge_id, required_badge_id, name, description, criteria, image_file, application_url, not_before, not_after, ctime, mtime)
VALUES (:metabadge_id, :required_badge_id, :name, :description, :criteria, :image_file, :application_url, :not_before, :not_after, :ctime, :mtime)
--name: delete-factory-metabadge-multi!
DELETE fm,fmr FROM factory_metabadge AS fm
INNER JOIN factory_metabadge_required AS fmr ON fmr.metabadge_id = fm.id
WHERE fm.id IN (:deleted_metabadges) AND fm.remote_issuer_id = :remote_issuer_id;
--name: delete-factory-metabadge-required-multi!
DELETE fmr FROM factory_metabadge_required fmr
INNER JOIN factory_metabadge fm ON fmr.metabadge_id = fm.id
WHERE fmr.required_badge_id IN (:deleted_badges) AND fm.remote_issuer_id = :remote_issuer_id;
--name: delete-factory-metabadge-all!
DELETE FROM factory_metabadge
--name: delete-factory-metabadge-required-all!
DELETE FROM factory_metabadge_required
--name: select-factory-required-badge-by-required-badge-id
SELECT metabadge_id, required_badge_id, mtime FROM factory_metabadge_required
WHERE required_badge_id = :id
--name: select-assertion-json-by-assertion-url
SELECT assertion_json FROM user_badge
WHERE assertion_url = :url
|
<filename>mssql/02/85_removing_conditional_aggregation.sql
--======================================================
--
-- Author: <NAME>
-- Usage: Script creates a procedure single_II_test. In order to run/test the procedure use the run.sql script that can be found in the same directory of the project.
-- Database system supported/tested: SQL Server 2016
-- URL of the project: https://github.com/RadimBaca/QueryOptimizerBenchmark
-- License: This code is published under a MIT license
-- Change history:
--
--======================================================
DROP PROCEDURE IF EXISTS single_II_test
go
-- Description:
---------------
-- This test remove the conditional aggregation since the CASE condition has to be always satisfied.
-- That is caused by the fact that the condition is already in WHERE predicate.
-- Please note that removing the COUNT CASE is tricky and we should be aware of NULLs.
CREATE Procedure single_II_test as
begin
-- 1. Conditional aggreagtion
PRINT '1. Conditional aggreagtion'
select g1.groupby,
count(case when local_search = 1 then 1 end) as c,
max(case when local_search = 1 then local_search end) as local_search
from TestTable g1
where local_search = 1 or local_search IS NULL
group by groupby
option(maxdop 1)
-- 1. Without CASE
PRINT '1. Without CASE'
select g1.groupby,
count(orderby) as c,
max(local_search) as local_search
from TestTable g1
where local_search = 1 or local_search IS NULL
group by groupby
option(maxdop 1)
end
go
|
Opened "TEST.h5" with sec2 driver.
Monitoring dataset /DSET_CMPD_TWO...
dimension 0: 4->6 (increases)
dimension 1: 10->12 (increases)
Data:
(0,10) {{{1}}, {1}}, {{{1}}, {1}}
(1,10) {{{1}}, {1}}, {{{1}}, {1}}
(2,10) {{{1}}, {1}}, {{{1}}, {1}}
(3,10) {{{1}}, {1}}, {{{1}}, {1}}
(4,0) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}},
(4,4) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}},
(4,8) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}},
(5,0) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}},
(5,4) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}},
(5,8) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}
dimension 0: 6->8 (increases)
dimension 1: 12->1 (decreases)
Data:
(6,0) {{{2}}, {2}},
(7,0) {{{2}}, {2}}
dimension 0: 8->10 (increases)
dimension 1: 1->1 (unchanged)
Data:
(8,0) {{{3}}, {3}},
(9,0) {{{3}}, {3}}
dimension 0: 10->3 (decreases)
dimension 1: 1->3 (increases)
Data:
(0,1) {{{4}}, {4}}, {{{4}}, {4}}
(1,1) {{{4}}, {4}}, {{{4}}, {4}}
(2,1) {{{4}}, {4}}, {{{4}}, {4}}
dimension 0: 3->2 (decreases)
dimension 1: 3->2 (decreases)
dimension 0: 2->1 (decreases)
dimension 1: 2->2 (unchanged)
dimension 0: 1->1 (unchanged)
dimension 1: 2->4 (increases)
Data:
(0,2) {{{7}}, {7}}, {{{7}}, {7}}
dimension 0: 1->1 (unchanged)
dimension 1: 4->3 (decreases)
|
IF OBJECT_ID('[DOI].[spRefreshMetadata_Setup_DOISettings]') IS NOT NULL
DROP PROCEDURE [DOI].[spRefreshMetadata_Setup_DOISettings];
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [DOI].[spRefreshMetadata_Setup_DOISettings]
@DatabaseName SYSNAME
AS
DELETE DOI.DOISettings
INSERT INTO DOI.DOISettings
( DatabaseName , SettingName , SettingValue )
VALUES ( @DatabaseName , 'LargeTableCutoffValue' , '1000')
,( @DatabaseName , 'ReindexingMilitaryTimeToStopJob' , '10:00:00.0000000') --this is in UTC
,( @DatabaseName , 'DBFileInitialSizeMB' , '100')
,( @DatabaseName , 'DBFileGrowthMB' , '10')
,( @DatabaseName , 'UTEBCP Filepath' , 'c:\tmp\user-management\utebcp\')
,( @DatabaseName , 'DefaultStatsSampleSizePct' , '20')
,( @DatabaseName , 'FreeSpaceCheckerTestMultiplierForDataFiles' , '1')
,( @DatabaseName , 'FreeSpaceCheckerTestMultiplierForLogFiles' , '1')
,( @DatabaseName , 'FreeSpaceCheckerTestMultiplierForTempDBFiles' , '1')
,( @DatabaseName , 'MinNumPagesForIndexDefrag' , '500')
,( @DatabaseName , 'FreeSpaceCheckerPercentBuffer' , '10')
GO
|
<reponame>AxelMarquez/Ed-Fi-ODS
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
CREATE INDEX IF NOT EXISTS IX_AuthorizationStrategies_Application_ApplicationId
ON dbo.AuthorizationStrategies(Application_ApplicationId);
;
CREATE INDEX IF NOT EXISTS IX_ClaimSetResourceClaims_Action_ActionId
ON dbo.ClaimSetResourceClaims(Action_ActionId);
;
CREATE INDEX IF NOT EXISTS IX_ClaimSetResourceClaims_AuthStratOver_AuthStratId
ON dbo.ClaimSetResourceClaims(AuthorizationStrategyOverride_AuthorizationStrategyId);
;
CREATE INDEX IF NOT EXISTS IX_ClaimSetResourceClaims_ClaimSet_ClaimSetId
ON dbo.ClaimSetResourceClaims(ClaimSet_ClaimSetId);
;
CREATE INDEX IF NOT EXISTS IX_ClaimSetResourceClaims_ResourceClaim_ResourceClaimId
ON dbo.ClaimSetResourceClaims(ResourceClaim_ResourceClaimId);
;
CREATE INDEX IF NOT EXISTS IX_ClaimSets_Application_ApplicationId
ON dbo.ClaimSets(Application_ApplicationId);
;
CREATE INDEX IF NOT EXISTS IX_ResourceClaimAuthorizationMetadatas_Action_ActionId
ON dbo.ResourceClaimAuthorizationMetadatas(Action_ActionId);
;
CREATE INDEX IF NOT EXISTS IX_ResourceClaimAuthorizationMetadatas_AuthStrat_AuthStratId
ON dbo.ResourceClaimAuthorizationMetadatas(AuthorizationStrategy_AuthorizationStrategyId);
;
CREATE INDEX IF NOT EXISTS IX_ResourceClaimAuthorizationMetadatas_ResCla_ResClaId
ON dbo.ResourceClaimAuthorizationMetadatas(ResourceClaim_ResourceClaimId);
;
CREATE INDEX IF NOT EXISTS IX_ResourceClaims_Application_ApplicationId
ON dbo.ResourceClaims(Application_ApplicationId);
;
CREATE INDEX IF NOT EXISTS IX_ResourceClaims_ParentResourceClaimId
ON dbo.ResourceClaims(ParentResourceClaimId);
;
|
<reponame>robin-173/sayn
SELECT t.tournament_name
, t.tournament_name || '-' || CAST(b.battle_id AS VARCHAR) AS battle_id
, a.arena_name
, f1.fighter_name AS fighter1_name
, f2.fighter_name AS fighter2_name
, w.fighter_name AS winner_name
FROM logs_battles b
LEFT JOIN dim_tournaments t
ON b.tournament_id = t.tournament_id
LEFT JOIN dim_arenas a
ON b.arena_id = a.arena_id
LEFT JOIN dim_fighters f1
ON b.fighter1_id = f1.fighter_id
LEFT JOIN dim_fighters f2
ON b.fighter2_id = f2.fighter_id
LEFT JOIN dim_fighters w
ON b.winner_id = w.fighter_id
|
<gh_stars>0
SET enable_seqscan = OFF;
SET enable_indexscan = ON;
SET enable_bitmapscan = ON;
create table bm_test (i int, t text);
insert into bm_test select i % 10, (i % 10)::text from generate_series(1, 100) i;
create index bm_test_idx on bm_test using bitmap (i);
select count(*) from bm_test where i=1;
select count(*) from bm_test where i in(1, 3);
-- this sql should confirm that the tuple with i=1
-- and the tuple with i=5 are on different segments
select count(distinct gp_segment_id) from bm_test where i in (1, 5);
select count(*) from bm_test where i in(1, 5);
select * from bm_test where i > 10;
reindex index bm_test_idx;
select count(*) from bm_test where i in(1, 3);
drop index bm_test_idx;
create index bm_test_coll_idx on bm_test using bitmap(i, t COLLATE "C");
select * from bm_test where i=5 and t='5';
select * from bm_test where i=5 or t='6';
-- this sql should confirm that the tuple with i=5
-- and the tuple with t='1' are on different segments
select count(distinct gp_segment_id) from bm_test where i=5 or t='1';
select * from bm_test where i=5 or t='1';
select * from bm_test where i between 1 and 10 and i::text = t;
drop table bm_test;
-- test a bunch of different data types
create table bm_test (i2 int2, i4 int4, i8 int8, f4 float4, f8 float8,
n numeric(10, 3), t1 varchar(3), t2 char(3), t3 text, a int[2],
ip inet, b bytea, t timestamp, d date, g bool);
insert into bm_test values(1, 1, 1, 1.0, 1.0, 1000.333, '1', '1', '1',
array[1, 3], '127.0.0.1', E'\001', '2007-01-01 01:01:01',
'2007-01-01', 't');
insert into bm_test values(2, 2, 2, 2.0, 2.0, 2000.333, '2', '2', 'foo',
array[2, 6], '127.0.0.2', E'\002', '2007-01-02 01:01:01',
'2007-01-02', 'f');
insert into bm_test default values; -- test nulls
create index bm_i2_idx on bm_test using bitmap(i2);
create index bm_i4_idx on bm_test using bitmap(i4);
create index bm_i8_idx on bm_test using bitmap(i8);
create index bm_f4_idx on bm_test using bitmap(f4);
create index bm_f8_idx on bm_test using bitmap(f8);
create index bm_n_idx on bm_test using bitmap(n);
create index bm_t1_idx on bm_test using bitmap(t1);
create index bm_t2_idx on bm_test using bitmap(t2);
create index bm_t3_idx on bm_test using bitmap(t3);
create index bm_a_idx on bm_test using bitmap(a);
create index bm_ip_idx on bm_test using bitmap(ip);
create index bm_b_idx on bm_test using bitmap(b);
create index bm_t_idx on bm_test using bitmap(t);
create index bm_d_idx on bm_test using bitmap(d);
create index bm_g_idx on bm_test using bitmap(g);
create index bm_t3_upper_idx on bm_test using bitmap(upper(t3));
create index bm_n_null_idx on bm_test using bitmap(n) WHERE n ISNULL;
-- Try some cross type stuff
select a.t from bm_test a, bm_test b where a.i2 = b.i2;
select a.t from bm_test a, bm_test b where a.i2 = b.i4;
select a.t from bm_test a, bm_test b where a.i2 = b.i8;
select a.t from bm_test a, bm_test b where b.f4 = a.f8 and a.f8 = '2.0';
-- some range queries
select a.t from bm_test a, bm_test b where a.n < b.n;
select a.t from bm_test a, bm_test b where a.ip < b.ip;
-- or queries
select a.t from bm_test a, bm_test b where a.ip=b.ip OR a.b = b.b;
-- and
select a.t from bm_test a, bm_test b where a.ip=b.ip and a.b = b.b and a.i2=1;
-- subquery
select a.t from bm_test a where d in(select d from bm_test b where a.g=b.g);
-- functional and predicate indexes
select t from bm_test where upper(t3) = 'FOO';
select t from bm_test where n ISNULL;
-- test updates
update bm_test set i4 = 3;
-- should return nothing
select * from bm_test where i4 = 1;
-- should return all
select * from bm_test where i4=3;
-- should return one row
select * from bm_test where i2=1;
-- test splitting of words
-- We distribute by k and only insert a single distinct value in that
-- field so that we can be guaranteed of behaviour. We're not testing
-- the parallel mechanism here so it's fine to harass a single backend
create table bm_test2 (i int, j int, k int) distributed by (k);
create index bm_test2_i_idx on bm_test2 using bitmap(i);
insert into bm_test2 select 1,
case when (i % (16 * 16 + 8)) = 0 then 2 else 1 end, 1
from generate_series(1, 16 * 16 * 16) i;
select count(*) from bm_test2 where i = 1;
select count(*) from bm_test2 where j = 2;
-- break some compressed words
update bm_test2 set i = 2 where j = 2;
select count(*) from bm_test2 where i = 1;
select count(*) from bm_test2 where i = 2;
update bm_test2 set i = 3 where i = 1;
select count(*) from bm_test2 where i = 1;
select count(*) from bm_test2 where i = 2;
select count(*) from bm_test2 where i = 3;
-- now try and break a whole page
-- bitmap words are 16 bits so, with no compression we get about
-- 16500 words per 32K page. So, what we want to do is, insert
-- 8250 uncompressed words, then a compressed word, then more uncompressed
-- words until the page is full. After this, we can break the compressed word
-- and there by test the word spliting system
create table bm_test3 (i int, j int, k int) distributed by (k);
create index bm_test3_i_idx on bm_test3 using bitmap(i);
insert into bm_test3 select i, 1, 1 from
generate_series(1, 8250 * 8) g, generate_series(1, 2) i;
insert into bm_test3
select 17, 1, 1 from generate_series(1, 16 * 16) i;
insert into bm_test3 values(17, 2, 1);
insert into bm_test3
select 17, 1, 1 from generate_series(1, 16 * 16) i;
insert into bm_test3 select i, 1, 1 from
generate_series(1, 8250 * 8) g, generate_series(1, 2) i;
select count(*) from bm_test3 where i = 1;
select count(*) from bm_test3 where i = 17;
select count(*) from bm_test3 where i = 17 and j = 2;
update bm_test3 set i = 18 where i = 17 and j = 2;
select count(*) from bm_test3 where i = 1;
select count(*) from bm_test3 where i = 2;
select count(*) from bm_test3 where i = 17;
select count(*) from bm_test3 where i = 18;
drop table bm_test;
drop table bm_test2;
drop table bm_test3;
create table bm_test (i int, j int);
insert into bm_test values (0, 0), (0, 0), (0, 1), (1,0), (1,0), (1,1);
create index bm_test_j on bm_test using bitmap(j);
delete from bm_test where j =1;
vacuum bm_test;
insert into bm_test values (0, 0), (1,0);
set enable_seqscan=off;
set enable_bitmapscan=off;
set optimizer_enable_bitmapscan=off;
-- start_ignore
-- Known_opt_diff: MPP-19808
-- end_ignore
explain select * from bm_test where j = 1;
select * from bm_test where j = 1;
drop table bm_test;
-- MPP-3232
create table bm_test (i int,j int);
insert into bm_test values (1, 1), (1, 2);
create index bm_test_j on bm_test using bitmap(j);
update bm_test set j=20 where j=1;
vacuum bm_test;
drop table bm_test;
-- unique index with null value tests
drop table if exists ijk;
create table ijk(i int, j int, k int) distributed by (i);
insert into ijk values (1, 1, 3);
insert into ijk values (1, 2, 4);
insert into ijk values (1, 3, NULL);
insert into ijk values (1, 3, NULL);
insert into ijk values (1, NULL, NULL);
insert into ijk values (1, NULL, NULL);
-- should fail.
create unique index ijk_i on ijk(i);
create unique index ijk_ij on ijk(i,j);
-- should OK.
create unique index ijk_ijk on ijk(i,j,k);
drop table if exists ijk;
create table ijk(i int, j int, k int) distributed by (i);
insert into ijk values (1, 1, 3);
insert into ijk values (1, 2, 4);
insert into ijk values (1, 3, NULL);
insert into ijk values (1, 3, NULL);
insert into ijk values (1, NULL, NULL);
insert into ijk values (1, NULL, NULL);
-- should fail.
create unique index ijk_i on ijk(i);
create unique index ijk_ij on ijk(i,j);
-- should OK.
create unique index ijk_ijk on ijk(i,j,k);
drop table ijk;
--
-- test bitmaps with NULL and non-NULL values (MPP-8461)
--
create table bmap_test (x int, y int, z int);
insert into bmap_test values (1,NULL,NULL);
insert into bmap_test values (NULL,1,NULL);
insert into bmap_test values (NULL,NULL,1);
insert into bmap_test values (1,NULL,NULL);
insert into bmap_test values (NULL,1,NULL);
insert into bmap_test values (NULL,NULL,1);
insert into bmap_test values (1,NULL,5);
insert into bmap_test values (NULL,1,NULL);
insert into bmap_test values (NULL,NULL,1);
insert into bmap_test select a from generate_series(1,10*1000) as s(a);
create index bmap_test_idx_1 on bmap_test using bitmap (x,y,z);
analyze bmap_test;
select * from bmap_test where x = 1 order by x,y,z;
drop table bmap_test;
--
-- Test over-sized values
--
create table oversize_test (c1 text);
CREATE INDEX oversize_test_idx ON oversize_test USING BITMAP (c1);
insert into oversize_test values ('a');
select * from oversize_test;
-- this fails, because the value is too large
insert into oversize_test values (array_to_string(array(select generate_series(1, 10000)), '123456789'));
set enable_seqscan=off;
select * from oversize_test where c1 < 'z';
-- Drop the index, insert the row, and then try creating the index again. This is essentially
-- the same test, but now the failure happens during CREATE INDEX rather than INSERT.
drop index oversize_test_idx;
insert into oversize_test values (array_to_string(array(select generate_series(1, 10000)), '123456789'));
CREATE INDEX oversize_test_idx ON oversize_test USING BITMAP (c1);
--
-- Test Index Only Scans.
--
-- Bitmap indexes don't really support index only scans at the moment. But the
-- planner can still choose an Index Only Scan, if the query doesn't need any
-- of the attributes from the index.
create table bm_indexonly_test (i int, t text);
insert into bm_indexonly_test select g, 'foo' || g from generate_series(1, 5) g;
create index on bm_indexonly_test using bitmap (i, t);
set enable_seqscan=off;
set enable_bitmapscan=off;
set enable_indexscan=on;
set enable_indexonlyscan=on;
-- if bitmap indexes supported Index Only Scans, properly, this could use one.
explain (costs off) select i, t from bm_indexonly_test where i = 1;
select i, t from bm_indexonly_test where i = 1;
-- even without proper support, the planner chooses an Index Only Scan for this.
explain (costs off) select 'foobar' from bm_indexonly_test;
select 'foobar' from bm_indexonly_test;
--
-- Test unlogged table
--
set enable_seqscan=off;
set enable_indexscan=on;
set optimizer_enable_bitmapscan=on;
create unlogged table unlogged_test(c1 int);
insert into unlogged_test select * from generate_series(1,1000);
CREATE INDEX unlogged_test_idx ON unlogged_test USING BITMAP (c1);
analyze unlogged_test;
explain select * from unlogged_test where c1 = 100;
select * from unlogged_test where c1 = 100;
drop table unlogged_test;
--
-- Test crash recovery
--
--
-- disable fault-tolerance service (FTS) probing to ensure
-- the mirror does not accidentally get promoted
--
SELECT gp_inject_fault_infinite('fts_probe', 'skip', dbid) FROM gp_segment_configuration WHERE role = 'p' and content = -1;
CREATE TABLE bm_test_insert(a int) DISTRIBUTED BY (a);
CREATE INDEX bm_a_idx ON bm_test_insert USING bitmap(a);
CREATE TABLE bm_test_update(a int, b int) DISTRIBUTED BY (a);
CREATE INDEX bm_b_idx ON bm_test_update USING bitmap(b);
INSERT INTO bm_test_update SELECT i,i FROM generate_series (1, 10000) i;
-- flush the data to disk
CHECKPOINT;
-- skip all further checkpoint
SELECT gp_inject_fault_infinite('checkpoint', 'skip', dbid) FROM gp_segment_configuration WHERE role = 'p' AND content > -1;
INSERT INTO bm_test_insert SELECT generate_series (1, 10000);
UPDATE bm_test_update SET b=b+1;
-- trigger recovery on primaries
SELECT gp_inject_fault_infinite('finish_prepared_after_record_commit_prepared', 'panic', dbid) FROM gp_segment_configuration WHERE role = 'p' AND content > -1;
SET client_min_messages='ERROR';
CREATE TABLE trigger_recovery_on_primaries(c int);
RESET client_min_messages;
-- reconnect to the database after restart
\c
SELECT gp_inject_fault('checkpoint', 'reset', dbid) FROM gp_segment_configuration WHERE role = 'p' AND content > -1;
SELECT gp_inject_fault('finish_prepared_after_record_commit_prepared', 'reset', dbid) FROM gp_segment_configuration WHERE role = 'p' AND content > -1;
SET enable_seqscan=off;
SET enable_indexscan=off;
SELECT * FROM bm_test_insert WHERE a=1;
SELECT * FROM bm_test_update WHERE b=1;
DROP TABLE trigger_recovery_on_primaries;
DROP TABLE bm_test_insert;
DROP TABLE bm_test_update;
--
-- re-enable fault-tolerance service (FTS) probing after recovery completed.
--
SELECT gp_inject_fault('fts_probe', 'reset', dbid) FROM gp_segment_configuration WHERE role = 'p' and content = -1;
-- If the table is AO table, it need generate some fake tuple pointer,
-- this pointer is a little different from the heap tables pointer,
-- If the Offset in pointer is 0(If the row number is 32768, the Offset
-- should be 0), we set the 16th bit of the Offsert to be 1, so we
-- do not forget to remove the flag when we use it, otherwise we will
-- get an wrong value.
CREATE TABLE bm_test_reindex(c1 int, c2 int) WITH (appendonly=true);
CREATE INDEX bm_test_reindex_idx ON bm_test_reindex USING bitmap(c2);
INSERT INTO bm_test_reindex SELECT 1,i FROM generate_series(1, 65537)i;
REINDEX INDEX bm_test_reindex_idx;
SET enable_bitmapscan to on;
SET enable_seqscan to off;
SELECT * from bm_test_reindex where c2 = 32767;
SELECT * from bm_test_reindex where c2 = 32768;
SELECT * from bm_test_reindex where c2 = 32769;
SELECT * from bm_test_reindex where c2 = 65536;
SET enable_seqscan = ON;
SET enable_indexscan = ON;
--
-- correct cost estimate to avoid bm index scan for wrong result
--
CREATE TABLE test_bmselec(id int, type int, msg text) distributed by (id);
INSERT INTO test_bmselec (id, type, msg) SELECT g, g % 10000, md5(g::text) FROM generate_series(1,100000) as g;
CREATE INDEX ON test_bmselec USING bitmap(type);
ANALYZE test_bmselec;
-- it used to choose bitmap index over seq scan, which not right.
explain (analyze, verbose) select * from test_bmselec where type < 500;
SET enable_seqscan = OFF;
SET enable_bitmapscan = OFF;
-- we can see the bitmap index scan is much more slower
explain (analyze, verbose) select * from test_bmselec where type < 500;
DROP TABLE test_bmselec;
SET enable_seqscan = ON;
SET enable_bitmapscan = ON;
-- for sparse bitmap index
create table test_bmsparse(id int, type int, msg text) distributed by (id);
INSERT INTO test_bmsparse (id, type, msg) SELECT g, g % 10000, md5(g::text) FROM generate_series(1,10000) as g;
INSERT INTO test_bmsparse (id, type, msg) SELECT g, g % 200, md5(g::text) FROM generate_series(1,80000) as g;
INSERT INTO test_bmsparse (id, type, msg) SELECT g, g % 10000, md5(g::text) FROM generate_series(1,10000) as g;
CREATE INDEX ON test_bmsparse USING bitmap(type);
ANALYZE test_bmsparse;
-- select lots of rows but on small part of distinct values, should use seq scan
explain (analyze, verbose) select * from test_bmsparse where type < 200;
SET enable_seqscan = OFF;
SET enable_bitmapscan = OFF;
explain (analyze, verbose) select * from test_bmsparse where type < 200;
SET enable_seqscan = ON;
SET enable_bitmapscan = ON;
-- select small part of table but on lots of distinct values, should use seq scan
explain (analyze, verbose) select * from test_bmsparse where type > 500;
SET enable_seqscan = OFF;
SET enable_bitmapscan = OFF;
explain (analyze, verbose) select * from test_bmsparse where type > 500;
DROP TABLE test_bmsparse;
|
/* Таблица `roles` без внешних ключей, её устанавливать в первую очередь! */
CREATE TABLE `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` char(255) DEFAULT NULL,
`label` char(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `roles`(`name`, `label`) VALUES
('Admin', 'Администратор'),
('Teacher', 'Преподаватель'),
('Student', 'Студент');
|
SELECT "PanCreactomy2_2"."NPPES_PROVIDER_STATE" AS "NPPES_PROVIDER_STATE", AVG(CAST("PanCreactomy2_2"."AVERAGE_MEDICARE_PAYMENT_AMT" AS float8)) AS "avg:AVERAGE_MEDICARE_PAYMENT_AMT:ok", SUM("PanCreactomy2_2"."LINE_SRVC_CNT") AS "sum:LINE_SRVC_CNT:ok" FROM "PanCreactomy2_2" WHERE (("PanCreactomy2_2"."HCPCS_DESCRIPTION" IN ('Pancreas procedure', 'Partial removal of pancreas', 'Partial removal of pancreas with attachment to small bowel', 'Partial removal of pancreas, bile duct and small bowel with connection of pancreas to small bowel')) AND ("PanCreactomy2_2"."PROVIDER_TYPE" IN ('General Surgery', 'Surgical Oncology'))) GROUP BY 1;
|
-- begin METAFUNCTIONALUNITS_FUNCTIONAL_UNIT
create table METAFUNCTIONALUNITS_FUNCTIONAL_UNIT (
ID integer not null,
UUID varchar(36),
--
NAME varchar(255) not null,
DESCRIPTION longvarchar,
ISSUE_TRACKER varchar(512),
--
primary key (ID)
)^
-- end METAFUNCTIONALUNITS_FUNCTIONAL_UNIT
-- begin METAFUNCTIONALUNITS_COMPONENT
create table METAFUNCTIONALUNITS_COMPONENT (
ID integer not null,
UUID varchar(36),
--
NAME varchar(255) not null,
DESCRIPTION longvarchar,
VCS_URL varchar(512),
FUNCTIONAL_UNIT_ID integer not null,
--
primary key (ID)
)^
-- end METAFUNCTIONALUNITS_COMPONENT
|
CREATE EXTENSION postgis;
CREATE TYPE observation_type AS ENUM ('historical', 'recent', 'current', 'forecast');
CREATE TABLE weather (
timestamp timestamp with time zone NOT NULL,
station_id varchar(5) NOT NULL,
observation_type observation_type NOT NULL,
location geography(POINT) NOT NULL,
height smallint NOT NULL,
precipitation real CHECK (precipitation >= 0),
pressure_msl integer CHECK (pressure_msl > 0),
sunshine smallint CHECK (sunshine BETWEEN 0 and 3600),
temperature real CHECK (temperature > 0),
wind_direction smallint CHECK (wind_direction BETWEEN 0 AND 360),
wind_speed real CHECK (wind_speed >= 0),
CONSTRAINT observation_source UNIQUE (timestamp, station_id, observation_type)
);
|
<filename>CNExT/cnext_person.sql<gh_stars>0
/*
Notes:
1) First 2 attributes are included so lineage tracing and source primary key
identification is clearly contained in the prospective extract file.
2) The output IDENTITY_CONTEXT clearly indicates the primary source of the
extract file.
3) The output SOURCE_PK will always contain the column(s) which identify
the primary key for the source system of record. In cases where source
keys include more than one element they should be sequentially numbered,
i.e. SOURCE_PK_01, SOURCE_PK_02,etc
4) In instances where there is no equivalent concept in the source table(s),
simply include a "NULL as MISSING_COLUMN_NAME" in the SQL so it it clear
that the omission is not an oversight.
5) The structure will largely resemble the structure of the target table and
wherever practical contain all source elements needed to populate the
target, excluding OMOP metadata keys which will be looked up during the
Staging to Persistent Store ETL operation.
6) Single value sub-selects are recommended for external lookups vs. lots of
joins. Makes everything easier to read. Additionally, all single element
sub selects must include TOP 1 for SQLServer or ROWNUM < 2 for Oracle instances.
This simply protects against SQLCODE -1427 in cases where the source data
may not be properly constrained.
7) Always include a WHERE clause even if it only validates the source
PK is not null.
8) Include as much commenting as needed to clearly express the work being
performed.
9) This script is to be run and is written to be run in MS SQL Server and will generate errors if run in other DB platforms
10) Comments reflect Item # as referrd to in the NAACCR layout V21-Chapter-IX-
LTV - 1/31/2022 - adding patient's MRN at the end of the query per Mark.
LTV - 2/7/2022 - handled NULL values with the ISNULL function. Added formatting to the DEATH_DATETIME field so that it would look like all the other DATETIME fields.
LTV - 2/8/2022 - wrapped the hard-coded values + a table column (i.e., '160@' + PatExtended.F00021) in the ISNULL function so nothing will be returned when the table column is NULL.
*/
SET NOCOUNT ON;
SELECT 'IDENTITY_CONTEXT|SOURCE_PK|PERSON_ID|GENDER_CONCEPT_ID|YEAR_OF_BIRTH|MONTH_OF_BIRTH|DAY_OF_BIRTH|BIRTH_DATETIME|DEATH_DATETIME|RACE_CONCEPT_ID|ETHNICITY_CONCEPT_ID|LOCATION_ID|PROVIDER_ID|CARE_SITE_ID|PERSON_SOURCE_VALUE|GENDER_SOURCE_VALUE|GENDER_SOURCE_CONCEPT_ID|RACE_SOURCE_VALUE|RACE_SOURCE_CONCEPT_ID|ETHNICITY_SOURCE_VALUE|ETHNICITY_SOURCE_CONCEPT_ID|MRN|Modified_DtTm';
SELECT DISTINCT 'CNEXT PATIENT(OMOP_PERSON)' AS IDENTITY_CONTEXT
,rsSource.uk AS SOURCE_PK
,rsSource.uk AS PERSON_ID /*10*/
,ISNULL(rsSource.F00022, '') AS GENDER_CONCEPT_ID /*220*/
,case
when rsSource.F00019 = '00000000'
then ''
else ISNULL(SUBSTRING(rsSource.F00019,1,4), '')
end as YEAR_OF_BIRTH
,case
when rsSource.F00019 = '00000000'
then ''
when SUBSTRING(rsSource.F00019,5,2) = '99'
then '01'
else ISNULL(SUBSTRING(rsSource.F00019,5,2), '')
end as MONTH_OF_BIRTH
,case
when rsSource.F00019 = '00000000'
then ''
when SUBSTRING (rsSource.F00019,7,2) = '99'
then '01'
else ISNULL(SUBSTRING(rsSource.F00019,7,2), '')
end as DAY_OF_BIRTH
,case
when rsSource.F00019 = '00000000'
then ''
when right(rsSource.F00019, 4) = '9999'
then FORMAT(TRY_CAST(left(rsSource.F00019,4) + '0101' AS DATETIME), 'yyyy-MM-dd HH:mm:ss')
when right(rsSource.F00019,2) = '99'
then FORMAT(TRY_CAST(left(rsSource.F00019,6) + '01' AS DATETIME), 'yyyy-MM-dd HH:mm:ss')
else ISNULL(FORMAT(TRY_CAST(rsSource.F00019 AS DATETIME), 'yyyy-MM-dd HH:mm:ss'), '')
END AS BIRTH_DATETIME
,case
when rsSource.F00068 = '00000000'
then ''
when (rsSource.F00069 = 0 and right(rsSource.F00068, 4) = '9999')
then FORMAT(TRY_CAST(left(rsSource.F00068,4) + '0101' AS DATETIME), 'yyyy-MM-dd HH:mm:ss')
when (rsSource.F00069 = 0 and right(rsSource.F00068,2) = '99')
then FORMAT(TRY_CAST(left(rsSource.F00068,6) + '01' AS DATETIME), 'yyyy-MM-dd HH:mm:ss')
WHEN rsSource.F00069 = 0
then ISNULL(FORMAT(try_cast(rsSource.F00068 as DATETIME),'yyyy-MM-dd HH:mm:ss'), '')
else ''
END AS DEATH_DATETIME
,ISNULL(PatExtended.F00021, '') AS RACE_CONCEPT_ID /*160*/
,ISNULL(PatExtended.F00138, '') AS ETHNICITY_CONCEPT_ID /*190*/
,PatExtended.UK AS LOCATION_ID /*1830*/
,ISNULL(HospExtended.F00675, '') AS PROVIDER_ID /*2460*/
,ISNULL(PatExtended.F00003, '') AS CARE_SITE_ID /*21*/
,ISNULL(PatExtended.F00004, '') AS PERSON_SOURCE_VALUE /*20*/
,ISNULL(rsSource.F00022, '') AS GENDER_SOURCE_VALUE /*220*/
,ISNULL('220@' + rsSource.F00022, '') AS GENDER_SOURCE_CONCEPT_ID /*220*/
,ISNULL(PatExtended.F00021, '') AS RACE_SOURCE_VALUE /*160*/
,ISNULL('160@' + PatExtended.F00021, '') AS RACE_SOURCE_CONCEPT_ID
,ISNULL(PatExtended.F00138, '') AS ETHNICITY_SOURCE_VALUE /*190*/
,ISNULL('190@' + PatExtended.F00138, '') AS ETHNICITY_SOURCE_CONCEPT_ID
,ISNULL(Hospital.F00006, '') AS MRN
,format(GETDATE(),'yyyy-MM-dd HH:mm:ss') as Modified_DtTm
FROM UNM_CNExTCases.dbo.Patient rsSource
JOIN UNM_CNExTCases.dbo.PatExtended on PatExtended.uk = rsSource.uk
JOIN UNM_CNExTCases.dbo.Tumor on rsSource.uk = Tumor.fk1
JOIN UNM_CNExTCases.dbo.Hospital on Tumor.uk = Hospital.fk2
JOIN UNM_CNExTCases.dbo.HospExtended ON HospExtended.uk = Hospital.uk
where Hospital.F00006 not in (999999998, 9999998, 999999, 9999)
and Hospital.F00006 >= 1000
|
<reponame>maxg/omnivore
INSERT INTO raw_data VALUES ('alice', 'test.alpha', t(), '0', 'tester');
INSERT INTO current_data VALUES ('alice', 'test.alpha', t(), '0', NULL, 'tester');
SELECT * INTO STRICT result FROM all_data;
PERFORM assert(result.username = 'alice', result::TEXT);
PERFORM assert(result.key = 'test.alpha', result::TEXT);
PERFORM assert(result.value = '0', result::TEXT);
INSERT INTO current_data VALUES ('alice', 'test.alpha', t(), '0', NULL, 'tester');
SELECT * INTO STRICT result FROM current_data;
PERFORM assert(result.value = '0', result::TEXT);
SELECT * INTO STRICT result FROM all_data;
PERFORM assert(result.value = '0', result::TEXT);
INSERT INTO current_data VALUES ('alice', 'test.alpha', t(), '42', NULL, 'tester');
SELECT * INTO STRICT result FROM current_data;
PERFORM assert(result.value = '42', result::TEXT);
SELECT count(*) AS count INTO STRICT result FROM all_data;
PERFORM assert(result.count = 2, result::TEXT);
|
dbcc checkdb('repro_0_7_dev')
alter database repro_0_7_dev set SINGLE_USER
dbcc checkdb('repro_0_7_dev',REPAIR_REBUILD)
set database repro_0_7_dev set MULTI_USER
|
<filename>datasource/src/test/sql/data.sql
START TRANSACTION
;
CREATE FUNCTION test ( ) RETURNS void AS
$$
DECLARE
var_member_id INTEGER;
var_exam_id INTEGER;
var_pool_id INTEGER;
var_task_id INTEGER;
var_task_type_selection_single_id SMALLINT := 2;
BEGIN
SELECT id FROM member_create('test', 'test') INTO var_member_id;
SELECT id FROM pool_create (var_member_id, 'test') INTO var_pool_id;
SELECT id FROM exam_create (var_member_id, 'test') INTO var_exam_id;
PERFORM * FROM exam_update_pool_add (var_member_id, var_exam_id, var_pool_id, 10000);
SELECT id FROM task_create (var_member_id, var_task_type_selection_single_id, '2 + 2 = ?') INTO var_task_id;
PERFORM * FROM option_create (var_member_id, var_task_id, '1', 0);
PERFORM * FROM option_create (var_member_id, var_task_id, '2', 0);
PERFORM * FROM option_create (var_member_id, var_task_id, '3', 0);
PERFORM * FROM option_create (var_member_id, var_task_id, '4', 1);
PERFORM * FROM pool_update_task_add (var_member_id, var_pool_id, var_task_id);
END
;
$$
LANGUAGE 'plpgsql'
;
SELECT * FROM test ( );
DROP FUNCTION test ( );
COMMIT
;
|
-- phpMyAdmin SQL Dump
-- version 4.7.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 02, 2018 at 10:37 AM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `nvs`
--
-- --------------------------------------------------------
--
-- Table structure for table `accommodation_plan_one`
--
CREATE TABLE `accommodation_plan_one` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `accommodation_plan_one`
--
INSERT INTO `accommodation_plan_one` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'BURGLARY', 87, 0, 0, 0, 0, 'icons8-burglary-100.png'),
(2, 'MONEY', 87, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'GLASS BREAKAGE', 87, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(4, 'PUBLIC LIABILITY', 87, 0, 0, 0, 0, 'icons8-public-100.png'),
(5, 'EMPLOYERS LIABILITY', 87, 0, 0, 0, 0, 'icons8-name-tag-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `accommodation_plan_two`
--
CREATE TABLE `accommodation_plan_two` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `accommodation_plan_two`
--
INSERT INTO `accommodation_plan_two` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'BURGLARY', 170, 0, 0, 0, 0, 'icons8-burglary-100.png'),
(2, 'MONEY', 170, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'GLASS BREAKAGE', 170, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(4, 'PUBLIC LIABILITY', 170, 0, 0, 0, 0, 'icons8-public-100.png'),
(5, 'EMPLOYERS LIABILITY', 170, 0, 0, 0, 0, 'icons8-name-tag-100.png'),
(6, 'FIRE-1102-C1A', 169, 0, 0, 0, 0, 'icons8-fires-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `administrative_plan_one`
--
CREATE TABLE `administrative_plan_one` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `administrative_plan_one`
--
INSERT INTO `administrative_plan_one` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(2, 'MONEY', 87, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'GLASS BREAKAGE', 87, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(4, 'PUBLIC LIABILITY', 87, 0, 0, 0, 0, 'icons8-public-100.png'),
(5, 'EMPLOYERS LIABILITY', 87, 0, 0, 0, 0, 'icons8-name-tag-100.png'),
(6, 'FIRE-1204-C1A', 12433, 0, 0, 0, 0, 'icons8-fires-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `administrative_plan_two`
--
CREATE TABLE `administrative_plan_two` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `administrative_plan_two`
--
INSERT INTO `administrative_plan_two` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'ALL RISK', 250, 0, 0, 0, 0, 'icons8-low-priority-100.png'),
(2, 'MONEY', 150, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'GLASS BREAKAGE', 150, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(4, 'PUBLIC LIABILITY', 250, 0, 0, 0, 0, 'icons8-public-100.png'),
(5, 'EMPLOYERS LIABILITY', 250, 0, 0, 0, 0, 'icons8-name-tag-100.png'),
(6, 'FIRE-1204-C1A', 87, 0, 0, 0, 0, 'icons8-fires-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `contractor_plan_one`
--
CREATE TABLE `contractor_plan_one` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contractor_plan_one`
--
INSERT INTO `contractor_plan_one` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'Mobile Plant & Equipment Insurance', 50000, 0, 0, 0, 0, 'icons8-colosseum-filled-100.png'),
(2, 'All Risk Insurance', 75000, 0, 0, 0, 0, 'icons8-low-priority-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `contractor_plan_two`
--
CREATE TABLE `contractor_plan_two` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contractor_plan_two`
--
INSERT INTO `contractor_plan_two` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(0, 'Mobile Plant & Equipment Insurance', 50000, 0, 0, 0, 0, ''),
(0, 'All Risk Insurance', 127500, 0, 0, 0, 0, '');
-- --------------------------------------------------------
--
-- Table structure for table `customer_details`
--
CREATE TABLE `customer_details` (
`id` int(11) NOT NULL,
`customer_name` varchar(255) NOT NULL,
`customer_phone` varchar(255) NOT NULL,
`industry_name` varchar(255) NOT NULL,
`number_employees` varchar(255) NOT NULL,
`due_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `customer_details`
--
INSERT INTO `customer_details` (`id`, `customer_name`, `customer_phone`, `industry_name`, `number_employees`, `due_date`) VALUES
(3, 'omar', '01161177870', 'admin', 'one_to_five', '2018-03-01 16:06:37'),
(4, 'Ahmed', '0116117697', 'admin', 'one_to_five', '2018-03-01 16:11:12');
-- --------------------------------------------------------
--
-- Table structure for table `event_management_plan_one`
--
CREATE TABLE `event_management_plan_one` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `event_management_plan_one`
--
INSERT INTO `event_management_plan_one` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'Mobile Plant & Equipment Insurance', 50000, 0, 0, 0, 0, 'icons8-colosseum-filled-100.png'),
(2, 'All Risk Insurance', 75000, 0, 0, 0, 0, 'icons8-low-priority-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `event_management_plan_two`
--
CREATE TABLE `event_management_plan_two` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `event_management_plan_two`
--
INSERT INTO `event_management_plan_two` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'Mobile Plant & Equipment Insurance', 50000, 0, 0, 0, 0, 'icons8-colosseum-filled-100.png'),
(2, 'All Risk Insurance', 127500, 0, 0, 0, 0, 'icons8-low-priority-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `industries`
--
CREATE TABLE `industries` (
`id` int(11) NOT NULL,
`industry_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `industries`
--
INSERT INTO `industries` (`id`, `industry_name`) VALUES
(1, 'ADMINISTRATIVE SERVICE '),
(2, 'FOOD AND ACCOMONDATION'),
(3, 'RETAIL'),
(4, 'CONTRACTORS'),
(5, 'REAL ESTATE'),
(6, 'Event Management Industry '),
(7, 'Manufacturers');
-- --------------------------------------------------------
--
-- Table structure for table `list_accommodation`
--
CREATE TABLE `list_accommodation` (
`id` int(11) NOT NULL,
`business_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `list_accommodation`
--
INSERT INTO `list_accommodation` (`id`, `business_name`) VALUES
(1, 'Cafes'),
(2, 'Beauty Saloon'),
(3, 'Cake Shop'),
(4, 'Consulting Firm'),
(5, 'Clothing Retailers'),
(6, 'Travel Agencies');
-- --------------------------------------------------------
--
-- Table structure for table `list_administrative`
--
CREATE TABLE `list_administrative` (
`id` int(11) NOT NULL,
`business_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `list_administrative`
--
INSERT INTO `list_administrative` (`id`, `business_name`) VALUES
(1, 'Travel Agencies'),
(2, 'Architect Office'),
(3, 'Law Firms'),
(4, 'Accounting Firms');
-- --------------------------------------------------------
--
-- Table structure for table `list_contractor`
--
CREATE TABLE `list_contractor` (
`id` int(11) NOT NULL,
`business_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `list_contractor`
--
INSERT INTO `list_contractor` (`id`, `business_name`) VALUES
(1, 'Construction Equipment Insurance ');
-- --------------------------------------------------------
--
-- Table structure for table `list_event_management`
--
CREATE TABLE `list_event_management` (
`id` int(11) NOT NULL,
`business_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `list_event_management`
--
INSERT INTO `list_event_management` (`id`, `business_name`) VALUES
(1, 'Event Organizer');
-- --------------------------------------------------------
--
-- Table structure for table `list_manufacturers`
--
CREATE TABLE `list_manufacturers` (
`id` int(11) NOT NULL,
`business_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `list_manufacturers`
--
INSERT INTO `list_manufacturers` (`id`, `business_name`) VALUES
(1, 'Sme manufacturers ');
-- --------------------------------------------------------
--
-- Table structure for table `list_real_estate`
--
CREATE TABLE `list_real_estate` (
`id` int(11) NOT NULL,
`business_model` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `list_real_estate`
--
INSERT INTO `list_real_estate` (`id`, `business_model`) VALUES
(1, 'Budget Hotels');
-- --------------------------------------------------------
--
-- Table structure for table `list_retail`
--
CREATE TABLE `list_retail` (
`id` int(11) NOT NULL,
`business_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `list_retail`
--
INSERT INTO `list_retail` (`id`, `business_name`) VALUES
(1, 'Cafes'),
(2, 'Beauty Saloon'),
(3, 'Cake Shop'),
(4, 'Consulting Firm'),
(5, 'Clothing Retailers'),
(6, 'Travel Agencies');
-- --------------------------------------------------------
--
-- Table structure for table `manufacturers_plan_one`
--
CREATE TABLE `manufacturers_plan_one` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `manufacturers_plan_one`
--
INSERT INTO `manufacturers_plan_one` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'FIDELITY GUARANTEE', 0, 0, 0, 0, 0, 'icons8-guarantee-filled-100.png'),
(2, 'FIRE INSURANCE', 0, 0, 0, 0, 0, 'icons8-fires-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `manufacturers_plan_two`
--
CREATE TABLE `manufacturers_plan_two` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `manufacturers_plan_two`
--
INSERT INTO `manufacturers_plan_two` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'ALL RISK', 0, 0, 0, 0, 0, 'icons8-guarantee-filled-100.png'),
(2, 'FIDELITY GUARANTEE', 0, 0, 0, 0, 0, 'icons8-fires-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `real_estate_plan_one`
--
CREATE TABLE `real_estate_plan_one` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` float NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `real_estate_plan_one`
--
INSERT INTO `real_estate_plan_one` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'FIRE CON LOSS', 185, 0, 0, 0, 0, 'icons8-fires-100.png'),
(2, 'MONEY', 185, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'BURLGARY', 185, 0, 0, 0, 0, 'icons8-burglary-100.png'),
(4, 'GLASS', 185, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(5, 'FIDELITY GUARANTEE', 185, 0, 0, 0, 0, 'icons8-guarantee-filled-100.png'),
(6, 'ALL RISKS', 185, 0, 0, 0, 0, 'icons8-low-priority-100.png'),
(7, 'PUBLIC LIABILITY', 185, 0, 0, 0, 0, 'icons8-public-100.png'),
(8, 'PERSONAL ACCIDENT', 185, 0, 0, 0, 0, 'icons8-crashed-car-100.png'),
(9, 'FIRE-1202-C1A', 3899.6, 0, 0, 0, 0, 'icons8-fires-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `real_estate_plan_two`
--
CREATE TABLE `real_estate_plan_two` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `real_estate_plan_two`
--
INSERT INTO `real_estate_plan_two` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'FIRE CON LOSS', 344.5, 0, 0, 0, 0, 'icons8-fires-100.png'),
(2, 'MONEY', 344.5, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'BURLGARY', 344.5, 0, 0, 0, 0, 'icons8-burglary-100.png'),
(4, 'GLASS', 344.5, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(5, 'FIDELITY GUARANTEE', 344.5, 0, 0, 0, 0, 'icons8-guarantee-filled-100.png'),
(6, 'ALL RISKS', 344.5, 0, 0, 0, 0, 'icons8-low-priority-100.png'),
(7, 'PUBLIC LIABILITY', 344.5, 0, 0, 0, 0, 'icons8-public-100.png'),
(8, 'PERSONAL ACCIDENT', 344.5, 0, 0, 0, 0, 'icons8-crashed-car-100.png'),
(9, 'FIRE', 3968, 0, 0, 0, 0, 'icons8-fires-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `retail_plan_one`
--
CREATE TABLE `retail_plan_one` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `retail_plan_one`
--
INSERT INTO `retail_plan_one` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(1, 'BURGLARY', 87, 0, 0, 0, 0, 'icons8-burglary-100.png'),
(2, 'MONEY', 87, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'GLASS BREAKAGE', 87, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(4, 'PUBLIC LIABILITY', 87, 0, 0, 0, 0, 'icons8-public-100.png'),
(5, 'EMPLOYERS LIABILITY', 87, 0, 0, 0, 0, 'icons8-name-tag-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `retail_plan_two`
--
CREATE TABLE `retail_plan_two` (
`id` int(11) NOT NULL,
`policy_name` varchar(255) NOT NULL,
`policy_price` double NOT NULL,
`sum_insured` double NOT NULL,
`rate` double NOT NULL,
`perils_rate_1_3` double NOT NULL,
`perils_rate_1_4` double NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `retail_plan_two`
--
INSERT INTO `retail_plan_two` (`id`, `policy_name`, `policy_price`, `sum_insured`, `rate`, `perils_rate_1_3`, `perils_rate_1_4`, `image`) VALUES
(2, 'MONEY', 170, 0, 0, 0, 0, 'icons8-coins-filled-100.png'),
(3, 'GLASS BREAKAGE', 170, 0, 0, 0, 0, 'icons8-fragile-100.png'),
(4, 'EMPLOYERS LIABILITY', 87, 0, 0, 0, 0, 'EMPLOYERS LIABILITY'),
(5, 'PUBLIC LIABILITY', 87, 0, 0, 0, 0, 'icons8-public-100.png'),
(6, 'BURGLARY', 87, 0, 0, 0, 0, 'icons8-burglary-100.png');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`) VALUES
(5, 'admin', <PASSWORD>');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `accommodation_plan_one`
--
ALTER TABLE `accommodation_plan_one`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `accommodation_plan_two`
--
ALTER TABLE `accommodation_plan_two`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `administrative_plan_one`
--
ALTER TABLE `administrative_plan_one`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `administrative_plan_two`
--
ALTER TABLE `administrative_plan_two`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contractor_plan_one`
--
ALTER TABLE `contractor_plan_one`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `customer_details`
--
ALTER TABLE `customer_details`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `event_management_plan_one`
--
ALTER TABLE `event_management_plan_one`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `event_management_plan_two`
--
ALTER TABLE `event_management_plan_two`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `industries`
--
ALTER TABLE `industries`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `list_accommodation`
--
ALTER TABLE `list_accommodation`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `list_administrative`
--
ALTER TABLE `list_administrative`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `list_contractor`
--
ALTER TABLE `list_contractor`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `list_event_management`
--
ALTER TABLE `list_event_management`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `list_manufacturers`
--
ALTER TABLE `list_manufacturers`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `list_real_estate`
--
ALTER TABLE `list_real_estate`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `list_retail`
--
ALTER TABLE `list_retail`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `manufacturers_plan_one`
--
ALTER TABLE `manufacturers_plan_one`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `manufacturers_plan_two`
--
ALTER TABLE `manufacturers_plan_two`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `real_estate_plan_one`
--
ALTER TABLE `real_estate_plan_one`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `real_estate_plan_two`
--
ALTER TABLE `real_estate_plan_two`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `retail_plan_one`
--
ALTER TABLE `retail_plan_one`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `retail_plan_two`
--
ALTER TABLE `retail_plan_two`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `accommodation_plan_one`
--
ALTER TABLE `accommodation_plan_one`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `accommodation_plan_two`
--
ALTER TABLE `accommodation_plan_two`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `administrative_plan_one`
--
ALTER TABLE `administrative_plan_one`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `administrative_plan_two`
--
ALTER TABLE `administrative_plan_two`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `contractor_plan_one`
--
ALTER TABLE `contractor_plan_one`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `customer_details`
--
ALTER TABLE `customer_details`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `event_management_plan_one`
--
ALTER TABLE `event_management_plan_one`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `event_management_plan_two`
--
ALTER TABLE `event_management_plan_two`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `industries`
--
ALTER TABLE `industries`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `list_accommodation`
--
ALTER TABLE `list_accommodation`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `list_administrative`
--
ALTER TABLE `list_administrative`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `list_contractor`
--
ALTER TABLE `list_contractor`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `list_event_management`
--
ALTER TABLE `list_event_management`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `list_manufacturers`
--
ALTER TABLE `list_manufacturers`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `list_real_estate`
--
ALTER TABLE `list_real_estate`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `list_retail`
--
ALTER TABLE `list_retail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `manufacturers_plan_one`
--
ALTER TABLE `manufacturers_plan_one`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `manufacturers_plan_two`
--
ALTER TABLE `manufacturers_plan_two`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `real_estate_plan_one`
--
ALTER TABLE `real_estate_plan_one`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `real_estate_plan_two`
--
ALTER TABLE `real_estate_plan_two`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `retail_plan_one`
--
ALTER TABLE `retail_plan_one`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `retail_plan_two`
--
ALTER TABLE `retail_plan_two`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
INSERT INTO "Users" ("Name", "Email", "ExternalId", "FamilyName", "GivenName", "IsLocked", "Locale", "Phone", "Timezone") VALUES
( '<NAME>', '<EMAIL>', 'google-oauth2|116747902156680384840', 'Hubbard', 'Chris', '0', NULL, NULL, NULL),
( '<NAME>', '<EMAIL>', 'google-oauth2|114981819181509824425', 'Moore', 'David', '0', NULL, NULL, NULL),
( '<NAME>', '<EMAIL>', 'google-oauth2|102643649500459434996', 'Dyck', 'Bill', '0', NULL, NULL, NULL),
( '<NAME>', '<EMAIL>', 'google-oauth2|116603781884964961816', 'Loren', 'Hawthorne', '0', NULL, NULL, NULL),
( '<NAME> (Kalaam)', '<EMAIL>', 'auth0|5b578f6197af652b19f9bb41', 'Hubbard', 'Chris', '0', NULL, NULL, NULL);
INSERT INTO "Organizations" ("Name", "WebsiteUrl", "BuildEngineUrl", "BuildEngineApiAccessToken", "LogoUrl", "OwnerId") VALUES
( 'SIL International', 'https://sil.org', 'https://replace.scriptoria.io:8443', 'replace', 'https://www.sil.org/sites/default/files/sil-logo-blue-2017_1.png', 1),
( 'Kalaam Media', 'https://kalaam.org', 'https://replace.scriptoria.io:8443', 'replace', NULL, 1),
( 'Faith Comes By Hearing', 'https://kalaam.org', 'https://replace.scriptoria.io:8443', 'replace', 'https://cdn.faithcomesbyhearing.com/resources/fcbh/img/media-kit/thumbs/fcbh-logo-white-two-line-v3.png', 1),
( 'Scripture Earth', 'https://scriptureearth.org', 'https://replace.scriptoria.io:8443', 'replace', 'https://s3.amazonaws.com/scriptureearth/scriptureearth.png', 1);
INSERT INTO "OrganizationProductDefinitions" ("OrganizationId", "ProductDefinitionId") VALUES
(1, 1),
(2, 1),
(3, 1);
INSERT INTO "OrganizationStores" ("OrganizationId", "StoreId") VALUES
(1, 1),
(2, 2),
(3, 3),
(4, 3);
INSERT INTO "Groups" ("Name", "Abbreviation", "OwnerId") VALUES
( 'Language Software Development', 'LSDEV', 1),
( 'Chad Branch', 'CHB', 1),
( 'Mexico Branch', 'MXB', 1),
( 'AuSIL', 'AAB', 1),
( 'Americas Group', 'AMG', 1),
( 'Asia Area', 'ASA', 1),
( 'Camaroon Branch', 'CMB', 1),
( 'Roma Region', 'RMA', 1),
( 'The Seed Company', 'RSM', 1),
( 'SIL International', 'SIL', 1), -- 10
( 'Mainland Southeast Asia Group', 'THG', 1),
( 'Wycliffe Taiwan', 'TWN', 1),
( 'West Africa', 'WAF', 1),
( 'Kalaam', 'KAL', 2),
( 'FCBH', 'FCBH', 3),
( 'Scripture Earth', 'SE', 4);
INSERT INTO "OrganizationMemberships" ("UserId", "OrganizationId") VALUES
( 1, 1), -- <EMAIL> - SIL
( 1, 2), -- <EMAIL> - Kalaam
( 1, 3), -- <EMAIL> - FCBH
( 2, 1), -- <EMAIL> - SIL
( 3, 1), -- <EMAIL> - SIL
( 3, 4), -- <EMAIL> - SE
( 4, 1), -- <EMAIL> - SIL
( 5, 2); -- <EMAIL> - Kalaam
INSERT INTO "GroupMemberships" ("UserId", "GroupId") VALUES
( 1, 1),
( 2, 1),
( 3, 5),
( 3, 6),
( 3, 11),
( 3, 12),
( 3, 16),
( 4, 3),
( 5, 14);
INSERT INTO "UserRoles" ("UserId", "RoleId", "OrganizationId") VALUES
( 1, 1, 1), -- <EMAIL> - SuperAdmin - SIL
( 1, 2, 1), -- <EMAIL> - OrgAdmin - SIL
( 1, 1, 2), -- <EMAIL> - SuperAdmin - Kalaam
( 1, 1, 3), -- <EMAIL> - SuperAdmin - FCBH
( 1, 1, 4), -- <EMAIL> - SuperAdmin - SE
( 2, 1, 1), -- <EMAIL> - SuperAdmin - SIL
( 2, 2, 1), -- <EMAIL> - OrgAdmin - SIL
( 3, 2, 1), -- <EMAIL> - OrgAdmin - SIL
( 3, 2, 4), -- <EMAIL> - OrgAdmin - SE
( 4, 3, 1), -- <EMAIL> - AppBuilder - SIL
( 5, 3, 3); -- <EMAIL> - AppBuilder - Kalaam
|
<reponame>vuthysin5284/school<filename>doc/Eng/leave_reason.sql
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.17 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping structure for table school.leave_reason
CREATE TABLE IF NOT EXISTS `leave_reason` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`leave_reason_name` varchar(50) NOT NULL DEFAULT '0',
`description` varchar(150) NOT NULL DEFAULT '0',
`status` int(1) NOT NULL DEFAULT '1',
`created_by` int(11) NOT NULL,
`created_date` datetime NOT NULL,
`modified_by` int(11) NOT NULL,
`modified_date` datetime NOT NULL,
`is_delete` int(11) NOT NULL,
`delete_by` int(11) NOT NULL,
`delete_date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- Dumping data for table school.leave_reason: ~2 rows (approximately)
DELETE FROM `leave_reason`;
/*!40000 ALTER TABLE `leave_reason` DISABLE KEYS */;
INSERT INTO `leave_reason` (`id`, `leave_reason_name`, `description`, `status`, `created_by`, `created_date`, `modified_by`, `modified_date`, `is_delete`, `delete_by`, `delete_date`) VALUES
(1, 'Sick', 'nothing', 1, 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00'),
(2, 'hurt', 'none', 1, 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00'),
(3, 'se', 'et', 1, 1, '2017-07-08 03:27:05', 0, '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00');
/*!40000 ALTER TABLE `leave_reason` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
<reponame>NachiMK/nodejs
select max("ServiceAreaID") FROM public."ServiceAreas"
|
<gh_stars>1-10
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`firstname` varchar(255) default NULL,
`lastname` varchar(255) default NULL,
`email` varchar(255) UNIQUE default NULL
);
|
<gh_stars>1-10
DROP FUNCTION IF EXISTS adm.UDF_CHK_NamingAll
GO
CREATE FUNCTION adm.UDF_CHK_NamingAll ()
RETURNS TABLE
AS
RETURN
SELECT * from adm.UDF_CHK_NamingFunction()
UNION ALL
SELECT * from adm.UDF_CHK_NamingProcedure()
UNION ALL
SELECT * from adm.UDF_CHK_NamingTableAndView()
;
-- Usage
-- SELECT * FROM adm.UDF_CHK_NamingAll ()
|
<gh_stars>1-10
--
-- Name: hazard_map; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE IF NOT EXISTS public.hazard_map (
id integer NOT NULL,
notes character varying(255),
measuring_station_id integer,
place_name character varying(255),
return_period integer,
CONSTRAINT flood_map_pkey PRIMARY KEY (id),
CONSTRAINT flood_map_reporting_point_id_fk FOREIGN KEY (measuring_station_id) REFERENCES public.reporting_point(id)
);
--
-- Name: flood_map_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE IF NOT EXISTS public.flood_map_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: flood_map_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.flood_map_id_seq OWNED BY public.hazard_map.id;
--
-- Name: hazard_map id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.hazard_map ALTER COLUMN id SET DEFAULT nextval('public.flood_map_id_seq'::regclass);
--
-- Name: flood_map_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX IF NOT EXISTS flood_map_id ON public.hazard_map USING btree (id);
|
--liquibase formatted sql
--changeset alexey.novikov:001
CREATE TABLE `properties` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`application` VARCHAR(255),
`profile` VARCHAR(255),
`label` VARCHAR(255),
`key` VARCHAR(255),
`value` VARCHAR(255),
`updatedOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `properties` (`application`, `profile`, `label`, `key`, `value`) VALUES
('local', 'default', 'latest', 'feature-flags.is-new-papers-service-enabled', 'true');
|
-- -----------------------------------------------------
-- Add geonameid to gadm country
-- -----------------------------------------------------
UPDATE gadm_country a
SET geonameid=b.country_id
FROM geonames_country b
WHERE a.gid_0=b.iso_alpha3
;
-- Fix screwed-up iso3 code for south sudan
UPDATE gadm_country a
SET gid_0='SDS'
WHERE name_0='South Sudan'
;
|
--[1] 게시판(DotNetNote)에 글을 작성 : WriteNote
Create Proc dbo.WriteNote
-- 5W1H
@Name NVarChar(25),
@PostIp NVarChar(15),
@Title NVarChar(150),
@Content NText,
@Category NVarChar(10),
@Email NVarChar(100),
@Password NVarChar(255),
@Encoding NVarChar(10),
@Homepage NVarChar(100),
@FileName NVarChar(255),
@FileSize Int
As
--[A] Ref 열에 일련번호 생성(현재 저장된 Ref 중 가장 큰 값에 1을 더해서 증가) 및 그룹화
Declare @MaxRef Int
Select @MaxRef = Max(IsNull(Ref, 0)) From Notes
If @MaxRef Is Null Or @MaxRef = 0
Set @MaxRef = 1 -- 테이블 생성 후 처음만 비교
Else
Set @MaxRef = @MaxRef + 1
--[B] 만들어진 데이터를 저장하기
Insert Notes
(
Name, Email, Title, PostIp, Content, Password, Encoding,
Homepage, Ref, FileName, FileSize,
Category
)
Values
(
@Name, @Email, @Title, @PostIp, @Content, @Password, @Encoding,
@Homepage, @MaxRef, @FileName, @FileSize,
@Category
)
Go
|
CREATE DATABASE IF NOT EXISTS template_node_egg DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci;
|
insert into business_constants (description, value, name) values ("Percentage taken on successful reservation.", 15.00, "ptosr");
insert into administrator (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Marko", "Stankovic", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "J<PASSWORD>ille", "Canada", "064121213", TRUE, 1291623784);
insert into administrator (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Stanko", "Markovic", "<EMAIL>", "0", "<PASSWORD>", "Johnville", "Canada", "064121213", TRUE, -1872771714);
insert into administrator (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Nikola", "Todorčevic", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "Johnville", "Canada", "064121213", TRUE, 625244223);
insert into boat_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Damon", "Beasley", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "Johnville", "Canada", "064121213", TRUE, -1171707136);
-- <EMAIL>
insert into boat_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Arden", "Dodge", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "Johnville", "Canada", "064121213", TRUE, 1326308801);
insert into boat_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Jemima", "Fishman", "<EMAIL>", "testpassword", "<PASSWORD>", "<PASSWORD>", "Canada", "064121213", TRUE, -470642558);
--neodobren
insert into boat_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Doug", "Leon", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "<PASSWORD>", "Canada", "064121213", FALSE, 924836377);
insert into cottage_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Mike", "Oxmaul", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "<PASSWORD>", "Canada", "064121213", TRUE, 2027373379);
insert into cottage_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Gil", "Sumner", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "J<PASSWORD>", "Canada", "064121213", TRUE, 230422020);
insert into cottage_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Gus", "Fring", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "Johnville", "Canada", "064121213", TRUE, -1566529339);
--neodobren
insert into cottage_owner (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Ted", "Osbourne", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "J<PASSWORD>", "Canada", "064121213", FALSE, -872114982);
insert into fishing_instructor (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash, start_work_period, end_work_period) values ("Zhon", "China", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "J<PASSWORD>ille", "Canada", "064121213", TRUE, 931486598, "2023-01-01", "2028-01-15" );
insert into fishing_instructor (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash, start_work_period, end_work_period) values ("Topher", "Craft", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "<PASSWORD>", "Canada", "064121213", TRUE, -865464761, "2023-01-01", "2028-01-15" );
insert into fishing_instructor (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash, start_work_period, end_work_period) values ("Rickie", "Croft", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "J<PASSWORD>", "Canada", "064121213", TRUE, -1178357357, "2023-01-01", "2028-01-15" );
--neodobren
insert into fishing_instructor (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash, start_work_period, end_work_period) values ("Wendell", "Wade", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "Johnville", "Canada", "064121213", FALSE, 1625900955, "2023-01-01", "2028-01-15" );
insert into request_for_admin(for_type, user_registration_reason, requester_id) values (1, "Description of a registration request 1.", 4);
insert into request_for_admin(for_type, user_registration_reason, requester_id) values (3, "Description of a registration request 2.", 4);
insert into request_for_admin(for_type, user_registration_reason, requester_id) values (5, "Description of a registration request 3.", 4);
insert into deletion_request(for_type, reason, requester_id, name, lastname) values (1, "I want another account.", 2, "Arden", "Dodge");
insert into deletion_request(for_type, reason, requester_id, name, lastname) values (3, "Just delete it please.", 1, "Clair", "Albertson");
insert into registered_user (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Oliver", "Brooks", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "Johnville", "Canada", "064121213", TRUE, 1319658580);
insert into registered_user (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Max", "Morris", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "Johnville", "Canada", "064121213", TRUE, -477292779);
insert into registered_user (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Rory", "Atkinson", "<EMAIL>", "testpassword", "<PASSWORD>", "<PASSWORD>", "Canada", "064121213", TRUE, 2020723158);
insert into registered_user (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Jennifer", "Wells", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "<PASSWORD>", "Canada", "064121213", TRUE, 223771799);
insert into registered_user (name, lastname, email, password, address, city, country, telephone_number, authenticated, email_hash) values ("Isabel", "Poole", "<EMAIL>", "<PASSWORD>", "<PASSWORD>", "<PASSWORD>", "Canada", "064121213", TRUE, -1573179560);
insert into cottage(name, address, geo_lng, geo_lat, promo_description, rules, price_per_day, price_and_info, reservation_start, reservation_end, max_users, owner_id, hidden) values ("Old Pine Cabin", "Montauk, New York", 41.049690, -71.909219, "Sample Promo Description", "Sample Rules", 130.00, "Speakers:30;Bar:20", "2020-01-01", "2026-01-01", 4, 1, false);
insert into cottage(name, address, geo_lng, geo_lat, promo_description, rules, price_per_day, price_and_info, reservation_start, reservation_end, max_users, owner_id, hidden) values ("<NAME>", "<NAME>", 44.415146, -73.254865, "Sample Promo Description", "Sample Rules", 185.00, "Speakers:40;Bar:20", "2020-01-01", "2028-01-01", 3, 1, false);
insert into cottage(name, address, geo_lng, geo_lat, promo_description, rules, price_per_day, price_and_info, reservation_start, reservation_end, max_users, owner_id, hidden) values ("Old Fishing Place", "Diamond Lake, Oregon", 43.163765, -122.167166, "Sample Promo Description", "Sample Rules", 90.00, "Speakers:50;Bar:20", "2020-01-01", "2023-01-01", 5, 1, false);
insert into cottage(name, address, geo_lng, geo_lat, promo_description, rules, price_per_day, price_and_info, reservation_start, reservation_end, max_users, owner_id, hidden) values ("Catfish Lounge", "<NAME>, Michigan", 47.473378, -87.902598, "Sample Promo Description", "Sample Rules", 150.00, "Speakers:60;Bar:20", "2020-01-01", "2028-01-01", 2, 1, false);
insert into cottage(name, address, geo_lng, geo_lat, promo_description, rules, price_per_day, price_and_info, reservation_start, reservation_end, max_users, owner_id, hidden) values ("Lumberjack's Getaway", "Deer Lake, Newfoundland", 49.139093, -57.552313, "Sample Promo Description", "Sample Rules", 150.00, "Speakers:70;Bar:20", "2020-01-01", "2028-01-01", 4, 1, false);
insert into room(cottage_id, number_of_beds, hidden) values (1, 2, false);
insert into room(cottage_id, number_of_beds, hidden) values (1, 4, false);
insert into room(cottage_id, number_of_beds, hidden) values (2, 2, false);
insert into room(cottage_id, number_of_beds, hidden) values (2, 2, false);
insert into room(cottage_id, number_of_beds, hidden) values (3, 4, false);
insert into room(cottage_id, number_of_beds, hidden) values (4, 6, false);
insert into room(cottage_id, number_of_beds, hidden) values (5, 8, false);
insert into adventure(name, address, geo_lng, geo_lat, promo_description, instructor_id, instructor_bio, equipment, rules, price_and_info, percent_taken_if_cancelled, location, max_users, price_per_day, hidden) values ("Bow Fishing", "Wolfe Island, Ontario", 44.151642, -76.375484, "Sample Promo Description", 1, "Sample bio", "Sample Equipment", "Sample Rules", "Speakers:30;Bar:20", 90, "Sample Location", 2, 100, false);
insert into adventure(name, address, geo_lng, geo_lat, promo_description, instructor_id, instructor_bio, equipment, rules, price_and_info, percent_taken_if_cancelled, location, max_users, price_per_day, hidden) values ("Isolated Fishing", "Bar Harbour, Maine", 44.374710, -68.191748, "Sample Promo Description", 1, "Sample bio", "Sample Equipment", "Sample Rules", "Speakers:30;Bar:20", 90, "Sample Location", 2, 60, false);
insert into adventure(name, address, geo_lng, geo_lat, promo_description, instructor_id, instructor_bio, equipment, rules, price_and_info, percent_taken_if_cancelled, location, max_users, price_per_day, hidden) values ("Ice Fishing", "Arcadia, Alberta", 55.402453, -116.123231, "Sample Promo Description", 1, "Sample bio", "Sample Equipment", "Sample Rules", "Speakers:30;Bar:20", 90, "Sample Location", 2, 85, false);
insert into adventure(name, address, geo_lng, geo_lat, promo_description, instructor_id, instructor_bio, equipment, rules, price_and_info, percent_taken_if_cancelled, location, max_users, price_per_day, hidden) values ("Net Fishing", "Bering Strait", 65.562156, -168.451294, "Sample Promo Description", 1, "Sample bio", "Sample Equipment", "Sample Rules", "Speakers:30;Bar:20", 90, "Sample Location", 2, 70, false);
insert into subscription (for_entity, subbed_id, subber_id) values (0, 1, 1);
insert into subscription (for_entity, subbed_id, subber_id) values (2, 1, 1);
insert into subscription (for_entity, subbed_id, subber_id) values (4, 1, 1);
insert into boat(owner_id ,name, type, boat_length, engine_number, engine_power, max_speed, navigation_equipment, address, geo_lng, geo_lat, promo_description, rules, price_per_day, reservation_start, reservation_end, price_and_info, max_users, hidden, equipment)
values(1, "Nepotopivi 2", "Yamaha", "15", 1, 321, 321, "Sonar", "Jarkovci, Serbia", 45.043798, 20.027075, "VeryFastBoy", "Don't talk about Nepotopivi 1", 50, "2023-01-01", "2023-01-15", "Speakers:30;Bar:20", 7, false, "stap za pecanje");
insert into boat(owner_id ,name, type, boat_length, engine_number, engine_power, max_speed, navigation_equipment, address, geo_lng, geo_lat, promo_description, rules, price_per_day, reservation_start, reservation_end, price_and_info, max_users, hidden, equipment)
values(1, "Margo", "Yamaha", "15", 1, 321, 321, "Sonar", "Bar Harbour, Maine", 44.374710, -68.191748, "VeryFastBoy", "Nije lose", 50, "2023-01-01", "2028-01-15", "Speakers:30;Bar:20", 7, false, "stap za pecanje");
insert into boat(owner_id ,name, type, boat_length, engine_number, engine_power, max_speed, navigation_equipment, address, geo_lng, geo_lat, promo_description, rules, price_per_day, reservation_start, reservation_end, price_and_info, max_users, hidden, equipment)
values(1, "Bay City Jewel", "Yamaha", "15", 1, 321, 321, "Sonar", "Bay City State Park, Michigan", 43.666608, -83.901237, "VeryFastBoy", "Ipak nije tako brz", 50, "2023-01-01", "2028-01-15", "Speakers:30;Bar:20", 7, false, "stap za pecanje");
insert into boat(owner_id ,name, type, boat_length, engine_number, engine_power, max_speed, navigation_equipment, address, geo_lng, geo_lat, promo_description, rules, price_per_day, reservation_start, reservation_end, price_and_info, max_users, hidden, equipment)
values(1, "Just a Splash", "Yamaha", "15", 1, 321, 321, "Sonar", "Claremont, Virginia", 37.231071, -76.954797, "VeryFastBoy", "Potopio nepotopivog1", 50, "2023-01-01", "2028-01-15", "Speakers:30;Bar:20", 7, false, "stap za pecanje");
insert into boat(owner_id ,name, type, boat_length, engine_number, engine_power, max_speed, navigation_equipment, address, geo_lng, geo_lat, promo_description, rules, price_per_day, reservation_start, reservation_end, price_and_info, max_users, hidden, equipment)
values(1, "<NAME>", "Yamaha", "15", 1, 321, 321, "Sonar", "Key West, Florida", 24.549540, -81.780825, "Holie", "Ovaj jeste Sveti Peti", 50, "2023-01-01", "2028-01-15", "Speakers:30;Bar:20", 7, false, "stap za pecanje");
--rezervacije u prvoj polovini januara, pravice problem u januaru
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (1, "2020-01-01", "2023-01-05", 1, false, 0, 2, "", 1);
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (2, "2020-01-01", "2023-01-05", 2, false, 0, 2, "", 1);
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (1, "2020-01-01", "2023-01-05", 3, false, 0, 2, "", 2);
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (1, 1, "2020-01-01", "2023-01-02", 0, false, "", 6);
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (2, 2, "2020-01-01", "2023-01-02", 0, false, "", 6);
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (3, 3, "2020-01-01", "2023-01-02", 0, false, "", 6);
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (2, 1, "2023-01-03", "2023-01-04", 0, false, "", 6);
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (3, 3, "2023-01-05", "2023-01-06", 0, false, "", 6);
-- Akcije
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (0, 1, "2023-01-05", "2023-01-06", 35, true, "", 6);
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(1, "2022-01-12", "2022-02-01", 2, 0, false, 1, "", 1);
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(1, "2022-03-01", "2022-04-01", 2, 0, false, 1, "", 1);
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(1, "2022-04-15", "2022-05-01", 2, 0, false, 1, "", 1);
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(1, "2020-01-01", "2021-01-01", 2, 0, false, 1, "", 1);
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(2, "2020-01-01", "2021-01-01", 2, 0, false, 1, "", 1);
-- Akcije
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(1, "2022-12-12", "2023-02-01", 2, 70, true, 0, "", 1);
-- Ovo su rezervacije za SOBE, ne za Cottage
-- Rezervacija u proslosti radi prikaza
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (1, "1990-01-01", "1990-01-05", 1, false, 0, 2, "", 1);
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (1, "2021-01-01", "2021-02-01", 1, false, 0, 2, "", 1);
-- Akcije
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (1, "2022-02-02", "2023-02-01", 0, true, 50, 2, "", 1);
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (2, "2023-01-01", "2024-02-01", 0, true, 50, 2, "", 1);
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (3, "2024-01-01", "2025-02-01", 0, true, 70, 2, "", 2);
insert into room_booking (booked_room_id, start, end, registered_user_id, quick_booking, price, max_users, extra_service, cottage_id)
values (4, "2024-01-01", "2025-02-01", 0, true, 75, 2, "", 2);
-- Past Bookings
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (1, 1, "1990-01-01", "1990-01-02", 0, false, "", 6);
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (2, 1, "1990-01-03", "1990-01-04", 0, false, "", 6);
insert into boat_booking(registered_user_id, booked_boat_id, start, end, price, quick_booking, extra_service, max_users)
values (3, 3, "1990-01-05", "1990-01-06", 0, false, "", 6);
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(1, "1990-01-01", "1990-02-01", 2, 0, false, 1, "", 1);
insert into adventure_booking(booked_adventure_id, start, end, max_users, price, quick_booking, registered_user_id, extra_service, booked_instructor_id)
values(1, "1990-01-03", "1990-01-04", 2, 0, false, 1, "", 1);
insert into revision(type, booking_id, revised, revision, rating, approved, denied, main_entity_id)
values (0, 7, true, "Turbulent...", 2.5, false, false, 1);
insert into revision(type, booking_id, revised, revision, rating, approved, denied, main_entity_id)
values (2, 4, true, "Very comfy!", 4.33333333, false, false, 1);
insert into revision(type, booking_id, revised, revision, rating, approved, denied, main_entity_id)
values (4, 7, true, "The instructor was very funny.", 5, false, false, 1);
insert into appeal(type, booking_id, appeal) values (0, 4, "There's a big hole in the floor...");
insert into appeal(type, booking_id, appeal) values (2, 2, "Please change the sink.");
insert into appeal(type, booking_id, appeal) values (4, 3, "All the equipment is old.");
|
<reponame>amagais/sql-challenge<gh_stars>0
--Question #1
--List the following details of each employee:
--employee number, last name, first name, gender, and salary.
SELECT e.emp_no, e.last_name, e.first_name, e.gender, s.salary
FROM employees e
LEFT JOIN salaries s
ON e.emp_no = s.emp_no;
--Question #2
--List employees who were hired in 1986.
SELECT *
FROM employees e
WHERE DATE_PART('year',hire_date) = 1986;
--Question #3
SELECT d.dept_no, d.dept_name, m.emp_no, e.first_name,e.last_name, dt.from_date, dt.to_date
FROM departments AS d
LEFT JOIN dept_manager AS m
ON (d.dept_no = m.dept_no)
INNER JOIN employees AS e
ON (m.emp_no = e.emp_no)
INNER JOIN dept_emp AS dt
ON (e.emp_no = dt.emp_no );
--Question #4
--List the department of each employee with the following information:
--employee number, last name, first name, and department name.
SELECT e.emp_no, e.first_name,e.last_name, d.dept_name
FROM employees AS e
INNER JOIN dept_manager AS m
ON (e.emp_no = m.emp_no)
INNER JOIN departments AS d
ON (m.dept_no = d.dept_no);
--Question #5
SELECT *
FROM employees e
WHERE e.first_name = 'Hercules' AND SUBSTRING(last_name, 1, 1) = 'B';
--Question #6
--List all employees in the Sales department,
--including their employee number, last name, first name, and department name.
SELECT e.emp_no,e.first_name,e.last_name,d.dept_name
FROM employees AS e
LEFT JOIN dept_manager AS m
ON (e.emp_no = m.emp_no)
INNER JOIN departments as d
ON (m.dept_no = d.dept_no)
WHERE d.dept_name IN
(
SELECT d.dept_name
FROM departments
WHERE d.dept_name = 'Sales'
)
--QUestion #7
--List all employees in the Sales and Development departments,
--including their employee number, last name, first name, and department name.
SELECT e.emp_no,e.first_name,e.last_name,d.dept_name
FROM employees AS e
LEFT JOIN dept_manager AS m
ON (e.emp_no = m.emp_no)
INNER JOIN departments as d
ON (m.dept_no = d.dept_no)
WHERE d.dept_name IN
(
SELECT d.dept_name
FROM departments
WHERE d.dept_name = 'Sales' AND d.dept_name = 'Development'
)
--Question #8
--In descending order, list the frequency count of employee last names,
--i.e., how many employees share each last name.
SELECT e.last_name, COUNT (e.last_name) AS last_count
FROM employees e
GROUP BY e.last_name
ORDER BY last_count DESC;
|
# Copyright 2020 Google LLC..
#
# 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.
-- Creates a latest snapshot view of products.
--
-- The Products_<Merchant Id> table has product data partitioned by date.
-- This view will get latest product data and create derived columns useful
-- for further processing of data.
CREATE OR REPLACE VIEW `{project_id}.{dataset}.product_view_{merchant_id}`
AS (
WITH
ApprovedOffer AS (
SELECT DISTINCT
_PARTITIONDATE,
product_id,
merchant_id,
target_country
FROM
`{project_id}.{dataset}.Products_{merchant_id}` AS Products,
Products.destinations,
destinations.approved_countries AS target_country
),
PendingOffer AS (
SELECT DISTINCT
_PARTITIONDATE,
product_id,
merchant_id,
target_country
FROM
`{project_id}.{dataset}.Products_{merchant_id}` AS Products,
Products.destinations,
destinations.pending_countries AS target_country
),
DisapprovedOffer AS (
SELECT DISTINCT
_PARTITIONDATE,
product_id,
merchant_id,
target_country
FROM
`{project_id}.{dataset}.Products_{merchant_id}` AS Products,
Products.destinations,
destinations.disapproved_countries AS target_country
),
OfferIssue AS (
SELECT
_PARTITIONDATE,
product_id,
merchant_id,
target_country,
STRING_AGG(
IF(LOWER(issues.servability) = 'disapproved', issues.short_description, NULL), ", ")
AS disapproval_issues,
STRING_AGG(
IF(LOWER(issues.servability) = 'demoted', issues.short_description, NULL), ", ")
AS demotion_issues,
STRING_AGG(
IF(LOWER(issues.servability) = 'unaffected', issues.short_description, NULL), ", ")
AS warning_issues
FROM
`{project_id}.{dataset}.Products_{merchant_id}` AS Products,
Products.issues,
issues.applicable_countries AS target_country
GROUP BY
1, 2, 3, 4
),
MultiChannelTable AS (
SELECT DISTINCT
_PARTITIONDATE,
merchant_id,
product_id
FROM
`{project_id}.{dataset}.Products_{merchant_id}`
GROUP BY
_PARTITIONDATE,
merchant_id,
product_id
HAVING COUNT(DISTINCT(channel)) > 1
),
LatestDate AS (
SELECT
MAX(_PARTITIONDATE) AS latest_date
FROM
`{project_id}.{dataset}.Products_{merchant_id}`
),
ProductStatus AS (
SELECT
Products._PARTITIONDATE as data_date,
LatestDate.latest_date,
Products.product_id,
Products.merchant_id,
Products.aggregator_id,
Products.offer_id,
Products.title,
Products.description,
Products.link,
Products.mobile_link,
Products.image_link,
Products.additional_image_links,
Products.content_language,
COALESCE(
ApprovedOffer.target_country,
PendingOffer.target_country,
DisapprovedOffer.target_country) AS target_country,
Products.channel,
Products.expiration_date,
Products.google_expiration_date,
Products.adult,
Products.age_group,
Products.availability,
Products.availability_date,
Products.brand,
Products.color,
Products.condition,
Products.custom_labels,
Products.gender,
Products.gtin,
Products.item_group_id,
Products.material,
Products.mpn,
Products.pattern,
Products.price,
Products.sale_price,
Products.sale_price_effective_start_date,
Products.sale_price_effective_end_date,
Products.google_product_category,
Products.google_product_category_path,
Products.product_type,
Products.additional_product_types,
IF(ApprovedOffer.product_id IS NULL, 0, 1) is_approved,
CONCAT(CAST(Products.merchant_id AS STRING), '|', Products.product_id)
AS unique_product_id,
IFNULL(SPLIT(Products.product_type, '>')[SAFE_OFFSET(0)], 'N/A') AS product_type_l1,
IFNULL(SPLIT(Products.product_type, '>')[SAFE_OFFSET(1)], 'N/A') AS product_type_l2,
IFNULL(SPLIT(Products.product_type, '>')[SAFE_OFFSET(2)], 'N/A') AS product_type_l3,
IFNULL(SPLIT(Products.product_type, '>')[SAFE_OFFSET(3)], 'N/A') AS product_type_l4,
IFNULL(SPLIT(Products.product_type, '>')[SAFE_OFFSET(4)], 'N/A') AS product_type_l5,
IFNULL(SPLIT(Products.google_product_category_path, '>')[SAFE_OFFSET(0)], 'N/A')
AS google_product_category_l1,
IFNULL(SPLIT(Products.google_product_category_path, '>')[SAFE_OFFSET(1)], 'N/A')
AS google_product_category_l2,
IFNULL(SPLIT(Products.google_product_category_path, '>')[SAFE_OFFSET(2)], 'N/A')
AS google_product_category_l3,
IFNULL(SPLIT(Products.google_product_category_path, '>')[SAFE_OFFSET(3)], 'N/A')
AS google_product_category_l4,
IFNULL(SPLIT(Products.google_product_category_path, '>')[SAFE_OFFSET(4)], 'N/A')
AS google_product_category_l5,
IF(Products.availability = 'in stock', 1, 0) AS in_stock,
IF(MultiChannelTable.product_id IS NULL, 'single_channel', 'multi_channel') AS channel_exclusivity
FROM
`{project_id}.{dataset}.Products_{merchant_id}` AS Products,
LatestDate
LEFT JOIN ApprovedOffer USING (_PARTITIONDATE, product_id, merchant_id)
LEFT JOIN PendingOffer USING (_PARTITIONDATE, product_id, merchant_id)
LEFT JOIN DisapprovedOffer USING (_PARTITIONDATE, product_id, merchant_id)
LEFT JOIN MultiChannelTable USING (_PARTITIONDATE, product_id, merchant_id)
)
SELECT
ProductStatus.*,
OfferIssue.disapproval_issues,
OfferIssue.demotion_issues,
OfferIssue.warning_issues
FROM
ProductStatus
LEFT JOIN OfferIssue
ON
OfferIssue._PARTITIONDATE = ProductStatus.data_date
AND OfferIssue.product_id = ProductStatus.product_id
AND OfferIssue.merchant_id = ProductStatus.merchant_id
AND OfferIssue.target_country = ProductStatus.target_country
);
|
INSERT INTO permissao VALUES(3, 'ROLE_CANCELAR_VENDA');
INSERT INTO grupo_permissao (codigo_grupo, codigo_permissao) VALUES(1, 3);
|
INSERT INTO transmission (id, type)
VALUES (10, 'Automatic'),
(11, 'Manual');
INSERT INTO engine (id, type)
VALUES (20, 'Diesel'),
(21, 'Electric'),
(22, 'Flex-Fuel'),
(23, 'Gasoline'),
(24, 'Hybrid'),
(25, 'Unknown');
INSERT INTO body (id, type)
VALUES (30, 'Sedan'),
(31, 'SUV / Crossover'),
(32, 'Pickup Truck'),
(33, 'Coupe'),
(34, 'Hatchback'),
(35, 'Convertible'),
(36, 'Wagon'),
(37, 'Minivan');
INSERT INTO vendor(id, name, country)
VALUES (50, 'Mazda', 'Japan'),
(51, 'BMW', 'Germany'),
(52, 'Honda', 'Japan'),
(53, 'Ford', 'USA');
INSERT INTO users(id, name, login, password, role, registered)
VALUES (1, 'User', 'user', 'password', '<PASSWORD>', '2020-01-03 10:00:00'),
(2, 'Admin', 'dealer', 'dealer', 'ADMIN', '2019-01-01 10:00:00');
INSERT INTO car (id, vendor_id, model, year, mileage, transmission_id, engine_id, body_id)
VALUES (100, 50, 'Mazda6 Signature', 2019, DEFAULT, 10, 23, 33),
(101, 51, 'M5', 2008, 54475, 11, 22, 30),
(102, 52, 'Element EX', 2010, DEFAULT, 10, 22, 34),
(103, 50, 'MAZDA3 Touring', 2018, 36623, 10, 23, 30),
(104, 53, '<NAME>', 2015, 61741, 11, 25, 30);
INSERT INTO post(id, user_id, car_id, price, title, posted, message)
VALUES (150, 2, 100, 2440000, 'Best car I have owned', DEFAULT,
'Jet Black 2019 Mazda Mazda6 Signature FWD Automatic 2.5L 4-Cylinder Turbocharged Mazda6 Signature, 4D Sedan, 2.5L 4-Cylinder Turbocharged, Automatic, FWD, Jet Black, Deep Chestnut Leather, 11 Speakers, 3-Level Heated Reclining Front Sport Bucket Seats, 4-Wheel Disc Brakes, ABS brakes, Air Conditioning, Alloy wheels, AM/FM radio: SiriusXM, Anti-whiplash front head restraints, Auto High-beam Headlights, Auto-dimming door mirrors, Auto-dimming Rear-View mirror, Automatic temperature control, Blind spot sensor: Blind Spot Monitoring System (BSM) warning, Brake assist, Delay-off headlights, Distance pacing cruise control: Mazda Radar Cruise Control (MRCC), Dual front impact airbags, Dual front side impact airbags, Electronic Stability Control, Emergency communication system: MAZDA CONNECT, Four wheel independent suspension, Front anti-roll bar, Front dual zone A/C, Front fog lights, Front reading lights, Fully automatic headlights, Heads-Up Display, Heated door mirrors, Illuminated entry, Leather Shift Knob, Low tire pressure warning, MAZDA CONNECT Infotainment System Voice Command, Memory seat, Nappa Leather Seat Trim, Navigation system: MAZDA CONNECT, Panic alarm, Power door mirrors, Power driver seat, Power moonroof, Power steering, Power windows, Radio data system, Radio: AM/FM/HD, Rain sensing wipers, Rear window defroster, Remote keyless entry, Speed-sensing steering, Steering wheel mounted audio controls, Traction control, Trip computer, Variably intermittent wipers, Ventilated Front Seats.23/31 City/Highway MPG'),
(151, 1, 101, 1600000, 'One of the fastest and adrenaline rush full size', '2020-03-14 8:13:00',
'Our 2008 BMW 550i M5 Sedan in Black is a perfect balance between luxury and performance in a stylish package. Powered by a 5.0 Liter V10 that offers world-class performance while connected to a purpose-built quick-shifting Automatic transmission. This Rear Wheel Drive beats most sports cars in performance, all the while delivering the total luxury driving experience you expect from BMW plus offers near 17mpg on the highway. Enjoy confident handling thanks to the M sport suspension, M wheels, and aggressive body lines.The interior of this M5 is a study in efficient ergonomics with a layout that is luxurious and comfortable but also perfectly suited for sport-minded driving. Settle into the 20-way multi-contour heated leather front seats. You''ll appreciate the advanced climate control system, premium audio, full-color navigation, a sunroof, and other top-shelf amenities.It also features BMW''s arsenal of cutting edge safety technologies including traction control, stability control, brake assist, and advanced airbags. Of course, it goes without saying this machine is an absolute joy to drive! Discover the BMW driving experience for yourself. Print this page and call us Now... We Know You Will Enjoy Your Test Drive Towards Ownership! All vehicles go through a mechanical inspection, history check, and a detailing process. We offer high-quality pre-owned automobiles at the most competitive pricing. Come visit our pre-owned line of automobiles in Elmhurst today or call us (630) 279-7000 ...Welcome and thank you for viewing our post we have a wonderful selection of affordable and reliable import vehicles, visit our new redesigned website at www.OkazMotors.com to view more picters and take advantage of our low internet prices, stop by our dealership and test drive the car of your choice. CALL us today at 630-279-7000 for more info.'),
(152, 1, 102, 550000, 'A toaster I love to drive', '2020-03-10 14:12:00', null),
(153, 2, 103, 1000000, 'Zippy fun car to drive', '2020-03-06 18:22:00',
'CARFAX One-Owner. Clean CARFAX. Gray 2018 Mazda Mazda3 Touring FWD 6-Speed SKYACTIV? 2.5L 4-Cylinder DOHC 16V Awards: * 2018 KBB.com Brand Image Awards We Are Your Chicago, IL New and Certified Pre-owned Nissan Dealership near Berwyn, Burbank, Calumet City, Cicero, Elmhurst, Evanston, Franklin Park, La Grange, Matteson, Melrose Park, Morton Grove, Northbrook, Oak Lawn, Oak Park, Orland Park, Tinley Park. Are you wondering, where is Western Ave Nissan or what is the closest Nissan dealer near me? Western Ave Nissan is located at 7410 South Western Ave, Chicago, IL 60636. You can call our Sales Department at , Service Department at , or our Parts Department at . Although Western Ave Nissan in Chicago, Illinois is not open 24 hours a day, seven days a week - our website is always open. On our website, you can research and view photos of the new Nissan models such as the 370Z, Altima, Armada, Frontier, GT-R, LEAF, Maxima, Murano, NV Cargo, NV Passenger, NV200, Pathfinder, Rogue, Rogue Sport, Sentra, Titan, Titan XD, Versa or Versa Note that you would like to purchase or lease. You can also search our entire inventory of new and used vehicles, value your trade-in, and visit our Meet the Staff page to familiarize yourself with our staff who are committed to making your visit to Western Ave Nissan a great experience every time. Test drive today! As a premier Nissan dealer, we have a huge selection of new and used cars, trucks and SUVs, including late model and high-quality pre-owned vehicles. Buy this vehicle with confidence knowing we pulled the CARFAX and the history is clean and problem free. Apply for Financing through our website! Let our experienced team of professionals put you in the car of your dreams!'),
(154, 2, 104, 975000, 'My car is a great vehicle', '2020-03-15 19:08:00',
'CarFax Certified! SEL Model! ALL-WHEEL DRIVE! Low Miles! Fully loaded inside with black leather and heated seats, premium touchscreen radio, Bluetooth, sunroof, keyless entry, power locks, power windows, USB/AUX inputs, CD player, premium alloy wheels, and many other options! Powered by a 6-Cylinder Motor, Automatic Transmission, and All-Wheel Drive! Nice condition inside and out, and drives great! CarFax and Clean Title! MIDWESTS VOLUME PREOWNED VW DEALER! Finance Available for Qualifying Customers! Extended Warranties Available for Most Vehicles! Visit Chicago Fine Motors online at ChicagoFineMotors.com to see more pictures of this vehicle or call us at 708-442-5800 today to schedule your test drive.');
|
{{
config(
materialized='table'
)
}}
SELECT
o.order_id,
evnt.page_url as order_placed_at,
o.order_total,
o.status as order_status,
o.promo_id as promo_code_id,
pc.discount AS promo_code_discount,
o.user_id,
u.first_name AS user_first_name,
o.tracking_id as shipment_id,
s.status AS shipment_status,
oa.order_id IS NOT NULL AS has_adjustment
FROM {{ ref('stg_orders') }} o
LEFT JOIN {{ ref('stg_promo') }} pc
ON o.promo_id = pc.promo_id
LEFT JOIN {{ ref('stg_users') }} u
ON o.user_id = u.user_id
LEFT JOIN {{ ref('stg_shipments') }} s
ON o.tracking_id = s.shipment_id
LEFT JOIN {{ ref('stg_order_adjustments') }} oa
ON o.order_id = oa.order_id
LEFT JOIN{{ ref('stg_events')}} evnt
on o.user_id=evnt.user_id
|
DROP TABLE IF EXISTS eTransactionData;
DROP TABLE IF EXISTS eTransaction;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.