sql
stringlengths 6
1.05M
|
|---|
<reponame>mi4-corporation/Enverus-Drillinginfo-Direct-Access
Use DrillingInfo
if not exists (select *
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = N'dbo' and TABLE_NAME = N'OrderLocations')
begin
create table OrderLocations(Mi4OrderLocationID int primary key identity,
AppOrderLocationId int null,
AppOrderId int null,
CountyName varchar(1000) null,
CreatedDate datetime null,
DeletedDate datetime null,
MeridianCode varchar(max) null,
[Range] varchar(max) null,
Section varchar(max) null,
SectionCalls varchar(max) null,
StateCode varchar(1000) null,
Township varchar(max) null,
UpdatedDate datetime null,
Mi4AddDtTm datetime NULL default GETDATE(),
Mi4LastUpdateDtTm datetime null)
end
begin
IF NOT EXISTS (SELECT * FROM DrillingInfo.sys.indexes WHERE object_id = OBJECT_ID(N'DrillingInfo.[dbo].OrderLocations') AND name = N'IX_OrderLocations_UpdatedDate') CREATE NONCLUSTERED INDEX IX_OrderLocations_UpdatedDate ON DrillingInfo.dbo.OrderLocations (UpdatedDate)
IF NOT EXISTS (SELECT * FROM DrillingInfo.sys.indexes WHERE object_id = OBJECT_ID(N'DrillingInfo.[dbo].OrderLocations') AND name = N'IX_OrderLocations_StateCode') CREATE NONCLUSTERED INDEX IX_OrderLocations_StateCode ON DrillingInfo.dbo.OrderLocations (StateCode)
IF NOT EXISTS (SELECT * FROM DrillingInfo.sys.indexes WHERE object_id = OBJECT_ID(N'DrillingInfo.[dbo].OrderLocations') AND name = N'IX_OrderLocations_CountyName') CREATE NONCLUSTERED INDEX IX_OrderLocations_CountyName ON DrillingInfo.dbo.OrderLocations (CountyName)
IF NOT EXISTS (SELECT * FROM DrillingInfo.sys.indexes WHERE object_id = OBJECT_ID(N'DrillingInfo.[dbo].OrderLocations') AND name = N'IX_OrderLocations_DeletedDate') CREATE NONCLUSTERED INDEX IX_OrderLocations_DeletedDate ON DrillingInfo.dbo.OrderLocations (DeletedDate)
end
|
<reponame>maiha/facebook.cr
CREATE TABLE page_broadcast (
id String,
scheduled_time Nullable(String),
status Nullable(String)
)
ENGINE = Log
|
<filename>src/test/resources/sql/grant/1abbf99c.sql
-- file:privileges.sql ln:438 expect:true
GRANT USAGE ON LANGUAGE sql TO regress_user1
|
<filename>schemas/payroll/mssql/up-99-job-2019-12-04-00-00-00-daily-time-entry-except-customer-service.sql
use payroll
execute p_add_time_entry @employee_id=28, @entry_date='2019-12-04 00:00:00', @hours_worked=6
execute p_add_time_entry @employee_id=47, @entry_date='2019-12-04 00:00:00', @hours_worked=6
execute p_add_time_entry @employee_id=21, @entry_date='2019-12-04 00:00:00', @hours_worked=6
execute p_add_time_entry @employee_id=65, @entry_date='2019-12-04 00:00:00', @hours_worked=4
execute p_add_time_entry @employee_id=20, @entry_date='2019-12-04 00:00:00', @hours_worked=4
execute p_add_time_entry @employee_id=50, @entry_date='2019-12-04 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=16, @entry_date='2019-12-04 00:00:00', @hours_worked=6
execute p_add_time_entry @employee_id=64, @entry_date='2019-12-04 00:00:00', @hours_worked=7
execute p_add_time_entry @employee_id=43, @entry_date='2019-12-04 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=62, @entry_date='2019-12-04 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=59, @entry_date='2019-12-04 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=61, @entry_date='2019-12-04 00:00:00', @hours_worked=6
execute p_add_time_entry @employee_id=39, @entry_date='2019-12-04 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=53, @entry_date='2019-12-04 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=37, @entry_date='2019-12-04 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=51, @entry_date='2019-12-04 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=17, @entry_date='2019-12-04 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=12, @entry_date='2019-12-04 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=48, @entry_date='2019-12-04 00:00:00', @hours_worked=2
execute p_add_time_entry @employee_id=23, @entry_date='2019-12-04 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=40, @entry_date='2019-12-04 00:00:00', @hours_worked=5
|
<gh_stars>1-10
CREATE TABLE "public"."comment" (
"id" int4 NOT NULL,
"table" varchar(50) COLLATE "default",
"item_id" int4,
"user" int4,
"datestamp" timestamp(0),
"comment" text COLLATE "default",
CONSTRAINT "comment_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."continents" (
"id" int4 NOT NULL,
"name" varchar(100) COLLATE "default",
CONSTRAINT "continents_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."countries" (
"id" int4 NOT NULL,
"osm_id" varchar(20) COLLATE "default",
"name" varchar(200) COLLATE "default",
"name_en" varchar(200) COLLATE "default",
"int_name" varchar(200) COLLATE "default",
"continent" int4,
"iso3166" varchar(5) COLLATE "default",
"lat" varchar(20) COLLATE "default",
"lon" varchar(20) COLLATE "default",
CONSTRAINT "countries_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."export" (
"k" varchar(255) COLLATE "default",
"v" varchar(255) COLLATE "default"
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."import_test" (
"id" int4,
"lat" varchar(20) COLLATE "default",
"lon" varchar(20) COLLATE "default",
"name" varchar(200) COLLATE "default",
"place" varchar(50) COLLATE "default",
"wikipedia" varchar(200) COLLATE "default",
"population" int4,
"is_in" varchar(100) COLLATE "default"
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."item" (
"id" int4 NOT NULL,
"box" int4 NOT NULL,
"type" varchar(60) COLLATE "default",
"name" varchar(100) COLLATE "default",
"category" varchar(100) COLLATE "default",
"filter" varchar(100) COLLATE "default",
"longitude" varchar(20) COLLATE "default",
"latitude" varchar(20) COLLATE "default",
"zoom" int4 NOT NULL,
"osm_type" varchar(10) COLLATE "default",
"osm_id" varchar(20) COLLATE "default",
CONSTRAINT "item_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
COMMENT ON COLUMN "public"."item"."type" IS 'town, village';
COMMENT ON COLUMN "public"."item"."osm_type" IS 'node, way';
CREATE TABLE "public"."log_actions" (
"id" int4 NOT NULL,
"osm_user" varchar(255) COLLATE "default" NOT NULL,
"the_datetime" timestamp(0) NOT NULL,
"item_table" varchar(50) COLLATE "default" NOT NULL,
"item_id" int4 NOT NULL,
"item_field" varchar(50) COLLATE "default" NOT NULL,
"item_value" varchar(50) COLLATE "default",
"item_query" text COLLATE "default" NOT NULL,
CONSTRAINT "log_actions_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."log_users" (
"aid" int4 NOT NULL,
"osm_user" varchar(255) COLLATE "default",
"osm_id" int4,
"remote_ip" varchar(50) COLLATE "default",
"the_datetime" timestamp(0),
CONSTRAINT "log_users_pkey" PRIMARY KEY ("aid")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."marker_colors" (
"country" varchar(50) COLLATE "default" NOT NULL,
"district" varchar(50) COLLATE "default" NOT NULL,
"marker" varchar(20) COLLATE "default" NOT NULL,
CONSTRAINT "marker_colors_pkey" PRIMARY KEY ("country", "district")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."nodes" (
"id" varchar(255) COLLATE "default",
"version" varchar(255) COLLATE "default",
"timestamp" varchar(255) COLLATE "default",
"uid" varchar(255) COLLATE "default",
"user" varchar(255) COLLATE "default",
"changeset" varchar(255) COLLATE "default",
"lat" varchar(255) COLLATE "default",
"lon" varchar(255) COLLATE "default",
"tag" varchar(255) COLLATE "default"
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."nodes2" (
"id" varchar(255) COLLATE "default",
"version" varchar(255) COLLATE "default",
"timestamp" varchar(255) COLLATE "default",
"uid" varchar(255) COLLATE "default",
"user" varchar(255) COLLATE "default",
"changeset" varchar(255) COLLATE "default",
"lat" varchar(255) COLLATE "default",
"lon" varchar(255) COLLATE "default",
"tag" varchar(255) COLLATE "default"
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."nominatim_rules" (
"id" int4 NOT NULL,
"id_country" int4 NOT NULL,
"rule_type" varchar(20) COLLATE "default",
"xmlfield" varchar(100) COLLATE "default",
"datafield" varchar(100) COLLATE "default",
"priority" int4 NOT NULL,
"old_value" varchar(100) COLLATE "default",
"new_value" varchar(100) COLLATE "default",
CONSTRAINT "nominatim_rules_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."nominatim_xml" (
"id_settlement" int4 NOT NULL,
"created" timestamp(0),
"nominatim" text COLLATE "default",
CONSTRAINT "nominatim_xml_pkey" PRIMARY KEY ("id_settlement")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."places" (
"lat" varchar(255) COLLATE "default",
"lon" varchar(255) COLLATE "default",
"name" varchar(255) COLLATE "default",
"place" varchar(255) COLLATE "default",
"district" varchar(255) COLLATE "default"
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."poi" (
"id" text COLLATE "default" NOT NULL,
"country" varchar(50) COLLATE "default",
"latitude" text COLLATE "default",
"longitude" text COLLATE "default",
"osm_key" text COLLATE "default",
"osm_value" text COLLATE "default",
"name" text COLLATE "default",
CONSTRAINT "poi_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."postnumer" (
"postnumer" varchar(4) COLLATE "default",
"stadur" varchar(255) COLLATE "default",
"tegund" varchar(255) COLLATE "default",
"svaedi" varchar(255) COLLATE "default",
"heimilisfang" varchar(255) COLLATE "default"
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."settlement_areas" (
"id" int4 NOT NULL,
"id_settlement" int4 NOT NULL,
"area_name" varchar(100) COLLATE "default",
"network" int4,
"streets" int4,
"buildings" int4,
"imagery" int4,
"addresses" int4,
"amenities" int4,
"paths" int4,
"mapillary" int4,
CONSTRAINT "settlement_areas_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."settlements" (
"id" int4 NOT NULL,
"id_country" int4 NOT NULL,
"osm_id" varchar(20) COLLATE "default",
"name" varchar(200) COLLATE "default",
"name_en" varchar(200) COLLATE "default",
"lat" varchar(20) COLLATE "default",
"lon" varchar(20) COLLATE "default",
"region" varchar(200) COLLATE "default",
"subregion" varchar(200) COLLATE "default",
"place" varchar(30) COLLATE "default",
"capital" varchar(20) COLLATE "default",
"wikidata" varchar(20) COLLATE "default",
"wikipedia" varchar(200) COLLATE "default",
CONSTRAINT "settlements_pkey" PRIMARY KEY ("id", "id_country")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."settlements2" (
"id" int4 NOT NULL,
"local_id" varchar(20) COLLATE "default" NOT NULL,
"country" varchar(50) COLLATE "default",
"name" varchar(255) COLLATE "default",
"population" numeric(10),
"subdistrict" varchar(255) COLLATE "default",
"district" varchar(255) COLLATE "default",
"osm_link" varchar(255) COLLATE "default",
"latitude" float8,
"longitude" float8,
"place" varchar(10) COLLATE "default",
CONSTRAINT "settlements2_pkey" PRIMARY KEY ("id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."user_preferences" (
"osm_id" int4 NOT NULL,
"use_josm" int4 NOT NULL,
CONSTRAINT "user_preferences_pkey" PRIMARY KEY ("osm_id")
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."way_checks" (
"way" varchar(255) COLLATE "default",
"lat" varchar(255) COLLATE "default",
"lon" varchar(255) COLLATE "default",
"status" int4 NOT NULL
)
WITH (OIDS=FALSE);
COMMENT ON COLUMN "public"."way_checks"."status" IS '2=unknown, 1=fine, 0=deleted';
CREATE TABLE "public"."way_node" (
"way" int4 NOT NULL,
"node" int4 NOT NULL
)
WITH (OIDS=FALSE);
CREATE TABLE "public"."ways" (
"id" varchar(255) COLLATE "default",
"version" varchar(255) COLLATE "default",
"timestamp" varchar(255) COLLATE "default",
"uid" varchar(255) COLLATE "default",
"user" varchar(255) COLLATE "default",
"changeset" varchar(255) COLLATE "default",
"nd" varchar(255) COLLATE "default",
"tag" varchar(255) COLLATE "default"
)
WITH (OIDS=FALSE);
CREATE INDEX "idxids" ON "public"."nodes2" USING btree ("id", "lat", "lon");
|
DROP TABLE offer IF EXISTS;
DROP TABLE currency IF EXISTS;
CREATE TABLE currency (
currency_code CHAR(3) PRIMARY KEY
);
CREATE TABLE offer (
offer_id VARCHAR(255) PRIMARY KEY,
merchant_id VARCHAR(255) NOT NULL,
description VARCHAR(255) NOT NULL,
offering_id VARCHAR(255) NOT NULL, -- product or service id
price DECIMAL NOT NULL,
currency_code CHAR(3) NOT NULL,
active_start_date DATETIME NOT NULL,
active_end_date DATETIME NOT NULL,
status_code CHAR(1) DEFAULT 'A' NOT NULL,
FOREIGN KEY (currency_code) REFERENCES currency (currency_code)
);
|
FIND_PROJECT =
SELECT
*
FROM
PROJECT
WHERE
$if(clientId) {CLIENT_ID = :clientId}
AND $if(projectName) {PROJECT_NAME LIKE :%projectName%}
|
CREATE TABLE company (
companyid character varying(255) NOT NULL,
phonenumber character varying(255) NOT NULL,
invoicingemailaddress character varying(255) NOT NULL,
created timestamp without time zone NOT NULL,
salesemailaddress character varying(255) NOT NULL,
companyname character varying(255) NOT NULL,
supportemailaddress character varying(255) NOT NULL,
companycode character varying(255) NOT NULL,
modified timestamp without time zone NOT NULL,
deliveryaddress_postaladdressid character varying(255),
invoicingaddress_postaladdressid character varying(255),
iban character varying(255) NOT NULL,
bic character varying(255) NOT NULL,
host character varying(255),
termsandconditions character varying(4096)
);
ALTER TABLE public.company OWNER TO hoot;
CREATE TABLE customer (
customerid character varying(255) NOT NULL,
lastname character varying(255) NOT NULL,
phonenumber character varying(255) NOT NULL,
created timestamp without time zone NOT NULL,
company boolean NOT NULL,
emailaddress character varying(255) NOT NULL,
firstname character varying(255) NOT NULL,
companyname character varying(255),
modified timestamp without time zone NOT NULL,
companycode character varying(255),
deliveryaddress_postaladdressid character varying(255),
invoicingaddress_postaladdressid character varying(255),
owner_companyid character varying(255) NOT NULL
);
ALTER TABLE public.customer OWNER TO hoot;
CREATE TABLE group_ (
groupid character varying(255) NOT NULL,
created timestamp without time zone NOT NULL,
description character varying(255) NOT NULL,
name character varying(255) NOT NULL,
modified timestamp without time zone NOT NULL,
owner_companyid character varying(255) NOT NULL
);
ALTER TABLE public.group_ OWNER TO hoot;
CREATE TABLE groupmember (
groupmemberid character varying(255) NOT NULL,
created timestamp without time zone NOT NULL,
group_groupid character varying(255),
user_userid character varying(255)
);
ALTER TABLE public.groupmember OWNER TO hoot;
CREATE TABLE postaladdress (
postaladdressid character varying(255) NOT NULL,
addresslinetwo character varying(255),
addresslinethree character varying(255),
postalcode character varying(255),
addresslineone character varying(255),
city character varying(255),
country character varying(255)
);
ALTER TABLE public.postaladdress OWNER TO hoot;
CREATE TABLE privilege (
privilegeid character varying(255) NOT NULL,
created timestamp without time zone NOT NULL,
dataid character varying(255),
key character varying(255) NOT NULL,
user_userid character varying(255),
group_groupid character varying(255)
);
ALTER TABLE public.privilege OWNER TO hoot;
CREATE TABLE user_ (
userid character varying(255) NOT NULL,
lastname character varying(255) NOT NULL,
phonenumber character varying(255) NOT NULL,
created timestamp without time zone NOT NULL,
emailaddress character varying(255) NOT NULL,
firstname character varying(255) NOT NULL,
modified timestamp without time zone NOT NULL,
owner_companyid character varying(255) NOT NULL,
passwordhash character varying(256) NOT NULL
);
ALTER TABLE public.user_ OWNER TO hoot;
INSERT INTO company VALUES ('3248528E-4D90-41F7-968F-AF255AD16901', '+358 40 1639099', '<EMAIL>', '2011-04-22 08:52:13.899', '<EMAIL>', 'Test Company', '<EMAIL>', '0000000-0', '2011-04-22 08:52:13.899', '4EA7E643-3C80-49B2-8D1C-AAFA7E66A28C', 'CFE997C0-3FAF-4F6C-BBED-DB09689936B6', '-', '-', '*', '-');
INSERT INTO group_ VALUES ('3DE5D850-B015-44C1-904C-86DC2B0276A4', '2012-02-13 21:37:24.804', 'Users', 'user', '2012-02-13 21:37:24.804', '3248528E-4D90-41F7-968F-AF255AD16901');
INSERT INTO group_ VALUES ('1DE5D850-B015-44C1-904C-86DC2B0276A3', '2012-06-25 19:57:00', 'Administrators', 'administrator', '2012-06-25 19:57:00', '3248528E-4D90-41F7-968F-AF255AD16901');
INSERT INTO groupmember VALUES ('50413BBB-DB86-402E-9E98-C7E73F219827', '2013-03-29 19:11:42.986', '1DE5D850-B015-44C1-904C-86DC2B0276A3', 'A591FCB8-772E-4157-B64B-4371A6C7CAE0');
INSERT INTO postaladdress VALUES ('CFE997C0-3FAF-4F6C-BBED-DB09689936B6', '-', '-', '00000', '-', 'Helsinki', 'Finland');
INSERT INTO postaladdress VALUES ('4EA7E643-3C80-49B2-8D1C-AAFA7E66A28C', '-', '-', '00000', '-', 'Helsinki', 'Finland');
INSERT INTO user_ VALUES ('A591FCB8-772E-4157-B64B-4371A6C7CAE0', 'Test', '+123', '2013-03-29 18:21:23.769', '<EMAIL>', 'User', '2013-03-29 18:21:23.769', '3248528E-4D90-41F7-968F-AF255AD16901', 'c8213c753f70e6ef82a3bbece671c183cc9aa70d944f2d8abbbc50ab7432f2b4');
ALTER TABLE ONLY company
ADD CONSTRAINT company_pkey PRIMARY KEY (companyid);
ALTER TABLE ONLY customer
ADD CONSTRAINT customer_pkey PRIMARY KEY (customerid);
ALTER TABLE ONLY group_
ADD CONSTRAINT group__pkey PRIMARY KEY (groupid);
ALTER TABLE ONLY groupmember
ADD CONSTRAINT groupmember_pkey PRIMARY KEY (groupmemberid);
ALTER TABLE ONLY postaladdress
ADD CONSTRAINT postaladdress_pkey PRIMARY KEY (postaladdressid);
ALTER TABLE ONLY privilege
ADD CONSTRAINT privilege_pkey PRIMARY KEY (privilegeid);
ALTER TABLE ONLY group_
ADD CONSTRAINT unq_group__0 UNIQUE (owner_companyid, name);
ALTER TABLE ONLY groupmember
ADD CONSTRAINT unq_groupmember_0 UNIQUE (user_userid, group_groupid);
ALTER TABLE ONLY privilege
ADD CONSTRAINT unq_privilege_0 UNIQUE (user_userid, group_groupid);
ALTER TABLE ONLY user_
ADD CONSTRAINT unq_user__0 UNIQUE (owner_companyid, emailaddress);
ALTER TABLE ONLY user_
ADD CONSTRAINT user__pkey PRIMARY KEY (userid);
ALTER TABLE ONLY company
ADD CONSTRAINT fk_company_deliveryaddress_postaladdressid FOREIGN KEY (deliveryaddress_postaladdressid) REFERENCES postaladdress(postaladdressid);
ALTER TABLE ONLY company
ADD CONSTRAINT fk_company_invoicingaddress_postaladdressid FOREIGN KEY (invoicingaddress_postaladdressid) REFERENCES postaladdress(postaladdressid);
ALTER TABLE ONLY customer
ADD CONSTRAINT fk_customer_billingaddress_postaladdressid FOREIGN KEY (invoicingaddress_postaladdressid) REFERENCES postaladdress(postaladdressid);
ALTER TABLE ONLY customer
ADD CONSTRAINT fk_customer_deliveryaddress_postaladdressid FOREIGN KEY (deliveryaddress_postaladdressid) REFERENCES postaladdress(postaladdressid);
ALTER TABLE ONLY customer
ADD CONSTRAINT fk_customer_owner_companyid FOREIGN KEY (owner_companyid) REFERENCES company(companyid);
ALTER TABLE ONLY group_
ADD CONSTRAINT fk_group__owner_companyid FOREIGN KEY (owner_companyid) REFERENCES company(companyid);
ALTER TABLE ONLY groupmember
ADD CONSTRAINT fk_groupmember_group_groupid FOREIGN KEY (group_groupid) REFERENCES group_(groupid);
ALTER TABLE ONLY groupmember
ADD CONSTRAINT fk_groupmember_user_userid FOREIGN KEY (user_userid) REFERENCES user_(userid);
ALTER TABLE ONLY privilege
ADD CONSTRAINT fk_privilege_group_groupid FOREIGN KEY (group_groupid) REFERENCES group_(groupid);
ALTER TABLE ONLY privilege
ADD CONSTRAINT fk_privilege_user_userid FOREIGN KEY (user_userid) REFERENCES user_(userid);
ALTER TABLE ONLY user_
ADD CONSTRAINT fk_user__owner_companyid FOREIGN KEY (owner_companyid) REFERENCES company(companyid);
REVOKE ALL ON TABLE company FROM hoot;
GRANT ALL ON TABLE company TO hoot;
REVOKE ALL ON TABLE customer FROM hoot;
GRANT ALL ON TABLE customer TO hoot;
REVOKE ALL ON TABLE group_ FROM hoot;
GRANT ALL ON TABLE group_ TO hoot;
REVOKE ALL ON TABLE groupmember FROM hoot;
GRANT ALL ON TABLE groupmember TO hoot;
GRANT ALL ON TABLE groupmember TO hoot;
REVOKE ALL ON TABLE postaladdress FROM hoot;
GRANT ALL ON TABLE postaladdress TO hoot;
REVOKE ALL ON TABLE user_ FROM hoot;
GRANT ALL ON TABLE user_ TO hoot;
CREATE TABLE schemaversion
(
created timestamp without time zone NOT NULL,
schemaname character varying(255) NOT NULL,
schemaversion character varying(255) NOT NULL,
CONSTRAINT schemaversion_pkey PRIMARY KEY (created )
)
WITH (
OIDS=FALSE
);
ALTER TABLE schemaversion
OWNER TO hoot;
ALTER TABLE user_ ADD EMAILADDRESSVALIDATED BOOLEAN;
UPDATE user_ SET EMAILADDRESSVALIDATED = true;
ALTER TABLE user_ ALTER COLUMN emailaddressvalidated SET NOT NULL;
CREATE TABLE entry
(
entryid character varying(255) NOT NULL,
country character varying(2) NOT NULL,
created timestamp without time zone NOT NULL,
key character varying(1024) NOT NULL,
language character varying(2) NOT NULL,
modified timestamp without time zone NOT NULL,
value character varying(1024) NOT NULL,
owner_companyid character varying(255) NOT NULL,
basename character varying(1024) NOT NULL,
path character varying(2048) NOT NULL,
CONSTRAINT entry_pkey PRIMARY KEY (entryid ),
CONSTRAINT fk_entry_owner_companyid FOREIGN KEY (owner_companyid)
REFERENCES company (companyid) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
ALTER TABLE entry
OWNER TO hoot;
ALTER TABLE entry ADD COLUMN author character varying(1024);
ALTER TABLE company ADD COLUMN url character varying(255);
UPDATE COMPANY SET url = 'http://127.0.0.1:8083/groom';
INSERT INTO schemaversion VALUES (NOW(), 'hoot', '0001');
|
<gh_stars>1-10
create trigger [ServerTriggerWithUninitialisedVariable] on all server
for LOGON
as
begin
declare @a int -- @A is uninitialised. This should be flagged as a problem
print isnull(@A, -1)
end
|
-- 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.
select sum(cs_ext_discount_amt) as "excess discount amount"
from
catalog_sales
,item
,date_dim
where
i_manufact_id = 269
and i_item_sk = cs_item_sk
and d_date between '1998-03-18' and
(cast('1998-03-18' as date) + 90 days)
and d_date_sk = cs_sold_date_sk
and cs_ext_discount_amt
> (
select
1.3 * avg(cs_ext_discount_amt)
from
catalog_sales
,date_dim
where
cs_item_sk = i_item_sk
and d_date between '1998-03-18' and
(cast('1998-03-18' as date) + 90 days)
and d_date_sk = cs_sold_date_sk
)
limit 100
|
<filename>mill-db-repo/src/test/resources/db_init.sql
grant all privileges on mill.* to "user"@"localhost" identified by "pass";
flush privileges;
|
CREATE TABLE customer (
customer_id BIGINT IDENTITY NOT NULL PRIMARY KEY ,
first_name VARCHAR(45) NOT NULL ,
middle_name VARCHAR(45),
last_name VARCHAR(45) NOT NULL,
address1 VARCHAR(255) NOT NULL,
address2 VARCHAR(255),
city VARCHAR(50) NOT NULL,
state VARCHAR(20) NOT NULL,
postal_code CHAR(5) NOT NULL,
ssn VARCHAR(11) NOT NULL,
email_address VARCHAR(255),
home_phone VARCHAR(12),
cell_phone VARCHAR(12),
work_phone VARCHAR(12),
notification_pref CHAR(1) NOT NULL
) ;
CREATE TABLE account (
account_id BIGINT IDENTITY NOT NULL PRIMARY KEY ,
balance FLOAT NOT NULL ,
last_statement_date TIMESTAMP NOT NULL
) ;
CREATE TABLE transaction (
transaction_id BIGINT IDENTITY NOT NULL PRIMARY KEY ,
account_account_id BIGINT NOT NULL ,
description VARCHAR(255) NOT NULL,
credit FLOAT,
debit FLOAT,
timestamp TIMESTAMP
) ;
CREATE TABLE customer_account (
customer_customer_id BIGINT NOT NULL,
account_account_id BIGINT NOT NULL
) ;
|
<filename>database/migration/src/main/resources/changesets/failure_metadata_scripts/causedBy_lists.sql
UPDATE METADATA_ENTRY
SET METADATA_KEY = REPLACE(METADATA_KEY, "causedBy:", "causedBy[0]:")
WHERE METADATA_KEY LIKE "%failures%causedBy:%";
|
PQfname(res, 0) foo
PQfname(res, 1) BAR
PQfnumber(res, "FOO") 0
PQfnumber(res, "foo") 0
PQfnumber(res, "BAR") -1
PQfnumber(res, "\"BAR\"") 1
|
-- @testpoint:opengauss关键字template(非保留),作为视图名
--关键字explain作为视图名,不带引号,创建成功
CREATE or replace VIEW template AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view template;
--关键字explain作为视图名,加双引号,创建成功
CREATE or replace VIEW "template" AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop VIEW "template";
--关键字explain作为视图名,加单引号,合理报错
CREATE or replace VIEW 'template' AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
--关键字explain作为视图名,加反引号,合理报错
CREATE or replace VIEW `template` AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.16-MariaDB - mariadb.org binary distribution
-- 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 qubikal.qu_category
DROP TABLE IF EXISTS `qu_category`;
CREATE TABLE IF NOT EXISTS `qu_category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`image_path` varchar(255) DEFAULT NULL,
`photo_count` int(11) DEFAULT '0',
`created_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`qu_category_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_qu_category_qu_category` (`qu_category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
-- Dumping data for table qubikal.qu_category: ~8 rows (approximately)
/*!40000 ALTER TABLE `qu_category` DISABLE KEYS */;
REPLACE INTO `qu_category` (`id`, `name`, `image_path`, `photo_count`, `created_date`, `qu_category_id`) VALUES
(1, 'Flower', 'assets/images/page-1_img3.jpg', 3421, '2016-11-24 08:37:01', 0),
(2, 'House', 'assets/images/page-1_img3.jpg', 4213, '2016-11-24 08:37:02', 0),
(3, 'Roses', 'assets/images/page-1_img2.jpg', 11234, '2016-11-24 08:37:13', 0),
(4, '<NAME>', 'assets/images/page-1_img1.jpg', 2234, '2016-11-24 08:37:10', 3),
(5, '<NAME>', 'assets/images/page-1_img3.jpg', 4321, '2016-11-24 08:37:02', 3),
(6, 'Car', 'assets/images/page-1_img1.jpg', 4311, '2016-11-24 08:37:07', 0),
(7, 'Nature', 'assets/images/page-1_img2.jpg', 2321, '2016-11-24 08:37:16', 0),
(11, 'Computer', '', 0, NULL, 0);
/*!40000 ALTER TABLE `qu_category` 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 */;
|
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS task;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
email TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE task (
id INTEGER PRIMARY KEY AUTOINCREMENT,
author_id INTEGER NOT NULL,
finish INTEGER NOT NULL,
title TEXT NOT NULL,
body TEXT NOT NULL,
is_done INTEGER NOT NULL DEFAULT 0,
FOREIGN KEY (author_id) REFERENCES user (id)
);
|
USE burgers_db;
INSERT INTO burgers (burger_name)
VALUES ("Cheeseburger"), ("Bacon burger"), ("Burger burger");
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 20, 2020 at 03:14 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `ibaraki`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(2, 'alfa', '<EMAIL>', NULL, '$2y$10$lso7GRYc.8SkveHcG1IAeu0LKQCBr5mTIBaDLXgER/T2rzdE2KHYm', NULL, '2020-07-29 19:37:24', '2020-07-29 19:37:24'),
(3, 'ILYAS', '<EMAIL>', NULL, '$2y$10$29Po98qaniVqhaBZsV49Hek.EOJiN4tEk69AuqQEqIo9DLt9zSqTy', NULL, '2020-07-29 19:38:08', '2020-07-29 19:38:08');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<gh_stars>0
/*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
Use SQLCMD syntax to reference a variable in the post-deployment script.
Example: :setvar TableName MyTable
SELECT * FROM [$(TableName)]
--------------------------------------------------------------------------------------
*/
/* Customer */
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'65e51c54-21c5-41e8-8e22-21500379b275', N'Globex Corporation', N'Nothing says, “nonspecific international company serving the needs of consumers through service and synergy” like Globex.', CAST(N'2017-09-28 11:36:27.047' AS DateTime))
GO
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'450c0a80-cbe5-4dbb-bd57-2d069da88959', N'Vehement Capital Partners', N'Vehement says intense, passionate, insistent; it’s a word for describing an argument or an artistic platform.', CAST(N'2017-09-28 11:38:03.423' AS DateTime))
GO
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'5a8b5aad-303f-41ed-a3aa-6906c6d13767', N'Umbrella Corporation', N'In the Resident Evil Universe, there’s Umbrella Corporation.', CAST(N'2017-09-28 11:37:24.817' AS DateTime))
GO
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'17e223c8-f381-42b2-aea2-72823afa98d4', N'Initech', N'A veteran namer could break this down upon first sight: “ini” – innovation, “tech” – technology. And then suddenly, Initech reveals itself as a redundant and meaningless moniker, despite sounding almost as powerful as Intel and as fundamental as tech support.', CAST(N'2017-09-28 11:37:07.200' AS DateTime))
GO
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'c4fc61c3-3afb-4c64-994a-8a1601a6739f', N'Massive Dynamic', N'This is a name so good we wish we’d come up with it first.', CAST(N'2017-09-28 11:38:20.703' AS DateTime))
GO
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'fc5ab70f-2b78-4806-a78a-b2c2fe7bfc10', N'Acme Corporation', N'This diabolical Looney Tunes mega-corp responsible for falling anvils and other humorous disasters has created some of our best memories of cartoon mischief.', CAST(N'2017-09-28 11:36:01.400' AS DateTime))
GO
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'373df2c3-2328-4cf2-afef-dbfac08db885', N'Hooli', N'The HBO hit series Silicon Valley’s Hooli coyly smacks of the signature sound and feel we can’t quite put our fingers on: that goofy yet apt naming convention of mega-tech companies like Yahoo, Hulu, and Google.', CAST(N'2017-09-28 11:37:45.740' AS DateTime))
GO
INSERT [dbo].[Customers] ([Id], [Name], [Description], [CreatedDate]) VALUES (N'6549f610-8c36-43b7-b33a-f79a308cc902', N'Soylent Corp', N'Had Soylent Corp not inspired a real-life brand name of nutritional supplement and viral sensation, it wouldn’t have made this list.', CAST(N'2017-09-28 11:36:45.410' AS DateTime))
GO
/* SettingType */
INSERT [dbo].[SettingTypes] ([Id], [ParentId], [Description], [SequenceNumber], [Enabled], [CreatedDate]) VALUES (0, NULL, N'Root', 1, 1, CAST(N'2017-09-28 11:48:01.023' AS DateTime))
GO
INSERT [dbo].[SettingTypes] ([Id], [ParentId], [Description], [SequenceNumber], [Enabled], [CreatedDate]) VALUES (1, 0, N'Email Security', 2, 1, CAST(N'2017-09-28 11:48:01.023' AS DateTime))
GO
INSERT [dbo].[SettingTypes] ([Id], [ParentId], [Description], [SequenceNumber], [Enabled], [CreatedDate]) VALUES (2, 0, N'Web Security', 3, 1, CAST(N'2017-09-28 11:48:01.023' AS DateTime))
GO
INSERT [dbo].[SettingTypes] ([Id], [ParentId], [Description], [SequenceNumber], [Enabled], [CreatedDate]) VALUES (3, 0, N'Password Reset', 4, 1, CAST(N'2017-09-28 11:48:01.023' AS DateTime))
GO
INSERT [dbo].[SettingTypes] ([Id], [ParentId], [Description], [SequenceNumber], [Enabled], [CreatedDate]) VALUES (4, 0, N'Cloud Application Security', 5, 1, CAST(N'2017-09-28 11:48:01.023' AS DateTime))
GO
INSERT [dbo].[SettingTypes] ([Id], [ParentId], [Description], [SequenceNumber], [Enabled], [CreatedDate]) VALUES (5, 0, N'Unified Security Service', 6, 1, CAST(N'2017-09-28 11:48:01.023' AS DateTime))
GO
INSERT [dbo].[SettingTypes] ([Id], [ParentId], [Description], [SequenceNumber], [Enabled], [CreatedDate]) VALUES (6, 0, N'Multi-Factor Authentication', 7, 1, CAST(N'2017-09-28 11:48:01.023' AS DateTime))
GO
|
CREATE OR REPLACE FUNCTION mtp_upsert_cs8(i_json json)
RETURNS json AS
$BODY$
#init
cols = []
vals = []
v_sql = ""
result = null
#input
v_table = i_json.table
# column name of primark key
v_pkey = i_json.pkey
#modified on 2014-05-10 20:50:19
#set default column name of primary key
if not v_pkey
v_pkey = "id"
v_id = i_json.columns.id
languageid = i_json.context.languageid
v_user = i_json.context.user
v_rowversion = i_json.columns.rowversion
#if not v_rowversion
# v_rowversion = 1
if not languageid
#throw("please provide languageid")
return {"error":"please provide languageid"}
for key in Object.keys(i_json.columns)
if key == v_pkey
if i_json.columns[v_pkey] != null and i_json.columns[v_pkey] != ''
#update = true
v_id = i_json.columns[v_pkey]
else
continue
if key == 'texths'
val = i_json.columns[key]
if val != null
#if no value for hstore then bypass
cols.push(key)
if typeof(val) == 'string'
val = val.replace("'","''") # escape single quote
v = "hstore('#{languageid}', '#{val}')"
vals.push(v)
else
cols.push(key)
val = i_json.columns[key]
if typeof(val) == 'string'
y = val.split('::')
if y.length == 2
v = "'#{y[0]}'::#{y[1]}"
vals.push(v)
else
val = val.replace("'","''") # escape single quote
v = "'#{val}'"
vals.push(v)
else
vals.push(val)
if v_rowversion
#build update sql
#c= cols.join(",")
#v = vals.join(",")
fields = []
for i in [0 ..cols.length-1]
col = cols[i]
val = vals[i]
if val == null
continue
if col in [v_pkey, "id","seq", "modifiedon","modifiedby","createdon","createdby","rowversion"]
continue
if col == "texths"
fields.push("#{col} = #{col}||#{val}")
#fields.push("#{col} = #{val}")
else
fields.push("#{col} = #{val}")
setfields = fields.join(", ")
v_sql = "update #{v_table} set #{setfields}, modifiedon = now(), modifiedby = '#{v_user}', rowversion = rowversion + 1
where #{v_pkey} = '#{v_id}' and rowversion = #{v_rowversion} returning #{v_pkey}, modifiedon, modifiedby, createdon, createdby, rowversion"
else
#build insert sql
t_cols = []
t_vals = []
for i in [0 .. cols.length-1 ]
col = cols[i]
val = vals[i]
if val == null
continue
if col in ["seq", "modifiedon", "modifiedby", "createdon", "createdby", "rowversion"]
#alert?
continue
else
t_cols.push(col)
t_vals.push(val)
v_cols= t_cols.join(", ")
v_vals = t_vals.join(", ")
v_sql = "insert into #{v_table} (#{v_cols}, modifiedon, modifiedby, createdon, createdby)
values(#{v_vals}, now(), '#{v_user}', now(), '#{v_user}') returning #{v_pkey}, modifiedon, modifiedby, createdon, createdby, rowversion"
try
result = plv8.execute( v_sql )
catch err
plv8.elog(DEBUG, v_sql)
msg = "#{err},#{v_sql}"
#return {"sql":v_sql,"error":msg}
throw(msg)
return {"returning":result, "sql":v_sql}
$BODY$
LANGUAGE plcoffee VOLATILE
|
#niv_lib (NIVEAU)
#Compter le nombre d'entrées pour chaque jour (ENTREE)
#ENTREE, NIVEAU : niv_id
#Resultat : total jour i >= total de chaque jour
#Une requete contenenat une sous requete avec utilisation de l'opérateur ALL
CREATE VIEW `E303` AS
SELECT DATE_FORMAT(
MAKEDATE(
YEAR(
NOW()
),
jour_in
),
'%d/%m'
)
AS date,
niv_lib AS 'niveau',
COUNT(*) AS 'affluence'
FROM NIVEAU, ENTREE
WHERE LOWER(niv_lib) = 'jaune'
#LOWER permet de mettre en minuscule
AND ENTREE.niv_id = NIVEAU.niv_id
GROUP BY NIVEAU.niv_id, jour_in
HAVING affluence >= ALL(
SELECT COUNT(*)
FROM ENTREE, NIVEAU
WHERE LOWER(niv_lib) = 'jaune'
AND ENTREE.niv_id = NIVEAU.niv_id
GROUP BY NIVEAU.niv_id, jour_in
)
|
<reponame>krlosexe/urbahub
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 09-05-2018 a las 17:21:24
-- Versión del servidor: 10.0.17-MariaDB
-- Versión de PHP: 5.5.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `admin_crmventas`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `productos`
--
CREATE TABLE `productos` (
`id_producto` int(11) NOT NULL,
`descripcion` varchar(200) COLLATE utf8_spanish_ci NOT NULL,
`cod_proyecto` int(11) NOT NULL,
`cod_proyecto_clasificacion` int(11) DEFAULT NULL,
`zona` varchar(200) COLLATE utf8_spanish_ci NOT NULL,
`lote_anterior` varchar(200) COLLATE utf8_spanish_ci NOT NULL,
`lote_nuevo` varchar(200) COLLATE utf8_spanish_ci NOT NULL,
`superficie` float(10,2) NOT NULL,
`precio_m2` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `productos`
--
ALTER TABLE `productos`
ADD PRIMARY KEY (`id_producto`),
ADD KEY `productos_proyectos_clasificacion_idx` (`cod_proyecto_clasificacion`),
ADD KEY `productos_proyectos_idx` (`cod_proyecto`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `productos`
--
ALTER TABLE `productos`
MODIFY `id_producto` int(11) NOT NULL AUTO_INCREMENT;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `productos`
--
ALTER TABLE `productos`
ADD CONSTRAINT `fk_productos_cod_proyecto` FOREIGN KEY (`cod_proyecto`) REFERENCES `proyectos` (`id_proyecto`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk_productos_cod_proyecto_clasificacion` FOREIGN KEY (`cod_proyecto_clasificacion`) REFERENCES `proyectos_clasificacion` (`id_proyecto_clasificacion`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
use DB214DWESProyectoTema5;
insert into T01_Usuario values
('admin', SHA2('adminpaso',256), 'Usuario administrador', null, 0, 'administrador', null),
('albertoF',SHA2('albertoFpaso',256),'AlbertoF', null, 0, 'usuario', null),
('outmane',SHA2('outmanepaso',256),'Outmane', null, 0, 'usuario', null),
('rodrigo',SHA2('rodrigopaso',256),'Rodrigo', null, 0, 'usuario', null),
('isabel',SHA2('isabelpaso',256),'Isabel', null, 0, 'usuario', null),
('david',SHA2('davidpaso',256),'David', null, 0, 'usuario', null),
('aroa',SHA2('aroapaso',256),'Aroa', null, 0, 'usuario', null),
('johanna',SHA2('johannapaso',256),'Johanna', null, 0, 'usuario', null),
('oscar',SHA2('oscarpaso',256),'Oscar', null, 0, 'usuario', null),
('sonia',SHA2('soniapaso',256),'Sonia', null, 0, 'usuario', null),
('heraclio',SHA2('heracliopaso',256),'Heraclio', null, 0, 'usuario', null),
('amor',SHA2('amorpaso',256),'Amor', null, 0, 'usuario', null),
('antonio',SHA2('antoniopaso',256),'Antonio', null, 0, 'usuario', null),
('albertoB',SHA2('albertoBpaso',256),'AlbertoB', null, 0, 'usuario', null);
insert into T02_Departamento values
("UNO", "Primer departamento", curdate(), 30.45, null),
("DOS", "Segundo departamento", curdate(), 66.66, null),
("TRE", "Tercer departamento", curdate(), 1.11, null);
|
<reponame>lgcarrier/AFW<filename>5.2.3/Database/Constraints/AFW_21_PLUGN_ITEM_MENU_CK1.sql<gh_stars>1-10
SET DEFINE OFF;
ALTER TABLE AFW_21_PLUGN_ITEM_MENU ADD (
CONSTRAINT AFW_21_PLUGN_ITEM_MENU_CK1
CHECK (
ref_dv_contn_item_menu is not null and niv_item = 1
or
ref_dv_contn_item_menu is null
)
ENABLE VALIDATE)
/
|
<reponame>dsalunga/mPortal
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WebUser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[WebUser](
[UserId] [int] NOT NULL,
[UserName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Password] [nvarchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[FirstName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MiddleName] [nvarchar](250) COLLATE Latin1_General_CI_AI NOT NULL,
[LastName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Email] [nvarchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LastUpdate] [datetime] NOT NULL,
[Active] [int] NOT NULL,
[ActivationKey] [nvarchar](250) COLLATE Latin1_General_CI_AI NOT NULL,
[DateCreated] [datetime] NOT NULL,
[NewEmail] [nvarchar](250) COLLATE Latin1_General_CI_AI NOT NULL,
[Email2] [nvarchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Gender] [nchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[NameSuffix] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MobileNumber] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TelephoneNumber] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LastLogin] [datetime] NOT NULL,
[StatusText] [nvarchar](1500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PasswordExpiryDate] [datetime] NOT NULL,
[PhotoPath] [nvarchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ProviderId] [int] NOT NULL,
[Status] [int] NOT NULL,
[MaritalStatusId] [int] NOT NULL,
[LastLoginFailureDate] [datetime] NOT NULL,
[LoginFailureCount] [int] NOT NULL,
CONSTRAINT [PK_WebUsers] PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_MiddleName]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_MiddleName] DEFAULT ('') FOR [MiddleName]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_LastUpdate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_LastUpdate] DEFAULT (getdate()) FOR [LastUpdate]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_Active]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_Active] DEFAULT ((0)) FOR [Active]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_RegCode]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_RegCode] DEFAULT ('') FOR [ActivationKey]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_DateCreated]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_DateCreated] DEFAULT (getdate()) FOR [DateCreated]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_NewEmail]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_NewEmail] DEFAULT ('') FOR [NewEmail]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_Email2]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_Email2] DEFAULT ('') FOR [Email2]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_Gender]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_Gender] DEFAULT ('U') FOR [Gender]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_NameSuffix]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_NameSuffix] DEFAULT ('') FOR [NameSuffix]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_MobileNumber]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_MobileNumber] DEFAULT ('') FOR [MobileNumber]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_TelephoneNumber]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_TelephoneNumber] DEFAULT ('') FOR [TelephoneNumber]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_LastLoginDate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_LastLoginDate] DEFAULT (getdate()) FOR [LastLogin]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_StatusText]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_StatusText] DEFAULT ('') FOR [StatusText]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_PasswordExpiryDate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_PasswordExpiryDate] DEFAULT ('<PASSWORD>') FOR [PasswordExpiryDate]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_PhotoPath]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_PhotoPath] DEFAULT ('') FOR [PhotoPath]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_ProviderId]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_ProviderId] DEFAULT ((-1)) FOR [ProviderId]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_Status]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_Status] DEFAULT ((-1)) FOR [Status]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_MaritalStatus]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_MaritalStatus] DEFAULT ((-1)) FOR [MaritalStatusId]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_WebUser_LastLoginFailureDate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF_WebUser_LastLoginFailureDate] DEFAULT ('1800-01-01') FOR [LastLoginFailureDate]
END
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__WebUser__LoginFailureCount]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[WebUser] ADD CONSTRAINT [DF__WebUser__LoginFailureCount] DEFAULT ((0)) FOR [LoginFailureCount]
END
GO
|
-- --------------------------------------------------------
-- Hôte : 127.0.0.1
-- Version du serveur: 5.7.19 - MySQL Community Server (GPL)
-- SE du serveur: Win64
-- 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' */;
-- Export de la structure de la table 2tasty. ref_ingredient_display_preference
DROP TABLE IF EXISTS `ref_ingredient_display_preference`;
CREATE TABLE IF NOT EXISTS `ref_ingredient_display_preference` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Export de données de la table 2tasty.ref_ingredient_display_preference : ~2 rows (environ)
DELETE FROM `ref_ingredient_display_preference`;
/*!40000 ALTER TABLE `ref_ingredient_display_preference` DISABLE KEYS */;
INSERT INTO `ref_ingredient_display_preference` (`id`, `name`) VALUES
(1, 'ingredient_preferences.Native'),
(2, 'ingredient_preferences.German'),
(3, 'ingredient_preferences.US');
/*!40000 ALTER TABLE `ref_ingredient_display_preference` ENABLE KEYS */;
-- Export de la structure de la table 2tasty. ref_unit
DROP TABLE IF EXISTS `ref_unit`;
CREATE TABLE IF NOT EXISTS `ref_unit` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`factor_to_liter` double DEFAULT NULL,
`factor_to_kg` double DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Export de données de la table 2tasty.ref_unit : ~11 rows (environ)
DELETE FROM `ref_unit`;
/*!40000 ALTER TABLE `ref_unit` DISABLE KEYS */;
INSERT INTO `ref_unit` (`id`, `name`, `factor_to_liter`, `factor_to_kg`) VALUES
(1, '', NULL, NULL),
(2, 'kg', NULL, 1),
(3, 'g', NULL, 0.001),
(4, 'ml', 0.001, NULL),
(5, 'l', 1, NULL),
(6, 'oz', NULL, 0.02834952),
(7, 'cup', 0.23658823, NULL),
(8, '1/2 cup', 0.11829411, NULL),
(9, '1/4 cup', 0.059147059, NULL),
(10, '1/8 cup', 0.02957352, NULL),
(11, 'teaspoon_us', 0.0049289, NULL);
/*!40000 ALTER TABLE `ref_unit` 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 */;
INSERT INTO `recipe_tag` (`id`, `name`) VALUES (1, 'ToCook');
|
CREATE TABLE IF NOT EXISTS reddit_comments(
sub text NOT NULL,
currency text NOT NULL,
post_id text NOT NULL,
contents text NOT NULL,
sentiment decimal,
subjectivity decimal
);
|
-- file:numeric_big.sql ln:270 expect:true
INSERT INTO num_exp_mul VALUES (5,8,'-5546455599206321494.0676583421119904300307105296377723816472192007866147764761501865875232824814135783697976183493106885436876081315217834621720906478074798596116645640251460842350553806256223963023430631066024389364515688765194373161385579258482225808660340732705687558150699172147896486727530192499184101617379930846663835628510376484675411350654979679181852179924386290069790336316958202582966248703889464308649631486542724072047294216362186036638115240070658004553260251510288423749333873893917690832829128021808383128393431810674177390352413548658782609064839524756041501835115152819802758773711821322162752064589750295542985780512921839490040396053737870038534216948323935020460307350020911362024271167085905714873548388570602799432705061561572854498075600')
|
-- file:rowsecurity.sql ln:260 expect:true
COPY t3(a,b,c) FROM stdin WITH (oids)
|
<filename>src/db/sqlite/sql/authentication-success.sql
--
UPDATE authentication
SET last_authentication = strftime('%s', 'now')
WHERE identifier = :identifier
|
<filename>server/migrations/committed/000020.sql
--! Previous: sha1:e708c9b98c37a8baa88bcd09f664cd3f8e665ead
--! Hash: sha1:ac9abc3c21e539fb3d48791be313bfb5ac49b0f6
-- Enter migration here
CREATE TABLE IF NOT EXISTS questionnaire_response(id uuid DEFAULT uuid_generate_v4() NOT NULL,
PRIMARY KEY (id));
SELECT create_primary_key_id_if_not_exists('questionnaire_response');
ALTER TABLE questionnaire_response ADD COLUMN IF NOT EXISTS person_id uuid NOT NULL;
-- The following Do/End block is a way to create a foreign key relationship if one does not exist.
DO $$
BEGIN IF NOT EXISTS
(SELECT 1
FROM pg_constraint
WHERE conname = 'questionnaire_response_person_id_fkey') THEN
ALTER TABLE questionnaire_response ADD CONSTRAINT questionnaire_response_person_id_fkey
FOREIGN KEY (person_id) REFERENCES person(id);
END IF;
END;
$$;
CREATE INDEX IF NOT EXISTS person_id_on_questionnaire_response ON questionnaire_response (person_id);
ALTER TABLE questionnaire_response ADD COLUMN IF NOT EXISTS questionnaire_id uuid NOT NULL;
-- The following Do/End block is a way to create a foreign key relationship if one does not exist.
DO $$
BEGIN IF NOT EXISTS
(SELECT 1
FROM pg_constraint
WHERE conname = 'questionnaire_response_questionnaire_id_fkey') THEN
ALTER TABLE questionnaire_response ADD CONSTRAINT questionnaire_response_questionnaire_id_fkey
FOREIGN KEY (questionnaire_id) REFERENCES questionnaire(id);
END IF;
END;
$$;
CREATE INDEX IF NOT EXISTS questionnaire_id_on_questionnaire_response ON questionnaire_response (questionnaire_id);
COMMENT ON COLUMN public.questionnaire_response.id IS '@omit create,insert,update\nThe unique ID of a questionnaire response';
ALTER TABLE questionnaire_response ADD COLUMN IF NOT EXISTS created_at timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL;
ALTER TABLE questionnaire_response ADD COLUMN IF NOT EXISTS updated_at timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL;
DROP TRIGGER IF EXISTS set_updated_at_on_questionnaire_response ON public.questionnaire_response;
-- This trigger updates the updated_at column when a questionnaire is saved.
CREATE TRIGGER set_updated_at_on_questionnaire_response
BEFORE
UPDATE ON questionnaire_response
FOR EACH ROW EXECUTE PROCEDURE set_updated_at();
ALTER TABLE questionnaire_response ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS portal_select_questionnaire_response ON questionnaire_response;
CREATE POLICY portal_select_questionnaire_response ON questionnaire_response FOR SELECT TO portal
USING (person_id = nullif(current_setting('person.id', true), '')::uuid);
DROP POLICY IF EXISTS lawyer_select_questionnaire_response ON questionnaire_response;
CREATE POLICY lawyer_select_questionnaire_response ON questionnaire_response FOR SELECT TO lawyer
USING (person_id = nullif(current_setting('person.id', true), '')::uuid);
DROP POLICY IF EXISTS admin_modify_questionnaire_response ON questionnaire_response;
CREATE POLICY admin_modify_questionnaire_response ON questionnaire_response TO admin USING (true) WITH CHECK (true);
GRANT INSERT (person_id, questionnaire_id) ON questionnaire_response TO portal;
GRANT INSERT (person_id, questionnaire_id) ON questionnaire_response TO lawyer;
GRANT SELECT ON questionnaire_response TO portal;
GRANT SELECT ON questionnaire_response TO lawyer;
GRANT ALL ON questionnaire_response TO admin;
|
INSERT INTO crp.sample(crp,cep) VALUES ('AC00-000','69900-000'), ('AC49-708','69949-708'), ('AC99-999','69999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('RR00-000','69300-000'), ('RR49-850','69349-850'), ('RR99-999','69399-999');
INSERT INTO crp.sample(crp,cep) VALUES ('AP00-000','68900-000'), ('AP49-602','68949-602'), ('AP99-999','68999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('AM000-000','69000-000'), ('AM150-117','69150-117'), ('AM299-999','69299-999');
INSERT INTO crp.sample(crp,cep) VALUES ('AM400-000','69400-000'), ('AM649-849','69649-849'), ('AM899-999','69899-999');
INSERT INTO crp.sample(crp,cep) VALUES ('MA000-000','65000-000'), ('MA499-775','65499-775'), ('MA999-999','65999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('PI000-000','64000-000'), ('PI499-734','64499-734'), ('PI999-999','64999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('CE0000-000','60000-000'), ('CE2000-187','62000-187'), ('CE3999-999','63999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('PA6000-000','66000-000'), ('PA7449-878','67449-878'), ('PA8899-999','68899-999');
INSERT INTO crp.sample(crp,cep) VALUES ('MS000-000','79000-000'), ('MS499-530','79499-530'), ('MS999-999','79999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('MT000-000','78000-000'), ('MT449-911','78449-911'), ('MT899-999','78899-999');
INSERT INTO crp.sample(crp,cep) VALUES ('TO000-000','77000-000'), ('TO499-816','77499-816'), ('TO999-999','77999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('RO800-000','76800-000'), ('RO899-855','76899-855'), ('RO999-999','76999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('DF3000-000','73000-000'), ('DF3349-689','73349-689'), ('DF3699-999','73699-999');
INSERT INTO crp.sample(crp,cep) VALUES ('GO2800-000','72800-000'), ('GO2899-622','72899-622'), ('GO2999-999','72999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('DF0000-000','70000-000'), ('DF1399-504','71399-504'), ('DF2799-999','72799-999');
INSERT INTO crp.sample(crp,cep) VALUES ('GO3700-000','73700-000'), ('GO5250-234','75250-234'), ('GO6799-999','76799-999');
INSERT INTO crp.sample(crp,cep) VALUES ('RN000-000','59000-000'), ('RN500-184','59500-184'), ('RN999-999','59999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('PB000-000','58000-000'), ('PB499-559','58499-559'), ('PB999-999','58999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('AL000-000','57000-000'), ('AL499-753','57499-753'), ('AL999-999','57999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('PE0000-000','50000-000'), ('PE3500-088','53500-088'), ('PE6999-999','56999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('SE000-000','49000-000'), ('SE500-171','49500-171'), ('SE999-999','49999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('BA0000-000','40000-000'), ('BA4499-908','44499-908'), ('BA8999-999','48999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('ES000-000','29000-000'), ('ES499-862','29499-862'), ('ES999-999','29999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('RJ0000-000','20000-000'), ('RJ4499-976','24499-976'), ('RJ8999-999','28999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('RS0000-000','90000-000'), ('RS5000-222','95000-222'), ('RS9999-999','99999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('PR0000-000','80000-000'), ('PR3999-636','83999-636'), ('PR7999-999','87999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('SC8000-000','88000-000'), ('SC9000-451','89000-451'), ('SC9999-999','89999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('MG0000-000','30000-000'), ('MG5000-425','35000-425'), ('MG9999-999','39999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('SP1000-000','11000-000'), ('SP5500-051','15500-051'), ('SP9999-999','19999-999');
INSERT INTO crp.sample(crp,cep) VALUES ('ZM1000-000','01000-000'), ('ZM5499-536','05499-536'), ('ZM9999-999','09999-999');
|
Insert into QUESTIONNAIRE_QUESTIONS (QUESTIONNAIRE_QUESTIONS_ID,QUESTIONNAIRE_REF_ID_FK,QUESTION_REF_ID_FK,QUESTION_NUMBER,PARENT_QUESTION_NUMBER,CONDITION_FLAG,CONDITION_TYPE,CONDITION_VALUE,RULE_ID,UPDATE_TIMESTAMP,UPDATE_USER,QUESTION_SEQ_NUMBER,VER_NBR,OBJ_ID)
select SEQ_QUESTIONNAIRE_REF_ID.NEXTVAL QUESTIONNAIRE_QUESTIONS_ID,
(select max(QUESTIONNAIRE_REF_ID) from QUESTIONNAIRE where QUESTIONNAIRE_ID=5 and SEQUENCE_NUMBER=1) QUESTIONNAIRE_REF_ID_FK,
(SELECT max(QUESTION_REF_ID) FROM QUESTION WHERE QUESTION_ID=129 AND SEQUENCE_NUMBER=1) QUESTION_REF_ID_FK,
279,0,'N','4',null,'KC144',SYSDATE, 'admin',18,1,SYS_GUID() from dual
/
Insert into QUESTIONNAIRE_QUESTIONS (QUESTIONNAIRE_QUESTIONS_ID,QUESTIONNAIRE_REF_ID_FK,QUESTION_REF_ID_FK,QUESTION_NUMBER,PARENT_QUESTION_NUMBER,CONDITION_FLAG,CONDITION_TYPE,CONDITION_VALUE,RULE_ID,UPDATE_TIMESTAMP,UPDATE_USER,QUESTION_SEQ_NUMBER,VER_NBR,OBJ_ID)
select SEQ_QUESTIONNAIRE_REF_ID.NEXTVAL QUESTIONNAIRE_QUESTIONS_ID,
(select max(QUESTIONNAIRE_REF_ID) from QUESTIONNAIRE where QUESTIONNAIRE_ID=5 and SEQUENCE_NUMBER=1) QUESTIONNAIRE_REF_ID_FK,
(SELECT max(QUESTION_REF_ID) FROM QUESTION WHERE QUESTION_ID=130 AND SEQUENCE_NUMBER=1) QUESTION_REF_ID_FK,
280,279,'Y','4','Y','KC149',SYSDATE, 'admin',1,1,SYS_GUID() from dual
/
Insert into QUESTIONNAIRE_QUESTIONS (QUESTIONNAIRE_QUESTIONS_ID,QUESTIONNAIRE_REF_ID_FK,QUESTION_REF_ID_FK,QUESTION_NUMBER,PARENT_QUESTION_NUMBER,CONDITION_FLAG,CONDITION_TYPE,CONDITION_VALUE,RULE_ID,UPDATE_TIMESTAMP,UPDATE_USER,QUESTION_SEQ_NUMBER,VER_NBR,OBJ_ID)
select SEQ_QUESTIONNAIRE_REF_ID.NEXTVAL QUESTIONNAIRE_QUESTIONS_ID,
(select max(QUESTIONNAIRE_REF_ID) from QUESTIONNAIRE where QUESTIONNAIRE_ID=5 and SEQUENCE_NUMBER=1) QUESTIONNAIRE_REF_ID_FK,
(SELECT max(QUESTION_REF_ID) FROM QUESTION WHERE QUESTION_ID=131 AND SEQUENCE_NUMBER=1) QUESTION_REF_ID_FK,
281,279,'Y','4','N','KC142',SYSDATE, 'admin',2,1,SYS_GUID() from dual
/
commit
/
|
DELIMITER /
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 101, 'Food/Water restriction', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 102, 'Exemption from Dog exercise program', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 103, 'Exemption from the environmental enhancement plan for nonhuman primates', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 104, 'Multiple Major Survival Surgery', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 105, 'Maintaining temperatures outside of the recommended ranges', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 106, 'Exemptions to routine cleaning/husbandry requirements', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 107, 'Exemptions to the diurnal lighting cycle requirements', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 108, 'Exemptions to the space requirements including innovative caging and metabolism cages', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 109, 'Prolonged Restraint', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 110, 'Use of nonpharmacuetical grade drugs', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 111, 'Death as an Endpoint', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 112, 'Monoclonal antibody production via acites', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 113, 'Use of Wire bottom cages for rodents', 'Y', NOW(), 'admin', UUID(), 1 )
/
INSERT INTO IACUC_EXCEPTION_CATEGORY ( EXCEPTION_CATEGORY_CODE, EXCEPTION_CATEGORY_DESC, ACTIVE_FLAG, UPDATE_TIMESTAMP, UPDATE_USER, OBJ_ID, VER_NBR )
VALUES ( 114, 'Singly housing social species', 'Y', NOW(), 'admin', UUID(), 1 )
/
DELIMITER ;
|
select o_orderpriority, count(*) as order_count
from orders
where o_orderdate >= '1993-07-01' and o_orderdate < '1993-10-01'
and exists (
select
*
from
lineitem
where
l_orderkey = o_orderkey
and l_commitdate < l_receiptdate
)
group by
o_orderpriority
order by
o_orderpriority;
SELECT last_statement_duration_us / 1000000.0 last_statement_duration_seconds
FROM current_session;
|
insert into config (app_id, config_id, config_data)
values ('data-sharing-manager','application',
'{ "appUrl" : "http://localhost:8080" }'
);
insert into config (app_id, config_id, config_data)
values ('data-sharing-manager','database',
'{
"url" : "jdbc:mysql://localhost:3306/data_sharing_manager",
"username" : "YOURUSRNAME",
"password" : "<PASSWORD>"
}'
);
insert into config (app_id, config_id, config_data)
values ('data-sharing-manager','GoogleMapsAPI',
'{
"url" : "https://maps.googleapis.com/maps/api/geocode/json?address=",
"apiKey" : "<KEY>"
}'
);
insert into config (app_id, config_id, config_data)
values ('data-sharing-manager','keycloak',
'{
"realm": "endeavour",
"realm-public-key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7GdjckqAZgjxp/o7717ei5RgkW3mtG3W+LfmlboBt20NQ/Jz6yb00Xoe9dBCLsqiiompePWuBNxGdwUNHzJcng7hpTvsi7Zp8PtTJDts/EinroKEv+Gac2VB1k8aLneDOtU6FYdi7uQ4vVU4xJ4D4s1ubG0VQXqUnSUvwwRN5UDdGYLrV2KueajgsNJ3mML4aJ2rLDyUF5uvKQV1UbZAwvCUo0tIeUYoN6PMkpaUrBagWeLhNhrNU9HsiDbMUjVttDRgMlgCtYvu4GapI+0cVecAUWfg0MdTCYuUJwUtTZoatf3d2bietsS+cYPFfs9eCIm1/7GLZWwv6qFDN1a4ewIDAQAB",
"auth-server-url": "https://devauth.endeavourhealth.net/auth",
"ssl-required": "external",
"resource": "eds-dsa-manager",
"public-client": true
}'
);
insert into config (app_id, config_id, config_data)
values ('data-sharing-manager','keycloak_proxy',
'{
"user" : "eds-ui",
"pass" : "<PASSWORD>",
"url" : "https://devauth.endeavourhealth.net/auth"
}'
);
|
<filename>sql/tables/Envelope.sql
create table Envelope (
Id int primary key identity(1,1),
BudgetId int not null foreign key references Budget(Id) on delete cascade,
Name varchar(256) not null,
Capacity float not null,
Balance float not null default(0.0),
[Guid] uniqueidentifier not null default(newid())
)
create unique nonclustered index ix_Envelope_Guid on Envelope([Guid])
|
-- Update the REG_PATH_ID column mapped with the REG_RESOURCE table --
UPDATE REG_RESOURCE_TAG SET REG_PATH_ID=(SELECT REG_PATH_ID FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_TAG.REG_VERSION);
UPDATE REG_RESOURCE_COMMENT SET REG_PATH_ID=(SELECT REG_PATH_ID FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_COMMENT.REG_VERSION);
UPDATE REG_RESOURCE_PROPERTY SET REG_PATH_ID=(SELECT REG_PATH_ID FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_PROPERTY.REG_VERSION);
UPDATE REG_RESOURCE_RATING SET REG_PATH_ID=(SELECT REG_PATH_ID FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_RATING.REG_VERSION);
-- Delete versioned tags, were the PATH_ID will be null for older versions --
delete from REG_RESOURCE_PROPERTY where REG_PATH_ID is NULL;
delete from REG_RESOURCE_RATING where REG_PATH_ID is NULL;
delete from REG_RESOURCE_TAG where REG_PATH_ID is NULL;
delete from REG_RESOURCE_COMMENT where REG_PATH_ID is NULL;
delete from REG_PROPERTY where REG_ID NOT IN (select REG_PROPERTY_ID from REG_RESOURCE_PROPERTY);
delete from REG_TAG where REG_ID NOT IN (select REG_TAG_ID from REG_RESOURCE_TAG);
delete from REG_COMMENT where REG_ID NOT IN (select REG_COMMENT_ID from REG_RESOURCE_COMMENT);
delete from REG_RATING where REG_ID NOT IN (select REG_RATING_ID from REG_RESOURCE_RATING);
-- Update the REG_PATH_NAME column mapped with the REG_RESOURCE table --
UPDATE REG_RESOURCE_TAG SET REG_RESOURCE_NAME=(SELECT REG_NAME FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_TAG.REG_VERSION);
UPDATE REG_RESOURCE_PROPERTY SET REG_RESOURCE_NAME=(SELECT REG_NAME FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_PROPERTY.REG_VERSION);
UPDATE REG_RESOURCE_COMMENT SET REG_RESOURCE_NAME=(SELECT REG_NAME FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_COMMENT.REG_VERSION);
UPDATE REG_RESOURCE_RATING SET REG_RESOURCE_NAME=(SELECT REG_NAME FROM REG_RESOURCE WHERE REG_RESOURCE.REG_VERSION=REG_RESOURCE_RATING.REG_VERSION);
|
ALTER TABLE AUTH_USER_STATUS CHANGE reference ref VARCHAR(200);
|
-- phpMyAdmin SQL Dump
-- version 4.4.15.10
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2020-01-21 17:32:16
-- 服务器版本: 5.5.57-log
-- PHP Version: 5.4.45
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `shop`
--
-- --------------------------------------------------------
--
-- 表的结构 `s_menu`
--
CREATE TABLE IF NOT EXISTS `s_menu` (
`id` int(11) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`parent_id` int(11) DEFAULT '0',
`path` varchar(255) DEFAULT NULL,
`queue` int(11) DEFAULT '0'
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `s_menu`
--
INSERT INTO `s_menu` (`id`, `name`, `parent_id`, `path`, `queue`) VALUES
(1, '用户管理', 0, 'users', 1),
(2, '用户列表', 1, 'users', 0),
(3, '权限管理', 0, 'rights', 2),
(4, '角色管理', 3, 'roles', 0),
(5, '权限列表', 3, 'rights', 0),
(6, '商品管理', 0, 'goods', 3),
(7, '商品列表', 6, 'goods', 0),
(8, '分类参数', 6, 'params', 0),
(9, '商品分类', 6, 'categories', 0),
(10, '订单管理', 0, 'orders', 4),
(11, '订单列表', 10, 'orders', 0),
(12, '数据统计', 0, 'reports', 5),
(13, '统计报表', 12, 'reports', 0);
-- --------------------------------------------------------
--
-- 表的结构 `s_rights`
--
CREATE TABLE IF NOT EXISTS `s_rights` (
`id` int(11) NOT NULL,
`auth_name` varchar(255) DEFAULT NULL,
`level` varchar(255) DEFAULT NULL,
`path` varchar(255) DEFAULT NULL,
`pid` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `s_rights`
--
INSERT INTO `s_rights` (`id`, `auth_name`, `level`, `path`, `pid`) VALUES
(1, '商品管理', '0', 'goods', 0),
(2, '订单管理', '0', 'orders', 0),
(3, '权限管理', '0', 'rights', 0),
(4, '用户管理', '0', 'users', 0),
(5, '数据统计', '0', 'reports', 0),
(6, '商品列表', '1', 'goods', 1),
(7, '分类参数', '1', 'params', 1),
(8, '商品分类', '1', 'categories', 1),
(9, '添加商品', '2', 'goods', 6),
(10, '商品修改', '2', 'goods', 6),
(11, '商品删除', '2', 'goods', 6),
(12, '更新商品图片', '2', 'goods', 6),
(13, '更新商品属性', '2', 'goods', 6),
(14, '更新商品状态', '2', 'goods', 6),
(15, '获取商品详情', '2', 'goods', 6),
(16, '获取参数列表', '2', 'params', 7),
(17, '创建商品参数', '2', 'params', 7),
(18, '删除商品参数', '2', 'params', 7),
(19, '添加分类', '2', 'categories', 8),
(20, '删除分类', '2', 'categories', 8),
(21, '获取分类详情', '2', 'categories', 8);
-- --------------------------------------------------------
--
-- 表的结构 `s_role`
--
CREATE TABLE IF NOT EXISTS `s_role` (
`id` int(11) NOT NULL,
`d_esc` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `s_role`
--
INSERT INTO `s_role` (`id`, `d_esc`, `name`) VALUES
(1, '管理员', '管理员'),
(2, '普通', '普通用户');
-- --------------------------------------------------------
--
-- 表的结构 `s_role_right`
--
CREATE TABLE IF NOT EXISTS `s_role_right` (
`id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
`right_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `s_role_right`
--
INSERT INTO `s_role_right` (`id`, `role_id`, `right_id`) VALUES
(1, 1, 1),
(2, 1, 6),
(3, 1, 7),
(4, 2, 1);
-- --------------------------------------------------------
--
-- 表的结构 `s_user`
--
CREATE TABLE IF NOT EXISTS `s_user` (
`id` int(11) NOT NULL,
`email` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`mg_state` bit(1) NOT NULL,
`name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`tel` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`username` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`rid` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- 转存表中的数据 `s_user`
--
INSERT INTO `s_user` (`id`, `email`, `mg_state`, `name`, `password`, `tel`, `username`, `rid`) VALUES
(1, '<EMAIL>', b'0', '若如初见', '<PASSWORD>', '1566666666', 'wxy', NULL),
(3, '<EMAIL>', b'0', '啊啊', '啊 啊啊啊1', ' 啊啊', '啊啊', NULL),
(4, '<EMAIL>', b'0', '123', '123', '123', '添加测试', NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `s_menu`
--
ALTER TABLE `s_menu`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `s_rights`
--
ALTER TABLE `s_rights`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `s_role`
--
ALTER TABLE `s_role`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `s_role_right`
--
ALTER TABLE `s_role_right`
ADD PRIMARY KEY (`id`),
ADD KEY `FK33j8vu3m6ps0gdq1yofaeaol7` (`right_id`),
ADD KEY `FKopajvv2w93mnwwwerf72w8h6m` (`role_id`);
--
-- Indexes for table `s_user`
--
ALTER TABLE `s_user`
ADD PRIMARY KEY (`id`),
ADD KEY `FKb66umb8i6jord32jk70vmbsqd` (`rid`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `s_menu`
--
ALTER TABLE `s_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `s_rights`
--
ALTER TABLE `s_rights`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `s_role`
--
ALTER TABLE `s_role`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `s_role_right`
--
ALTER TABLE `s_role_right`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `s_user`
--
ALTER TABLE `s_user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- 限制导出的表
--
--
-- 限制表 `s_role_right`
--
ALTER TABLE `s_role_right`
ADD CONSTRAINT `FK33j8vu3m6ps0gdq1yofaeaol7` FOREIGN KEY (`right_id`) REFERENCES `s_rights` (`id`),
ADD CONSTRAINT `FKopajvv2w93mnwwwerf72w8h6m` FOREIGN KEY (`role_id`) REFERENCES `s_role` (`id`);
--
-- 限制表 `s_user`
--
ALTER TABLE `s_user`
ADD CONSTRAINT `FKb66umb8i6jord32jk70vmbsqd` FOREIGN KEY (`rid`) REFERENCES `s_role` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
----------------------------
-- Copyright (C) 2022 CARTO
----------------------------
CREATE OR REPLACE FUNCTION QUADBIN_POLYFILL(
geom GEOMETRY,
resolution INT
)
RETURNS BIGINT[]
AS
$BODY$
SELECT CASE
WHEN resolution < 0 OR resolution > 26 THEN @@PG_PREFIX@@carto.__CARTO_ERROR(FORMAT('Invalid resolution "%s"; should be between 0 and 26', resolution))::BIGINT[]
WHEN resolution IS NULL OR geom IS NULL THEN NULL::BIGINT[]
ELSE (
WITH
__geom4326 AS (
SELECT CASE ST_SRID(geom)
WHEN 0 THEN ST_SetSRID(geom, 4326)
ELSE ST_TRANSFORM(geom, 4326)
END AS geom4326
),
__bbox AS (
SELECT geom4326, Box2D(geom4326) AS b FROM __geom4326
),
__params AS (
SELECT
geom4326,
resolution AS z,
ST_XMIN(b) AS minlon,
ST_YMIN(b) AS minlat,
ST_XMAX(b) AS maxlon,
ST_YMAX(b) AS maxlat
FROM __bbox
),
__tile_coords_range AS (
SELECT
geom4326,
z,
FLOOR((1 << z) * ((minlon / 360.0) + 0.5))::INT AS xmin,
FLOOR((1 << z) * (0.5 - (LN(TAN(PI()/4.0 + maxlat/2.0 * PI()/180.0)) / (2*PI()))))::INT AS ymin,
FLOOR((1 << z) * ((maxlon / 360.0) + 0.5))::INT AS xmax,
FLOOR((1 << z) * (0.5 - (LN(TAN(PI()/4.0 + minlat/2.0 * PI()/180.0)) / (2*PI()))))::INT AS ymax
FROM __params
),
__cells AS (
SELECT
geom4326,
@@PG_PREFIX@@carto.QUADBIN_FROMZXY(z, x, y) AS quadbin
FROM __tile_coords_range,
generate_series(xmin, xmax) AS x,
generate_series(ymin, ymax) AS y
)
SELECT ARRAY_AGG(quadbin)
FROM __cells
WHERE ST_INTERSECTS(
@@PG_PREFIX@@carto.QUADBIN_BOUNDARY(quadbin),
geom4326
)
)
END;
$BODY$
LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
|
<filename>hasura/migrations/1627733817299_insert_into_conference_ConfigurationKey/up.sql
INSERT INTO "conference"."ConfigurationKey"("name", "description") VALUES (E'FILLER_VIDEOS', E'List of S3 URLs.');
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 26, 2018 at 05:31 PM
-- Server version: 5.7.20
-- PHP Version: 5.6.30-11+deb.sury.org~trusty+3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `jithirev2`
--
-- --------------------------------------------------------
--
-- Table structure for table `jh_domains`
--
CREATE TABLE `jh_domains` (
`domain_id` int(11) NOT NULL,
`domains` varchar(34) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `jh_domains`
--
INSERT INTO `jh_domains` (`domain_id`, `domains`) VALUES
(3, 'Advertising'),
(4, 'Airline'),
(5, 'Automotive'),
(6, 'Banking'),
(7, 'Casinos'),
(8, 'Consumer'),
(9, 'Cruise Lines'),
(10, 'Construction'),
(11, 'Dairy'),
(12, 'Defense'),
(13, 'Education'),
(14, 'Electronics'),
(15, 'Energy'),
(16, 'Engineering'),
(17, 'Farming'),
(18, 'Fast-Moving Consumer Goods (FMCG)'),
(19, 'Financial (Finance)'),
(20, 'FinTech'),
(21, 'Food and beverage'),
(22, 'Government - federal, state, local'),
(23, 'Healthcare'),
(24, 'Human Resource'),
(25, 'Insurance'),
(26, 'IT'),
(27, 'Jewelry'),
(28, 'Legal'),
(29, 'Logistics'),
(30, 'Manufacturing'),
(31, 'Media'),
(32, 'Mining'),
(33, 'Not-for-Profit'),
(34, 'Oil and Gas'),
(35, 'Online'),
(36, 'Pharmaceutical'),
(37, 'Real estate'),
(38, 'Religion'),
(39, 'Retail'),
(40, 'Technology'),
(41, 'Telecommunications'),
(42, 'Textiles'),
(43, 'Transportation (Travel)');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `jh_domains`
--
ALTER TABLE `jh_domains`
ADD PRIMARY KEY (`domain_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `jh_domains`
--
ALTER TABLE `jh_domains`
MODIFY `domain_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;
/*!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 */;
|
<reponame>BayrexR/BBB-Samples
drop database if exists bbb_db;
create database bbb_db;
use bbb_db;
CREATE TABLE samples (
otu_id INT NOT NULL,
otu_label VARCHAR(1000),
BB_940 INT,
BB_941 INT,
BB_943 INT,
BB_944 INT,
BB_945 INT,
BB_946 INT,
BB_947 INT,
BB_948 INT,
BB_949 INT,
BB_950 INT,
BB_952 INT,
BB_953 INT,
BB_954 INT,
BB_955 INT,
BB_956 INT,
BB_958 INT,
BB_959 INT,
BB_960 INT,
BB_961 INT,
BB_962 INT,
BB_963 INT,
BB_964 INT,
BB_966 INT,
BB_967 INT,
BB_968 INT,
BB_969 INT,
BB_970 INT,
BB_971 INT,
BB_972 INT,
BB_973 INT,
BB_974 INT,
BB_975 INT,
BB_978 INT,
BB_1233 INT,
BB_1234 INT,
BB_1235 INT,
BB_1236 INT,
BB_1237 INT,
BB_1238 INT,
BB_1242 INT,
BB_1243 INT,
BB_1246 INT,
BB_1253 INT,
BB_1254 INT,
BB_1258 INT,
BB_1259 INT,
BB_1260 INT,
BB_1264 INT,
BB_1265 INT,
BB_1273 INT,
BB_1275 INT,
BB_1276 INT,
BB_1277 INT,
BB_1278 INT,
BB_1279 INT,
BB_1280 INT,
BB_1281 INT,
BB_1282 INT,
BB_1283 INT,
BB_1284 INT,
BB_1285 INT,
BB_1286 INT,
BB_1287 INT,
BB_1288 INT,
BB_1289 INT,
BB_1290 INT,
BB_1291 INT,
BB_1292 INT,
BB_1293 INT,
BB_1294 INT,
BB_1295 INT,
BB_1296 INT,
BB_1297 INT,
BB_1298 INT,
BB_1308 INT,
BB_1309 INT,
BB_1310 INT,
BB_1374 INT,
BB_1415 INT,
BB_1439 INT,
BB_1441 INT,
BB_1443 INT,
BB_1486 INT,
BB_1487 INT,
BB_1489 INT,
BB_1490 INT,
BB_1491 INT,
BB_1494 INT,
BB_1495 INT,
BB_1497 INT,
BB_1499 INT,
BB_1500 INT,
BB_1501 INT,
BB_1502 INT,
BB_1503 INT,
BB_1504 INT,
BB_1505 INT,
BB_1506 INT,
BB_1507 INT,
BB_1508 INT,
BB_1510 INT,
BB_1511 INT,
BB_1512 INT,
BB_1513 INT,
BB_1514 INT,
BB_1515 INT,
BB_1516 INT,
BB_1517 INT,
BB_1518 INT,
BB_1519 INT,
BB_1521 INT,
BB_1524 INT,
BB_1526 INT,
BB_1527 INT,
BB_1530 INT,
BB_1531 INT,
BB_1532 INT,
BB_1533 INT,
BB_1534 INT,
BB_1535 INT,
BB_1536 INT,
BB_1537 INT,
BB_1539 INT,
BB_1540 INT,
BB_1541 INT,
BB_1542 INT,
BB_1543 INT,
BB_1544 INT,
BB_1545 INT,
BB_1546 INT,
BB_1547 INT,
BB_1548 INT,
BB_1549 INT,
BB_1550 INT,
BB_1551 INT,
BB_1552 INT,
BB_1553 INT,
BB_1554 INT,
BB_1555 INT,
BB_1556 INT,
BB_1557 INT,
BB_1558 INT,
BB_1561 INT,
BB_1562 INT,
BB_1563 INT,
BB_1564 INT,
BB_1572 INT,
BB_1573 INT,
BB_1574 INT,
BB_1576 INT,
BB_1577 INT,
BB_1581 INT,
BB_1601 INT
) ENGINE = InnoDB AUTO_INCREMENT=256 DEFAULT CHARSET=latin1;
CREATE TABLE metaD (
sample INT,
_EVENT VARCHAR(100),
ETHNICITY VARCHAR(100),
GENDER VARCHAR(1),
AGE INT(3),
WFREQ DECIMAL(3,1),
BBTYPE VARCHAR(20),
LOCATION VARCHAR(100),
COUNTRY012 VARCHAR(100),
ZIP012 INT,
COUNTRY1319 VARCHAR(100),
ZIP1319 INT,
DOG VARCHAR(10),
CAT VARCHAR(10),
IMPSURFACE013 INT,
NPP013 FLOAT,
MMAXTEMP013 DECIMAL(4,1),
PFC013 INT,
IMPSURFACE1319 INT,
NPP1319 INT,
MMAXTEMP1319 FLOAT,
PFC1319 DECIMAL(4,1)
) ENGINE = InnoDB AUTO_INCREMENT=256 DEFAULT CHARSET=latin1;
|
<filename>MAINTENANCE/SQL Server/sensitivity/sensitivity.sql
SELECT o.name AS [Table Name]
,ac.name AS [Column Name]
,sc.label
,sc.information_type
FROM sys.sensitivity_classifications sc
INNER JOIN sys.objects o ON o.object_id = sc.major_id
INNER JOIN sys.all_columns ac ON ac.column_id = sc.minor_id
WHERE ac.object_id = o.object_id;
|
--Generated Upgrade For Version 0.0.0.0.0
--Generated on 2012-02-24 10:30:40
|
<filename>sigwakaf.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 23 Feb 2021 pada 16.01
-- Versi server: 10.1.30-MariaDB
-- Versi PHP: 7.1.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sigwakaf`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `kelurahan`
--
CREATE TABLE `kelurahan` (
`id_kelurahan` int(11) NOT NULL,
`kelurahan` varchar(150) NOT NULL,
`kode` varchar(20) NOT NULL,
`warna` varchar(9) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `kelurahan`
--
INSERT INTO `kelurahan` (`id_kelurahan`, `kelurahan`, `kode`, `warna`) VALUES
(1, 'Karangasem', '#C2E8E9', '#c2e8e9'),
(2, 'Jajar', '#D8F0F2', '#d8f0f2'),
(3, 'Kerten', '#ABDFDD', '#abdfdd'),
(4, 'Purwosari', '#31A565', '#31a565'),
(5, 'Penumping', '#46B17E', '#46b17e'),
(6, 'Sriwedari', '#10803E', '#10803e'),
(9, 'Laweyan', '#90D4C6', '#90d4c6'),
(10, 'Bumi', '#EDF8FB', '#edf8fb'),
(11, 'Pajang', '#74C8AF', '#74c8af'),
(12, 'Panularan', '#5BBC98', '#<PASSWORD>'),
(13, 'Sondakan', '#209451', '#209451');
-- --------------------------------------------------------
--
-- Struktur dari tabel `login`
--
CREATE TABLE `login` (
`id_login` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`nama_user` varchar(20) NOT NULL,
`email` varchar(30) NOT NULL,
`jenis_kelamin` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `login`
--
INSERT INTO `login` (`id_login`, `username`, `password`, `nama_user`, `email`, `jenis_kelamin`) VALUES
(1, 'admin', '<PASSWORD>', '<NAME>', '<EMAIL>', 'Female');
-- --------------------------------------------------------
--
-- Struktur dari tabel `nadzhir`
--
CREATE TABLE `nadzhir` (
`id_nadzhir` int(11) NOT NULL,
`nadzhir` varchar(50) NOT NULL,
`nik` int(17) NOT NULL,
`jenis_kelamin` varchar(2) NOT NULL,
`tgl_lahir` date NOT NULL,
`tpt_lahir` varchar(30) NOT NULL,
`agama` varchar(30) NOT NULL,
`pekerjaan` varchar(50) NOT NULL,
`alamat` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `nadzhir`
--
INSERT INTO `nadzhir` (`id_nadzhir`, `nadzhir`, `nik`, `jenis_kelamin`, `tgl_lahir`, `tpt_lahir`, `agama`, `pekerjaan`, `alamat`) VALUES
(2, 'Nana', 12344567, 'P', '1985-10-12', 'Boyolali', 'Islam', 'Pegawai Swasta', 'Laweyan'),
(3, 'Okta', 12344637, 'P', '1981-11-06', 'Surabaya', 'Islam', 'Pegawai Sipil', 'Sriwedari'),
(4, 'Dinda', 12349789, 'P', '1983-12-12', 'Surabaya', 'Islam', 'Wiraswasta', 'Penumping'),
(5, 'Adit', 12345869, 'L', '1977-04-15', 'Riau', 'Islam', 'Pegawai Sipil', 'Jajar'),
(6, 'Dita', 12340988, 'P', '1984-03-10', 'Jakarta', 'Islam', 'Pegawai Swasta', 'Purwosari');
-- --------------------------------------------------------
--
-- Struktur dari tabel `wakaf`
--
CREATE TABLE `wakaf` (
`id_wakaf` int(11) NOT NULL,
`kelurahan` varchar(150) NOT NULL,
`luas` int(11) NOT NULL,
`penggunaan` varchar(50) NOT NULL,
`wakif` varchar(50) NOT NULL,
`nadzhir` varchar(50) NOT NULL,
`no_sertifikat` varchar(50) NOT NULL,
`tgl_sertifikat` date NOT NULL,
`no_aiw` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `wakaf`
--
INSERT INTO `wakaf` (`id_wakaf`, `kelurahan`, `luas`, `penggunaan`, `wakif`, `nadzhir`, `no_sertifikat`, `tgl_sertifikat`, `no_aiw`) VALUES
(1, 'Karangasem', 1000, 'Masjid', 'Ilma', 'Nana', '1001001', '2009-07-11', '101'),
(2, 'Jajar', 90, 'Mushola', 'Rahman', 'Okta', '1001002', '2008-08-23', '102'),
(3, 'Kerten', 2000, 'Sekolah', 'Jojo', 'Dinda', '1001003', '2011-09-17', '103'),
(4, 'Purwosari', 10000, 'Pesantren', 'Lina', 'Adit', '1001004', '2010-10-09', '104'),
(5, 'Penumping', 2800, '<NAME>', 'Mega', 'Dita', '1001005', '2017-11-10', '105');
-- --------------------------------------------------------
--
-- Struktur dari tabel `wakif`
--
CREATE TABLE `wakif` (
`id_wakif` int(11) NOT NULL,
`wakif` varchar(50) NOT NULL,
`nik` int(17) NOT NULL,
`jenis_kelamin` varchar(2) NOT NULL,
`tgl_lahir` date NOT NULL,
`tpt_lahir` varchar(30) NOT NULL,
`agama` varchar(30) NOT NULL,
`pekerjaan` varchar(50) NOT NULL,
`alamat` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `wakif`
--
INSERT INTO `wakif` (`id_wakif`, `wakif`, `nik`, `jenis_kelamin`, `tgl_lahir`, `tpt_lahir`, `agama`, `pekerjaan`, `alamat`) VALUES
(2, 'Ilma', 12349999, 'P', '1970-09-15', 'Semarang', 'Islam', 'Wiraswasta', 'Kerten'),
(3, 'Rahman', 12356678, 'L', '1977-07-08', 'Bandung', 'Islam', 'Pedagang', 'Jajar'),
(4, 'Jojo', 12355436, 'L', '1960-01-14', 'Yogyakarta', 'Islam', 'Pegawai Swasta', 'Purwosari'),
(5, 'Lina', 12352352, 'P', '1980-05-20', 'Riau', 'Islam', 'Pegawai Swasta', 'Kerten'),
(6, 'Mega', 12354636, 'P', '1988-11-05', 'Bandung', 'Islam', 'Wiraswasta', 'Jajar');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `kelurahan`
--
ALTER TABLE `kelurahan`
ADD PRIMARY KEY (`id_kelurahan`);
--
-- Indeks untuk tabel `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`id_login`);
--
-- Indeks untuk tabel `nadzhir`
--
ALTER TABLE `nadzhir`
ADD PRIMARY KEY (`id_nadzhir`);
--
-- Indeks untuk tabel `wakaf`
--
ALTER TABLE `wakaf`
ADD PRIMARY KEY (`id_wakaf`);
--
-- Indeks untuk tabel `wakif`
--
ALTER TABLE `wakif`
ADD PRIMARY KEY (`id_wakif`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `kelurahan`
--
ALTER TABLE `kelurahan`
MODIFY `id_kelurahan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT untuk tabel `login`
--
ALTER TABLE `login`
MODIFY `id_login` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `nadzhir`
--
ALTER TABLE `nadzhir`
MODIFY `id_nadzhir` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT untuk tabel `wakaf`
--
ALTER TABLE `wakaf`
MODIFY `id_wakaf` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `wakif`
--
ALTER TABLE `wakif`
MODIFY `id_wakif` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
DROP TABLE IF EXISTS co_data_nodes;
DROP SEQUENCE IF EXISTS element_id_seq;
CREATE SEQUENCE element_id_seq;
CREATE TABLE co_data_nodes (
id BIGINT NOT NULL DEFAULT nextval('element_id_seq'),
access_class VARCHAR(255) NOT NULL,
last_access TIMESTAMP NOT NULL,
read_security_id BIGINT DEFAULT NULL,
write_security_id BIGINT DEFAULT NULL,
object_name VARCHAR(255) DEFAULT NULL,
access_class_context TEXT DEFAULT NULL,
owner BIGINT DEFAULT NULL,
longitude DOUBLE PRECISION DEFAULT NULL,
latitude DOUBLE PRECISION DEFAULT NULL,
tag0 VARCHAR(255) DEFAULT NULL,
tag1 VARCHAR(255) DEFAULT NULL,
tag2 VARCHAR(255) DEFAULT NULL,
tag3 VARCHAR(255) DEFAULT NULL,
tag4 VARCHAR(255) DEFAULT NULL,
tag5 VARCHAR(255) DEFAULT NULL,
tag6 VARCHAR(255) DEFAULT NULL,
tag7 VARCHAR(255) DEFAULT NULL,
tag8 VARCHAR(255) DEFAULT NULL,
tag9 VARCHAR(255) DEFAULT NULL,
payload TEXT DEFAULT NULL
);
INSERT INTO co_data_nodes (access_class, last_access, read_security_id, write_security_id, object_name, access_class_context, owner, longitude, latitude, tag0, tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, payload) VALUES
('CO_Main_DB_Record', '1970-01-01 00:00:00', -1, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', NULL, NULL, 'Las Vegas', NULL, NULL, 36.1699, -115.1398, 'US', 'NV', 'nevada', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 3, 3, 'Area 51', NULL, NULL, 37.2343, -115.8067, 'alien', 'spooks', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 4, 4, 'NA World Services', NULL, NULL, 34.23592, -118.563659, 'NA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 5, 5, 'Dubai', NULL, NULL, 25.2048, 55.2708, 'Middle East', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 5, 5, 'Anchorage', NULL, NULL, 61.2181, -149.9003, 'US', 'AL', 'alaska', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 6, 6, 'Adelaide', NULL, NULL, -34.9285, 138.6007, 'AU', 'SA', 'south australia', 'australia', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 0, 3, 'San Jose, Costa Rica', NULL, NULL, 9.9281, -84.0907, 'CR', 'Costa Rica', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 0, 0, 'San Jose, California', NULL, NULL, 37.3382, -121.8863, 'US', 'CA', 'california', 'northern california', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('CO_LL_Location', '1970-01-01 00:00:00', 6, 6, 'Gettysburg, Pennsylvania', NULL, NULL, 39.8309, -77.2311, 'US', 'PA', 'pennsylvania', 'Lincoln', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
SELECT
COUNT(requests.RequestGuid)
FROM v_userapprequests AS requests
LEFT JOIN
(
SELECT
[apps].[ModelID] AS app_modelid,
[localizedproperties].[Publisher] AS app_manufacturer,
[localizedproperties].[Title] AS app_title,
[localizedproperties].[Description] AS app_description
FROM fn_listlatestapplicationcis(1033) AS apps
LEFT JOIN fn_localizedappproperties(1033) AS localizedproperties
ON apps.ci_id = localizedproperties.ci_id ) AS apps
ON apps.app_modelid = requests.modelid
LEFT JOIN [dbo].[v_R_User] AS users
ON users.sid0 = requests.sid0
WHERE requests.unique_user_name0 != 'None'
|
<gh_stars>1-10
use employees;
#Functions Intro
SELECT COUNT(*)
FROM employees;
#Concat a list of strings (combines strings)
SELECT concat("Hi", "Hi", "Hi");
#Concat adds strings together
SELECT concat(first_name," ", last_name) AS full_name
FROM employees
LIMIT 10;
#using SUBSTR
SELECT SUBSTR('abcdef', 2, 4);
SELECT SUBSTR(upper('hello'), 2, 4);
#using REPLACE
SELECT REPLACE(title, "Senior", "Lead");
# using time fuctions
SELECT CURDATE();
SELECT NOW();
SELECT NOW();
#Show all of the saleries
SELECT *
FROM salaries;
#Show all current salaries
SELECT *
FROM salaries
WHERE to_date > CURDATE();
#Use avg to get average
SELECT avg(salary) as avg_current_salary
FROM salaries
WHERE to_date > CURDATE();
#Use Min to show current Min salaries
SELECT min(salary) as min_current_salary
FROM salaries
WHERE to_date > CURDATE();
#Use Max to show current Max salaries
SELECT max(salary) as max_current_salary
FROM salaries
WHERE to_date > CURDATE();
#Exercises Order By
#1)Create a new file named order_by_exercises.sql and copy in the contents of your exercise from the previous lesson.
#2)Find all employees with first names 'Irena', 'Vidya', or 'Maya', and order your results returned by first name. In your comments, answer: What was the first and last name in the first row of the results? What was the first and last name of the last person in the table?
use employees;
SELECT *
FROM employees
WHERE first_name IN ('Irena', 'Vidya', 'Maya')
ORDER BY first_name; #<NAME>
SELECT *
FROM employees
WHERE first_name IN ('Irena', 'Vidya', 'Maya')
ORDER BY first_name DESC, emp_no DESC;#<NAME> (Need Secodary Sort)
#3)Find all employees with first names 'Irena', 'Vidya', or 'Maya', and order your results returned by first name and then last name. In your comments, answer: What was the first and last name in the first row of the results? What was the first and last name of the last person in the table?
SELECT *
FROM employees
WHERE first_name IN ('Irena', 'Vidya', 'Maya')
ORDER BY first_name , last_name; #<NAME>
SELECT *
FROM employees
WHERE first_name IN ('Irena', 'Vidya', 'Maya')
ORDER BY first_name DESC, last_name DESC; #<NAME>
#4)Find all employees with first names 'Irena', 'Vidya', or 'Maya', and order your results returned by last name and then first name. In your comments, answer: What was the first and last name in the first row of the results? What was the first and last name of the last person in the table?
SELECT *
FROM employees
WHERE first_name IN ('Irena', 'Vidya', 'Maya')
ORDER BY last_name , first_name; #<NAME>
SELECT *
FROM employees
WHERE first_name IN ('Irena', 'Vidya', 'Maya')
ORDER BY last_name DESC , first_name DESC;#<NAME>
#5)Write a query to to find all employees whose last name starts and ends with 'E'. Sort the results by their employee number. Enter a comment with the number of employees returned, the first employee number and their first and last name, and the last employee number with their first and last name.
SELECT *
FROM employees
WHERE last_name LIKE 'e%e'
ORDER BY emp_no; #899 Records #10021 Ramzi Erde
SELECT *
FROM employees
WHERE last_name LIKE 'e%e'
ORDER BY emp_no DESC; # 199648 Tadahiro Erde
#6)Write a query to to find all employees whose last name starts and ends with 'E'. Sort the results by their hire date, so that the newest employees are listed first. Enter a comment with the number of employees returned, the name of the newest employee, and the name of the oldest emmployee.
SELECT *
FROM employees
WHERE last_name LIKE 'e%e'
ORDER BY hire_date DESC; #899 Records #<NAME>
SELECT *
FROM employees
WHERE last_name LIKE 'e%e'
ORDER BY hire_date ASC; #899 Records #<NAME>
#7)Find all employees hired in the 90s and born on Christmas. Sort the results so that the oldest employee who was hired last is the first result. Enter a comment with the number of employees returned, the name of the oldest employee who was hired last, and the name of the youngest emmployee who was hired first.
use employees;
SELECT *
FROM employees
WHERE hire_date LIKE '199%'
AND birth_date LIKE '%12-25'
ORDER BY birth_date ASC, hire_date DESC;#362 Records #<NAME>
SELECT *
FROM employees
WHERE hire_date LIKE '199%'
AND birth_date LIKE '%12-25'
ORDER BY birth_date DESC, hire_date ASC;#362 Records #<NAME>
use employees;
# Using Order By (If not specified the order is by Primary Key)
SELECT *
FROM employees
ORDER BY hire_date DESC; #([ASC|DESC])(ASC Default)
SELECT *
FROM employees
ORDER BY first_name ASC, last_name ASC, hire_date ASC;
SELECT *
FROM employees
ORDER BY first_name DESC, birth_date ASC; #(Order by is used at the end to sort not to filter)
#ORDER AND WHERE
SELECT *
FROM employees
WHERE emp_no between 101010 and 202020
AND last_name LIKE "%q%"
ORDER BY last_name ASC;
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Exercises Functions
#1)Copy the order by exercise and save it as functions_exercises.sql.
use employees;
SELECT *
FROM employees
LIMIT 10;
#2)Write a query to to find all current employees whose last name starts and ends with 'E'. Use concat() to combine their first and last name together as a single column named full_name.
SELECT concat(first_name," ", Last_name) as full_name
FROM employees
WHERE last_name LIKE 'e%e';
#3)Convert the names produced in your last query to all uppercase.
SELECT upper(concat(first_name," ", Last_name)) as full_name
FROM employees
WHERE last_name LIKE 'e%e';
#4)Find all previous employees hired in the 90s and born on Christmas. Use datediff() function to find how many days they have been working at the company (Hint: You will also need to use NOW() or CURDATE()),
SELECT emp_no,
first_name,
last_name,
datediff(NOW(), hire_date) as how_many_days_at_company
FROM employees
WHERE hire_date LIKE '199%'
AND birth_date LIKE '%12-25';
#5)Find the smallest and largest current salary from the salaries table.
SELECT min(salary) as min_current_salary
FROM salaries
WHERE to_date > CURDATE();#38623
#Use Max to show current Max salaries
SELECT max(salary) as max_current_salary
FROM salaries
WHERE to_date > CURDATE();#158220
#6)Use your knowledge of built in SQL functions to generate a username for all of the current and previous employees.
#A username should be all lowercase, and consist of the first character of the employees first name,
#the first 4 characters of the employees last name,
#an underscore,
#the month the employee was born,
#and the last two digits of the year that they were born. Below is an example of what the first 10 rows will look like:
SELECT lower(concat(substr(first_name,1, 1),
substr(last_name, 1,4),
"_",
substr(birth_date,6,2),
substr(birth_date,3,2)))
AS employee_username,
first_name AS first_name,
last_name AS last_name,
birth_date AS birth_date
FROM employees
WHERE birth_date LIKE '%12-25'
ORDER BY first_name ASC
LIMIT 20;
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
<filename>ansible/roles/provision-geo-location-db/templates/psql_schema.sql<gh_stars>10-100
CREATE TABLE IF NOT EXISTS {{ env }}_geo_location_city_temp(geoname_id INTEGER UNIQUE, locale_code VARCHAR(3), continent_code VARCHAR(3), continent_name VARCHAR(100), country_iso_code VARCHAR(5), country_name VARCHAR(100), subdivision_1_iso_code VARCHAR(50), subdivision_1_name VARCHAR(100), subdivision_2_iso_code VARCHAR(50), subdivision_2_name VARCHAR(100), city_name VARCHAR(100), metro_code VARCHAR(10), time_zone VARCHAR(50), is_in_european_union SMALLINT);
CREATE TABLE IF NOT EXISTS {{ env }}_geo_location_city_ipv4_temp(network_start_integer BIGINT, network_last_integer BIGINT, geoname_id INTEGER, registered_country_geoname_id INTEGER, represented_country_geoname_id INTEGER, is_anonymous_proxy SMALLINT, is_satellite_provider SMALLINT, postal_code VARCHAR(50), latitude NUMERIC(9, 6), longitude NUMERIC(9, 6), accuracy_radius SMALLINT);
\COPY {{ env }}_geo_location_city_temp FROM '{{ maxmind_db_download_dir }}/{{ maxmind_db_dir_name }}/{{ maxmind_db_geo_city_locations_filename }}' WITH CSV HEADER DELIMITER ',';
\COPY {{ env }}_geo_location_city_ipv4_temp FROM '{{ maxmind_db_download_dir }}/{{ maxmind_db_dir_name }}/{{ maxmind_db_geo_city_ip_range_filename }}' WITH CSV HEADER DELIMITER ',';
CREATE TABLE IF NOT EXISTS {{ env }}_maxmind_custom_data_mapping(geoname_id INTEGER UNIQUE, subdivision_1_custom_code VARCHAR(50), subdivision_1_custom_name VARCHAR(100), subdivision_2_custom_code VARCHAR(50), subdivision_2_custom_name VARCHAR(100));
\COPY {{ env }}_maxmind_custom_data_mapping FROM '{{ maxmind_db_download_dir }}/maxmind_custom_data_mapping.csv' WITH CSV HEADER DELIMITER ',';
CREATE TABLE IF NOT EXISTS {{ env }}_geo_location_city(geoname_id INTEGER UNIQUE, locale_code VARCHAR(3), continent_code VARCHAR(3), continent_name VARCHAR(100), country_iso_code VARCHAR(5), country_name VARCHAR(100), subdivision_1_iso_code VARCHAR(50), subdivision_1_name VARCHAR(100), subdivision_2_iso_code VARCHAR(50), subdivision_2_name VARCHAR(100), city_name VARCHAR(100), metro_code VARCHAR(10), time_zone VARCHAR(50), is_in_european_union SMALLINT, subdivision_1_custom_code VARCHAR(50), subdivision_1_custom_name VARCHAR(100), subdivision_2_custom_code VARCHAR(50), subdivision_2_custom_name VARCHAR(100));
CREATE TABLE IF NOT EXISTS {{ env }}_geo_location_city_ipv4(network_start_integer BIGINT, network_last_integer BIGINT, geoname_id INTEGER, registered_country_geoname_id INTEGER, represented_country_geoname_id INTEGER, is_anonymous_proxy SMALLINT, is_satellite_provider SMALLINT, postal_code VARCHAR(50), latitude NUMERIC(9, 6), longitude NUMERIC(9, 6), accuracy_radius SMALLINT);
CREATE INDEX CONCURRENTLY IF NOT EXISTS ind_geoname_id ON {{ env }}_geo_location_city_ipv4 (geoname_id);
CREATE INDEX CONCURRENTLY IF NOT EXISTS ind_network_start_integer ON {{ env }}_geo_location_city_ipv4 (network_start_integer);
CREATE INDEX CONCURRENTLY IF NOT EXISTS ind_network_last_integer ON {{ env }}_geo_location_city_ipv4 (network_last_integer);
CREATE INDEX CONCURRENTLY IF NOT EXISTS ind_country_iso_code ON {{ env }}_geo_location_city (country_iso_code);
TRUNCATE TABLE {{ env }}_geo_location_city_ipv4 CASCADE;
TRUNCATE TABLE {{ env }}_geo_location_city CASCADE;
INSERT INTO {{ env }}_geo_location_city SELECT glc.geoname_id, glc.locale_code, glc.continent_code, glc.continent_name, glc.country_iso_code, glc.country_name, glc.subdivision_1_iso_code, glc.subdivision_1_name, glc.subdivision_2_iso_code, glc.subdivision_2_name, glc.city_name, glc.metro_code, glc.time_zone, glc.is_in_european_union, mcd.subdivision_1_custom_code, mcd.subdivision_1_custom_name, mcd.subdivision_2_custom_code, mcd.subdivision_2_custom_name FROM {{ env }}_geo_location_city_temp glc LEFT JOIN {{ env }}_maxmind_custom_data_mapping mcd ON glc.geoname_id = mcd.geoname_id WHERE glc.country_iso_code = 'IN';
INSERT INTO {{ env }}_geo_location_city_ipv4 SELECT gip.* FROM {{ env }}_geo_location_city glc, {{ env }}_geo_location_city_ipv4_temp gip WHERE glc.geoname_id = gip.geoname_id;
DROP TABLE {{ env }}_geo_location_city_temp CASCADE;
DROP TABLE {{ env }}_geo_location_city_ipv4_temp CASCADE;
DROP TABLE {{ env }}_maxmind_custom_data_mapping CASCADE;
|
CREATE TABLE "public"."user"("id" serial NOT NULL, "role" varchar NOT NULL, "username" varchar NOT NULL, "account" varchar NOT NULL, "secret" varchar NOT NULL, "email" varchar NOT NULL, "email_verified" bool NOT NULL DEFAULT false, "verification_code" varchar NOT NULL, "created_at" timestamp without time zone NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), PRIMARY KEY ("id") , UNIQUE ("id"), UNIQUE ("username"), UNIQUE ("account"), UNIQUE ("email"), UNIQUE ("verification_code"));
|
begin transaction;
/* Create a staging table to hold the input data. Staging table is created with BACKUP NO option for faster inserts and also data temporary */
drop table if exists public.stg_customer_address;
create table if not exists public.stg_customer_address
(ca_address_id varchar(16) encode zstd
,ca_state varchar(2) encode zstd
,ca_zip varchar(10) encode zstd
,ca_country varchar(20) encode zstd
)
backup no
diststyle even;
/* Ingest data from source */
insert into public.stg_customer_address (ca_address_id,ca_state,ca_zip,ca_country)
values
('AAAAAAAACFBBAAAA','NE','','United States'),
('AAAAAAAAGAEFAAAA','NE','61749','United States'),
('AAAAAAAAPJKKAAAA','OK','','United States'),
('AAAAAAAAMIHGAAAA','AL','','United States');
/* Perform UPDATE for existing data with refreshed attribute values */
update public.customer_address
set ca_state = stg_customer_address.ca_state,
ca_zip = stg_customer_address.ca_zip,
ca_country = stg_customer_address.ca_country
from public.stg_customer_address
where customer_address.ca_address_id = stg_customer_address.ca_address_id;
/* Perform insert for new rows */
insert into public.customer_address
(ca_address_sk
,ca_address_id
,ca_state
,ca_zip
,ca_country
)
with max_customer_address_sk as
(select max(ca_address_sk) max_ca_address_sk
from public.customer_address)
select row_number() over (order by stg_customer_address.ca_address_id) + max_customer_address_sk.max_ca_address_sk as ca_address_sk
,stg_customer_address.ca_address_id
,stg_customer_address.ca_state
,stg_customer_address.ca_zip
,stg_customer_address.ca_country
from public.stg_customer_address,
max_customer_address_sk
where stg_customer_address.ca_address_id not in (select customer_address.ca_address_id from public.customer_address);
/* Commit and End transaction */
commit;
end transaction;
begin transaction;
/* Create a staging table to hold the input data. Staging table is created with BACKUP NO option for faster inserts and also data temporary */
drop table if exists public.stg_item;
create table if not exists public.stg_item
(i_item_id varchar(16) encode zstd
,i_rec_start_date date encode zstd
,i_rec_end_date date encode zstd
,i_current_price numeric(7,2) encode zstd
,i_category varchar(50) encode zstd
,i_product_name varchar(50) encode zstd
)
backup no
diststyle even;
/* Ingest data from source */
insert into public.stg_item
(i_item_id,i_rec_start_date,i_rec_end_date,i_current_price,i_category,i_product_name)
values
('AAAAAAAAIFNAAAAA','2021-04-27',NULL,15.10,'Electronics','ationoughtesepri'),
('AAAAAAAAOIFCAAAA','2021-04-27',NULL,9.96,'Home','antioughtcallyn st'),
('AAAAAAAAMGOAAAAA','2021-06-26',NULL,2.25,'Men','prin stcallypri'),
('AAAAAAAAIHAEAAAA','2021-03-14',NULL,3.85,'Home','callybaranticallyought'),
('AAAAAAAAMCOAAAAA','2021-03-14',NULL,2.95,'Electronics','barprically'),
('AAAAAAAAILOBAAAA','2021-03-14',NULL,12.60,'Jewelry','callycallyeingation');
/************************************************************************************************************************
** Type 2 is maintained for i_current_price column.
** Update all attributes for the item when the price is not changed
** Sunset existing active item record with current i_rec_end_date and insert a new record when the price does not match
*************************************************************************************************************************/
update public.item
set i_category = stg_item.i_category,
i_product_name = stg_item.i_product_name
from public.stg_item
where item.i_item_id = stg_item.i_item_id
and item.i_rec_end_date is null
and item.i_current_price = stg_item.i_current_price;
insert into public.item
(i_item_sk
,i_item_id
,i_rec_start_date
,i_rec_end_date
,i_current_price
,i_category
,i_product_name
)
with max_item_sk as
(select max(i_item_sk) max_item_sk
from public.item)
select row_number() over (order by stg_item.i_item_id) + max_item_sk as i_item_sk
,stg_item.i_item_id
,trunc(sysdate) as i_rec_start_date
,null as i_rec_end_date
,stg_item.i_current_price
,stg_item.i_category
,stg_item.i_product_name
from public.stg_item, public.item, max_item_sk
where item.i_item_id = stg_item.i_item_id
and item.i_rec_end_date is null
and item.i_current_price <> stg_item.i_current_price;
/* Sunset penultimate records that were inserted as type 2 */
update public.item
set i_rec_end_date = trunc(sysdate)
from public.stg_item
where item.i_item_id = stg_item.i_item_id
and item.i_rec_end_date is null
and item.i_current_price <> stg_item.i_current_price;
/* Commit and End transaction */
commit;
end transaction;
begin transaction;
/* Create a stg_store_sales staging table */
drop table if exists public.stg_store_sales;
create table public.stg_store_sales
(sold_date date encode zstd
,i_item_id varchar(16) encode zstd
,c_customer_id varchar(16) encode zstd
,ca_address_id varchar(16) encode zstd
,ss_ticket_number integer encode zstd
,ss_quantity integer encode zstd
,ss_net_paid numeric(7,2) encode zstd
,ss_net_profit numeric(7,2) encode zstd
)
backup no
diststyle even;
/* Ingest data from source */
insert into public.stg_store_sales
(sold_date,i_item_id,c_customer_id,ca_address_id,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit)
values
('2021-06-26','AAAAAAAAIFNAAAAA','AAAAAAAAOHNBAAAA','AAAAAAAAGBOFNIAA',1403191,13,5046.37,150.97),
('2021-06-26','AAAAAAAAIFNAAAAA','AAAAAAAAOHNBAAAA','AAAAAAAAGBOFNIAA',1403191,13,2103.72,-124.08),
('2021-06-26','AAAAAAAAILOBAAAA','AAAAAAAAOHNBAAAA','AAAAAAAAGBOFNIAA',1403191,13,959.10,-1304.70),
('2021-06-26','AAAAAAAAILOBAAAA','AAAAAAAAHNAJAAAA','AAAAAAAAIAPCFNAA',1403191,13,962.65,-475.80),
('2021-06-26','AAAAAAAAMCOAAAAA','AAAAAAAAHNAJAAAA','AAAAAAAAIAPCFNAA',1201746,17,111.60,-241.65),
('2021-06-26','AAAAAAAAMCOAAAAA','AAAAAAAAHNAJAAAA','AAAAAAAAIAPCFNAA',1201746,17,4013.02,-1111.48),
('2021-06-26','AAAAAAAAMCOAAAAA','AAAAAAAAMJCLACAA','AAAAAAAAMIFKEHAA',1201746,17,2689.12,-5572.28),
('2021-06-26','AAAAAAAAMGOAAAAA','AAAAAAAAMJCLACAA','AAAAAAAAMIFKEHAA',193971,18,1876.89,-556.35);
/* Delete any rows from target store_sales for the input date for idempotency */
delete from public.store_sales where ss_sold_date_sk in (select d_date_sk from public.date_dim where d_date='{job_run_date}');
/* Insert data from staging table to the target table */
insert into public.store_sales
(ss_sold_date_sk
,ss_item_sk
,ss_customer_sk
,ss_addr_sk
,ss_ticket_number
,ss_quantity
,ss_net_paid
,ss_net_profit
)
select date_dim.d_date_sk ss_sold_date_sk
,item.i_item_sk ss_item_sk
,customer.c_customer_sk ss_customer_sk
,customer_address.ca_address_sk ss_addr_sk
,ss_ticket_number
,ss_quantity
,ss_net_paid
,ss_net_profit
from public.stg_store_sales as store_sales
inner join public.date_dim on store_sales.sold_date = date_dim.d_date
left join public.item on store_sales.i_item_id = item.i_item_id and item.i_rec_end_date is null
left join public.customer on store_sales.c_customer_id = customer.c_customer_id
left join public.customer_address on store_sales.ca_address_id = customer_address.ca_address_id;
/* Drop staging table */
drop table if exists public.stg_store_sales;
/* Commit and End transaction */
commit;
end transaction;
select 1/count(1) from public.store_sales where ss_sold_date_sk in (select d_date_sk from public.date_dim where d_date='{job_run_date}');
|
INSERT INTO ligne (id,prix,temps,arrets) VALUES (1,10,180,"Lille > Paris");
INSERT INTO ligne (id,prix,temps,arrets) VALUES (2,8,210,"Lille > Arras > Paris");
INSERT INTO ligne (id,prix,temps,arrets) VALUES (3,8,210,"Lille > Compiègne > Paris");
INSERT INTO ligne (id,prix,temps,arrets) VALUES (4,6,240,"Lille > Arras > Compiègne > Paris");
|
<reponame>IUIDSL/kgap_lincs-idg<filename>cql/tdark_1.cql<gh_stars>1-10
//TDARK-
//Tdark gene with lowest number of signatures filtered at +-8 zscore
//signature-gray
match (g:Gene {id:'94239'}) where g.tdl ="Tdark"
with g
match p=(g)-[r:SIGNATURE_GENE]-(s)-[:DRUG_SIGNATURE]-(),p2=(s)-[:CELL_SIGNATURE]-() where r.zscore >8 or r.zscore <-8
with relationships(p) +relationships(p2) as relz
unwind relz as rel
return startNode(rel),rel,endNode(rel)
;
|
<reponame>tutnatha/koperasi-server-fineract
--
-- 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.
--
-- ALTER TABLE `m_client`
-- ADD COLUMN `proposed_transfer_date` DATE NULL DEFAULT NULL AFTER `email_address`;
CREATE TABLE IF NOT EXISTS `m_client_transfer_details` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`client_id` BIGINT NOT NULL,
`from_office_id` BIGINT NOT NULL,
`to_office_id` BIGINT NOT NULL,
`proposed_transfer_date` DATE NULL DEFAULT NULL,
`transfer_type` TINYINT NOT NULL,
`submitted_on` DATE NOT NULL,
`submitted_by` BIGINT NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_client_transfer_details_m_client` (`client_id`),
INDEX `FK_m_client_transfer_details_m_office` (`from_office_id`),
INDEX `FK_m_client_transfer_details_m_office_2` (`to_office_id`),
INDEX `FK_m_client_transfer_details_m_appuser` (`submitted_by`),
CONSTRAINT `FK_m_client_transfer_details_m_appuser` FOREIGN KEY (`submitted_by`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_m_client_transfer_details_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_client_transfer_details_m_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `FK_m_client_transfer_details_m_office_2` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`)
);
|
<reponame>DEFRA/prsd-iws<filename>src/EA.Iws.Database/scripts/Update/0001-Release1/Sprint06/20150429-150715-EA.Iws.sql
GO
PRINT N'Altering [Identity].[AspNetUsers]...';
GO
ALTER TABLE [Identity].[AspNetUsers]
ADD [FirstName] NVARCHAR (256) NULL,
[Surname] NVARCHAR (256) NULL;
GO
PRINT N'Update complete.';
GO
|
delete from item;
delete from user;
|
SELECT 'Upgrading MetaStore schema from 1.1.0 to 2.1.1' AS Status from dual;
-- Upgrading schema from 1.1.0 to 2.0.0 excluding patches included in CDH-5.12.0. There are no patches from 1.1.0 to 1.2.0
@upgrade-1.1.0-to-1.2.0.oracle.sql;
-- Upgrading schema from 2.0.0 to 2.1.1 excluding patches included in CDH-5.12.0.
@upgrade-1.2.0-to-2.0.0.oracle.sql;
@upgrade-2.0.0-to-2.1.0.oracle.sql;
-- Apply incremental schema changes to the 2.1.0 schema
@039-HIVE-12274.oracle.sql;
@018-HIVE-6757.oracle.sql;
@049-HIVE-18489.oracle.sql;
UPDATE VERSION SET SCHEMA_VERSION='2.1.1', VERSION_COMMENT='Hive release version 2.1.1' where VER_ID=1;
UPDATE CDH_VERSION SET SCHEMA_VERSION='2.1.1-cdh6.0.0', VERSION_COMMENT='Hive release version 2.1.1 for CDH 6.0.0' where VER_ID=1;
SELECT 'Finished upgrading MetaStore schema from 1.1.0 to 2.1.1' AS Status from dual;
|
<reponame>murrcha/kkaysheva<filename>chapter_006/src/main/resources/create.sql
create database items_store;
create table roles (
id serial primary key,
role_name character varying (30)
);
create table rules (
id serial primary key,
rule_name character varying (30)
);
create table role_rule (
id serial primary key,
role_id integer references roles(id),
rule_id integer references rules(id)
);
create table users (
id serial primary key,
login character varying(50),
password character varying(50),
create_date timestamp,
role_id integer references roles(id)
);
create table categories (
id serial primary key,
category_name character varying(30)
);
create table states (
id serial primary key,
state_name character varying(30)
);
create table items (
id serial primary key,
description character varying(2000),
create_date timestamp,
user_id integer references users(id),
state_id integer references states(id),
category_id integer references categories(id)
);
create table comments (
id serial primary key,
text character varying(2000),
create_date timestamp,
user_id integer references users(id),
item_id integer references items(id)
);
create table attaches (
id serial primary key,
attach character varying(2000),
user_id integer references users(id),
item_id integer references items(id)
);
insert into roles (role_name) values ('administrator');
insert into roles (role_name) values ('user');
insert into rules (rule_name) values ('read');
insert into rules (rule_name) values ('write');
insert into rules (rule_name) values ('add');
insert into rules (rule_name) values ('delete');
insert into role_rule (role_id, rule_id) values (1, 1);
insert into role_rule (role_id, rule_id) values (1, 2);
insert into role_rule (role_id, rule_id) values (1, 3);
insert into role_rule (role_id, rule_id) values (1, 4);
insert into role_rule (role_id, rule_id) values (2, 1);
insert into role_rule (role_id, rule_id) values (2, 2);
insert into users (login, password, create_date) values ('admin', 'admin', '2018-09-09 00:00:00');
insert into users (login, password, create_date) values ('kkaysheva', 'kkaysheva', '2018-09-09 00:00:00');
insert into categories (category_name) values ('question');
insert into categories (category_name) values ('offer');
insert into categories (category_name) values ('complaint');
insert into categories (category_name) values ('thanks');
insert into states (state_name) values ('to do');
insert into states (state_name) values ('in progress');
insert into states (state_name) values ('done');
insert into items (description, create_date, user_id, state_id, category_id)
values ('description for item number 1', '2018-09-09 00:00:00', 2, 1, 1);
insert into items (description, create_date, user_id, state_id, category_id)
values ('description for item number 2', '2018-09-09 00:00:00', 1, 1, 1);
insert into comments (text, create_date, user_id, item_id)
values ('comment for item number 1', '2018-09-09 00:00:00', 1, 1);
insert into comments (text, create_date, user_id, item_id)
values ('comment for item number 2', '2018-09-09 00:00:00', 2, 1);
insert into attaches (attach, user_id, item_id)
values ('link to attach for item 1', 1, 1);
insert into attaches (attach, user_id, item_id)
values ('link to attach for item 2', 1, 2);
|
<reponame>MesAdima/southern_cross
CREATE TABLE `applicant_additional_info` (
`entry_id` int(11) NOT NULL AUTO_INCREMENT,
`applicant_id` int(11) NOT NULL,
`source_of_discovery` varchar(250) NOT NULL,
`reason_for_study` varchar(250) NOT NULL,
`student_declaration` varchar(250) NOT NULL,
`parent_declaration` varchar(250) NOT NULL,
PRIMARY KEY (`entry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
<reponame>jmgonzmart/ensembl-analysis
delete repeat_feature from attrib_type, seq_region_attrib, repeat_feature where attrib_type.code in ('patch_novel','patch_fix') and attrib_type.attrib_type_id = seq_region_attrib.attrib_type_id and seq_region_attrib.seq_region_id = repeat_feature.seq_region_id;
delete prediction_exon from attrib_type, seq_region_attrib, prediction_exon where attrib_type.code in ('patch_novel','patch_fix') and attrib_type.attrib_type_id = seq_region_attrib.attrib_type_id and seq_region_attrib.seq_region_id = prediction_exon.seq_region_id;
delete prediction_transcript from attrib_type, seq_region_attrib, prediction_transcript where attrib_type.code in ('patch_novel','patch_fix') and attrib_type.attrib_type_id = seq_region_attrib.attrib_type_id and seq_region_attrib.seq_region_id = prediction_transcript.seq_region_id;
delete simple_feature from attrib_type, seq_region_attrib, simple_feature where attrib_type.code in ('patch_novel','patch_fix') and attrib_type.attrib_type_id = seq_region_attrib.attrib_type_id and seq_region_attrib.seq_region_id = simple_feature.seq_region_id;
delete dna_align_feature from attrib_type, seq_region_attrib, dna_align_feature where attrib_type.code in ('patch_novel','patch_fix') and attrib_type.attrib_type_id = seq_region_attrib.attrib_type_id and seq_region_attrib.seq_region_id = dna_align_feature.seq_region_id and dna_align_feature_id not in (select feature_id from transcript_supporting_feature where feature_type = 'dna_align_feature') and dna_align_feature_id not in (select feature_id from supporting_feature where feature_type = 'dna_align_feature');
delete protein_align_feature from attrib_type, seq_region_attrib, protein_align_feature where attrib_type.code in ('patch_novel','patch_fix') and attrib_type.attrib_type_id = seq_region_attrib.attrib_type_id and seq_region_attrib.seq_region_id = protein_align_feature.seq_region_id and protein_align_feature_id not in (select feature_id from transcript_supporting_feature where feature_type = 'protein_align_feature') and protein_align_feature_id not in (select feature_id from supporting_feature where feature_type = 'protein_align_feature');
|
<gh_stars>0
ALTER TABLE `dc_equipment`
ADD COLUMN `unit_voltage` varchar(10) NULL DEFAULT NULL AFTER `name`,
ADD COLUMN `unit_amperage` varchar(10) NULL DEFAULT NULL AFTER `unit_voltage`,
ADD COLUMN `active` int(3) NULL DEFAULT 1 COMMENT '0: inactive | 1:active' AFTER `unit_amperage`;
|
\c pg_db;
SET search_path TO base_0_0_1, public;
/*
__ __ _ _ _ _ _____ _ _ _ _
\ \ / / | (_) | | | | / ____| | | | | (_) | |
\ \ / /_ _| |_ __| | __ _| |_ ___ | | _ __ ___ __| | ___ _ __ | |_ _ __ _| |___
\ \/ / _` | | |/ _` |/ _` | __/ _ \ | | | '__/ _ \/ _` |/ _ \ '_ \| __| |/ _` | / __|
\ / (_| | | | (_| | (_| | || __/ | |____| | | __/ (_| | __/ | | | |_| | (_| | \__ \
\/ \__,_|_|_|\__,_|\__,_|\__\___| \_____|_| \___|\__,_|\___|_| |_|\__|_|\__,_|_|___/
*/
BEGIN;
SELECT plan(1);
-- 1
SELECT has_function(
'base_0_0_1',
'validate_credentials',
ARRAY[ 'JSONB' ],
'Function validate_credentials(jsonb) exists'
);
-- TEST: Test event_logger Insert
SELECT * FROM finish();
ROLLBACK;
|
<reponame>jovanpop-msft/srb
SET QUOTED_IDENTIFIER OFF; -- Because I use "" as a string literal
GO
CREATE SCHEMA srb;
GO
CREATE TYPE srb.Strings AS TABLE( text NVARCHAR(MAX) );
GO
CREATE TYPE srb.Integers AS TABLE( val INT );
GO
CREATE TYPE srb.Messages AS TABLE(
sequence_number BIGINT,
data VARBINARY(MAX),
text AS CAST(data AS NVARCHAR(MAX)),
type NVARCHAR(256),
dialog UNIQUEIDENTIFIER,
contract NVARCHAR(256),
validation NCHAR,
service NVARCHAR(512),
service_instance_id UNIQUEIDENTIFIER
);
GO
-- Start Service management
CREATE OR ALTER PROCEDURE srb.create_service_on_queue
@name sysname,
@queue sysname,
@contract sysname = '[DEFAULT]'
AS BEGIN
-- Creates a Service on the existing queue. Will use 'DefaultContact' if the contract is not specified.
DECLARE @sql NVARCHAR(MAX);
SET @sql = CONCAT('CREATE SERVICE ', @name, ' ON QUEUE ', @queue, ' (', @contract, ')');
EXEC(@sql);
END;
GO
CREATE OR ALTER PROCEDURE srb.create_service
@name sysname,
@callback nvarchar(256) = NULL,
@contract sysname = '[DEFAULT]',
@trigger nvarchar(256) = NULL,
@use_transaction bit = 1
AS BEGIN
-- Creates a Service including a new queue. Will use 'DefaultContact' if the contract is not specified.
DECLARE @sql NVARCHAR(MAX);
DECLARE @queue SYSNAME = @name+'Queue';
IF (@callback IS NOT NULL) BEGIN
if( 0 =
(select count(*) from sys.objects o
where (schema_name(o.schema_id) + '.' + object_name(o.object_id)) = @callback)
)
begin
declare @error1 nvarchar(4000) = 'Cannot find procedure ' + @callback;
throw 60001, @error1, 1;
end
-- Checking the signature (parameter types) of callback procedure.
if(
(select count(*)
from sys.parameters p
join sys.objects o
on p.object_id = o.object_id
join sys.types t
on p.system_type_id = t.system_type_id
where (schema_name(o.schema_id) + '.' + object_name(o.object_id)) = @callback
and (
p.parameter_id = 1 and p.user_type_id in (165, 231) -- varbinary, nvarchar
or
p.parameter_id = 2 and p.system_type_id = 231 -- nvarchar, sysname
or
p.parameter_id = 3 and p.system_type_id = 36 -- uniqueidentifier
)) <= 3)
begin
declare @error2 nvarchar(4000) = 'Procedure ' + @callback + ' exists, but it don''t have parameters (varbinary(max), nvarchar, uniqueidentifier)';
throw 60001, @error2, 2;
end
END;
SET @sql = CONCAT('CREATE QUEUE ', @queue, ' WITH STATUS = ON');
EXEC(@sql);
IF (@callback IS NOT NULL OR @trigger IS NOT NULL) BEGIN
DECLARE @msgtype varchar(30) = (select top 1 case t.name when 'xml' then 'xml' else t.name + '(max)' end
from sys.parameters p
join sys.objects o
on p.object_id = o.object_id
join sys.types t
on p.system_type_id = t.system_type_id
where (schema_name(o.schema_id) + '.' + object_name(o.object_id)) = @callback
and parameter_id = 1
and t.user_type_id in (165, 231));
PRINT 'Callback message type is ' + @msgtype;
SET @sql = CONCAT("
CREATE PROCEDURE ",@queue,"ActivationProcedure
AS BEGIN
DECLARE @dialog UNIQUEIDENTIFIER;
DECLARE @msg VARBINARY(MAX);
DECLARE @msg_type sysname;
WHILE (1=1)
BEGIN
",
IIF(@use_transaction=1, "BEGIN TRANSACTION;", "/*No transaction*/")
,"
WAITFOR (
RECEIVE TOP(1)
@dialog = conversation_handle,
@msg = message_body,
@msg_type = message_type_name
FROM ",@queue,"
), TIMEOUT 5000;
IF (@@ROWCOUNT = 0)
BEGIN
",
IIF(@use_transaction=1, "ROLLBACK TRANSACTION;", "/*No transaction*/")
,"
BREAK;
END
IF @msg_type =
N'http://schemas.microsoft.com/SQL/ServiceBroker/DialogTimer'
BEGIN
BEGIN TRY ",
CASE
WHEN @trigger IS NOT NULL THEN
CONCAT("-- Execute a timeout callback and provide message info.
EXEC ", @trigger, " @dialog;")
ELSE CONCAT(" -- Log timeout message
RAISERROR( 'Timeout in service ",@name, "', 6, 1) WITH LOG; ")
END,"
END TRY
BEGIN CATCH
DECLARE @errorTimeout NVARCHAR(MAX) = ( SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS Severity
,ERROR_STATE() AS State
,ERROR_PROCEDURE() AS [Procedure]
,ERROR_LINE() AS Line
,ERROR_MESSAGE() AS [Error]
FOR JSON PATH, WITHOUT_ARRAY_WRAPPER);
RAISERROR( @errorTimeout, 6, 1) WITH LOG;
IF @@TRANCOUNT > 0 BEGIN
ROLLBACK TRANSACTION;
BREAK;
END
END CATCH;
END
ELSE IF @msg_type =
N'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog'
BEGIN
END CONVERSATION @dialog;
END
ELSE IF @msg_type =
N'http://schemas.microsoft.com/SQL/ServiceBroker/Error'
BEGIN
DECLARE @c NVARCHAR(100);
DECLARE @errorMsg NVARCHAR(4000);
SET @c = CAST(@dialog AS NVARCHAR(100));
SET @errorMsg = CAST(@msg AS NVARCHAR(MAX));
RAISERROR (N'Conversation %s was ended with error %s', 6, 1, @c, @errorMsg) WITH LOG;
END CONVERSATION @dialog;
END
ELSE
BEGIN
BEGIN TRY",
CASE
WHEN @callback IS NOT NULL THEN
CONCAT("-- Execute a callback and provide message info.
DECLARE @p ",@msgtype," = CAST(@msg AS ",@msgtype,");
EXEC ", @callback, " @p, @msg_type, @dialog;")
ELSE CONCAT(" -- Log message
RAISERROR( 'Un-processed message in service ",@name, "', 6, 1) WITH LOG; ")
END,"
END TRY
BEGIN CATCH
DECLARE @error NVARCHAR(MAX) = ( SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS Severity
,ERROR_STATE() AS State
,ERROR_PROCEDURE() AS [Procedure]
,ERROR_LINE() AS Line
,ERROR_MESSAGE() AS [Error]
FOR JSON PATH, WITHOUT_ARRAY_WRAPPER);
RAISERROR( @error, 6, 1) WITH LOG;
IF @@TRANCOUNT > 0 BEGIN
ROLLBACK TRANSACTION;
BREAK;
END
END CATCH;
END
IF @@TRANCOUNT > 0
COMMIT TRANSACTION;
END --WHILE 1=1
END");
--PRINT @sql;
EXEC(@sql);
SET @sql = CONCAT("ALTER QUEUE ", @queue, " WITH
ACTIVATION (
STATUS = ON,
PROCEDURE_NAME = ",@queue,"ActivationProcedure,
EXECUTE AS 'dbo',
MAX_QUEUE_READERS = 1)");
--PRINT @sql;
EXEC(@sql);
END -- callback
EXEC srb.create_service_on_queue @name, @queue, @contract;
END
GO
CREATE OR ALTER PROCEDURE srb.drop_service
@name sysname
AS BEGIN
DECLARE @sql NVARCHAR(MAX);
SET @sql = CONCAT('DROP PROCEDURE IF EXISTS ', @name, 'QueueActivationProcedure');
EXEC(@sql);
BEGIN TRY
SET @sql = CONCAT('DROP SERVICE ', @name);
EXEC(@sql);
END TRY BEGIN CATCH END CATCH;
BEGIN TRY
-- @bug: drop it only if exists and if there are no other services on the same queue.
SET @sql = CONCAT('DROP QUEUE ', @name, 'Queue');
EXEC(@sql);
END TRY BEGIN CATCH END CATCH;
END
GO
-- /END Service management.
-- START Dialog/Conversation management.
GO
CREATE OR ALTER FUNCTION srb.get_cached_dialog (
@sender sysname,
@receiver sysname)
RETURNS UNIQUEIDENTIFIER
AS BEGIN
DECLARE @dialog_handle UNIQUEIDENTIFIER = NULL;
SELECT @dialog_handle = conversation_handle
FROM sys.conversation_endpoints ce
JOIN sys.services s ON ce.service_id = s.service_id
WHERE is_initiator = 1
AND ce.far_service = @receiver
AND s.name = @sender;
RETURN (@dialog_handle);
END
GO
CREATE OR ALTER PROCEDURE srb.new_conversation
@conversation_handle UNIQUEIDENTIFIER OUTPUT,
@sender sysname,
@receiver sysname,
@contract sysname = '[DEFAULT]',
@encryption varchar(3) = 'OFF' --> Keep it off unless if you know how to setup master keys.
AS BEGIN
DECLARE @sql NVARCHAR(MAX);
SET @sql = CONCAT(
"BEGIN DIALOG @id
FROM SERVICE [", @sender, "]
TO SERVICE '", @receiver, "'
ON CONTRACT ", @contract,"
WITH ENCRYPTION = ", @encryption);
EXEC sp_executesql @sql, N'@id uniqueidentifier OUTPUT', @id = @conversation_handle OUTPUT;
END
GO
CREATE OR ALTER PROCEDURE srb.ping
@conversation_handle UNIQUEIDENTIFIER,
@delay_s bigint NULL
AS BEGIN
BEGIN CONVERSATION TIMER (@conversation_handle) TIMEOUT = @delay_s;
END
GO
CREATE OR ALTER PROCEDURE srb.start_dialog
@sender sysname,
@receiver sysname,
@contract sysname = '[DEFAULT]',
@encryption varchar(3) = 'OFF' --> Keep it off unless if you know how to setup master keys.
AS BEGIN
DECLARE @dialog UNIQUEIDENTIFIER; -- Just to ignore it.
EXEC srb.new_conversation
@conversation_handle = @dialog OUTPUT,
@sender = @sender,
@receiver = @receiver,
@contract = @contract,
@encryption = @encryption
--PRINT @dialog;
END
GO
CREATE SYNONYM srb.start_conversation FOR srb.start_dialog;
GO
CREATE OR ALTER PROCEDURE srb.trigger_dialog
@from SYSNAME,
@to SYSNAME,
@delay_s bigint NULL
AS BEGIN
DECLARE @dialog UNIQUEIDENTIFIER;
SET @dialog = srb.get_cached_dialog(@from, @to);
IF (@dialog IS NULL) BEGIN
--PRINT 'Verbose: Starting new dialog';
EXEC srb.new_conversation @dialog OUTPUT, @from, @to;
END
--PRINT @dialog;
BEGIN CONVERSATION TIMER (@dialog) TIMEOUT = @delay_s;
END
GO
CREATE OR ALTER PROCEDURE srb.drop_conversation
@conversation_handle UNIQUEIDENTIFIER,
@cleanup bit = 0
AS BEGIN
IF (@cleanup = 0)
END CONVERSATION @conversation_handle;
ELSE
END CONVERSATION @conversation_handle WITH CLEANUP;
END
GO
CREATE SYNONYM srb.drop_dialog FOR srb.drop_conversation;
GO
CREATE SYNONYM srb.delete_dialog FOR srb.drop_conversation;
GO
CREATE SYNONYM srb.delete_conversation FOR srb.drop_conversation;
GO
CREATE OR ALTER PROCEDURE srb.end_dialog
@sender sysname,
@receiver sysname,
@cleanup bit = 0
AS BEGIN
DECLARE @dialog_handle UNIQUEIDENTIFIER;
SET @dialog_handle = srb.get_cached_dialog(@sender, @receiver);
EXEC srb.drop_conversation @dialog_handle, @cleanup;
END
GO
CREATE SYNONYM srb.end_conversation FOR srb.end_dialog;
GO
-- /END Dialog/Conversation management.
CREATE OR ALTER PROCEDURE srb.post_message
@dialog UNIQUEIDENTIFIER,
@message NVARCHAR(MAX)
AS BEGIN
DECLARE @content VARBINARY(MAX) = CAST(@message AS VARBINARY(MAX));
SEND ON CONVERSATION @dialog (@content);
END
GO
CREATE OR ALTER PROCEDURE srb.post_data
@dialog UNIQUEIDENTIFIER,
@data VARBINARY(MAX)
AS BEGIN;
SEND ON CONVERSATION @dialog (@data);
END
GO
CREATE OR ALTER PROCEDURE srb.send_message
@from SYSNAME,
@to SYSNAME,
@message NVARCHAR(MAX)
AS BEGIN
DECLARE @dialog UNIQUEIDENTIFIER;
SET @dialog = srb.get_cached_dialog(@from, @to);
IF (@dialog IS NULL) BEGIN
--PRINT 'Verbose: Starting new dialog';
EXEC srb.new_conversation @dialog OUTPUT, @from, @to;
END
--PRINT @dialog;
DECLARE @content VARBINARY(MAX) = CAST(@message AS VARBINARY(MAX));
SEND ON CONVERSATION @dialog (@content);
END
GO
CREATE OR ALTER PROCEDURE srb.send_data
@from SYSNAME,
@to SYSNAME,
@message VARBINARY(MAX)
AS BEGIN
DECLARE @content VARCHAR(MAX) = CAST(@message AS VARCHAR(MAX));
EXEC srb.send_message @from, @to, @content;
END
GO
CREATE OR ALTER PROCEDURE srb.get_message @service sysname, @message NVARCHAR(MAX) OUTPUT
AS BEGIN
DECLARE @sql NVARCHAR(MAX);
SET @sql = CONCAT("
DECLARE @t srb.Strings;
RECEIVE TOP (1) cast(message_body as nvarchar(max)) as text
FROM ", @service, "Queue
INTO @t;
SELECT @var = text FROM @t;
");
EXEC sp_executesql @sql, N'@var NVARCHAR(MAX) OUTPUT', @var = @message OUTPUT;
END
GO
CREATE OR ALTER PROCEDURE srb.view_messages @service sysname
AS BEGIN
DECLARE @sql NVARCHAR(MAX) = CONCAT('SELECT text = cast(message_body as nvarchar(max)), message_type_name, conversation_handle, message_sequence_number FROM ', @service, 'Queue ORDER BY queuing_order ASC');
EXEC(@sql);
END
GO
CREATE OR ALTER PROCEDURE srb.view_data @service sysname
AS BEGIN
DECLARE @sql NVARCHAR(MAX) = CONCAT('SELECT message_body, message_type_name, conversation_handle, message_sequence_number FROM ', @service, 'Queue ORDER BY queuing_order ASC');
EXEC(@sql);
END
GO
CREATE OR ALTER PROCEDURE srb.get_messages @service sysname, @res srb.Messages READONLY, @count int = 1
AS BEGIN;
DECLARE @sql NVARCHAR(MAX);
SET @sql = CONCAT("
RECEIVE TOP (@N) *
FROM ", @service,"Queue
--INTO @messages
");
EXEC sp_executesql
@sql, --N'@messages srb.Messages OUTPUT,@N int',
N'@N int',
--@messages = @res,
@N = @count
;
END
GO
create or alter procedure
srb.enable_remote_access
-- by convention, 4022 is used but any number between 1024 and 32767 is valid.
@port smallint = 4022,
@start_date datetime = NULL,
@expiry_date datetime = NULL,
@master_password NVARCHAR(200) = NULL,
@remote_login NVARCHAR(200) = 'public',
@what_if bit = 1
as begin
DECLARE @c_start_date VARCHAR(20) = CAST(ISNULL(@start_date, DATEADD(day, -1, GETUTCDATE())) AS VARCHAR(30));
DECLARE @c_expiry_date VARCHAR(20) = CAST(ISNULL(@expiry_date, DATEADD(year, 1, GETUTCDATE())) AS VARCHAR(30));
DECLARe @sql NVARCHAR(MAX);
IF NOT EXISTS(SELECT * FROM master.sys.symmetric_keys WHERE NAME = '##MS_DatabaseMasterKey##')
BEGIN
IF (@master_password IS NULL)
BEGIN
PRINT('-- MASTER KEY is not found in master database!')
PRINT('-- Specify parameter @master_pasword, or')
PRINT('-- Create MASTER KEY in master database:')
PRINT('/*
USE master;')
PRINT('CREATE MASTER KEY ENCRYPTION BY PASSWORD = <Put some <PASSWORD> here>;
*/')
GOTO ErrorLabel
END
ELSE BEGIN
IF (@what_if = 0)
EXEC("USE master;CREATE MASTER KEY ENCRYPTION BY PASSWORD = '"+<PASSWORD>+"'")
ELSE
PRINT("USE master;CREATE MASTER KEY ENCRYPTION BY PASSWORD = '"+<PASSWORD>+"'")
END
END
ELSE
PRINT('-- MASTER KEY exists in master database.')
SET @sql = "USE master;
CREATE CERTIFICATE ServiceBrokerCertificate
WITH
-- BOL: The term subject refers to a field in the metadata of
-- the certificate as defined in the X.509 standard
SUBJECT = 'ServiceBrokerCertificate',
-- set the start date
START_DATE = '"+@c_start_date+"',
-- set the expiry data
EXPIRY_DATE = '"+@c_expiry_date+"'
-- enables the certifiacte for service broker initiator
ACTIVE FOR BEGIN_DIALOG = ON
";
PRINT '-- Creating Service Broker certificate...';
IF @what_if = 0 EXEC(@sql);
ELSE PRINT (@sql);
SET @sql = "USE master;
CREATE ENDPOINT ServiceBrokerEndPoint
-- set endpoint to activly listen for connections
STATE = STARTED
-- set it for TCP traffic only since service broker supports only TCP protocol
AS TCP (LISTENER_PORT = " + CAST(@port AS VARCHAR(6)) +")
FOR SERVICE_BROKER
(
-- authenticate connections with our certificate
AUTHENTICATION = CERTIFICATE ServiceBrokerCertificate,
-- default is REQUIRED encryption but let's just set it to SUPPORTED
-- SUPPORTED means that the data is encrypted only if the
-- opposite endpoint specifies either SUPPORTED or REQUIRED.
ENCRYPTION = SUPPORTED
)";
PRINT '-- Creating Service Broker endpoint...';
IF @what_if = 0 EXEC(@sql);
ELSE PRINT (@sql);
PRINT '-- Enabling login ' + @remote_login + ' to access Service Broker endpoint...';
IF @remote_login IS NOT NULL
IF @what_if = 0
EXEC("USE master;GRANT CONNECT ON ENDPOINT::ServiceBrokerEndPoint TO "+@remote_login+";");
ELSE PRINT("USE master;GRANT CONNECT ON ENDPOINT::ServiceBrokerEndPoint TO "+@remote_login+";")
ErrorLabel:
end
go
CREATE PROCEDURE
srb.remove_remote_access
AS BEGIN
declare @service_broker_endpoint sysname, @certificate_name sysname;
declare @sql nvarchar(max);
select @service_broker_endpoint = sbe.name, @certificate_name = c.name
from sys.service_broker_endpoints sbe
left join master.sys.certificates c on sbe.certificate_id = c.certificate_id
if(@service_broker_endpoint is not null)
begin
set @sql = 'USE master;DROP ENDPOINT ' + @service_broker_endpoint;
exec(@sql);
PRINT '-- Dropped service broker endpoint in master database';
end
else
print '-- ServiceBroker endpoint don''t exists.';
if(@certificate_name is not null)
begin
set @sql = 'USE master;DROP CERTIFICATE ' + @certificate_name;
exec(@sql);
PRINT 'Dropped service broker certificate in master database';
end
else
print 'Certificate for ServiceBroker endpoint don''t exists';
END
GO
-- Procedure that generates script that will initialize login on remote sender instance to access this instance.
-- Make sure that you have enabled remote access on the instances.
CREATE OR ALTER PROCEDURE
srb.init_remote_proxy_login
@login sysname,
@password nvarchar(4000),
@what_if bit = 1
as begin
declare @sql nvarchar(max) = '
USE master;';
-- create the login on remote instance that will be send the data through the Endpoint
set @sql += "CREATE LOGIN "+@login+" WITH PASSWORD = '"+@password+"';
";
-- Create a user for our login
set @sql += "CREATE USER "+@login+"User FOR LOGIN "+@login+";
";
declare @cert_encoded varbinary(max);
--EXEC sp_executesql N'USE master;SELECT @cert = CERTENCODED(certificate_id) from sys.service_broker_endpoints',
-- N'@cert VARBINARY(MAX) OUTPUT',
-- @cert = @cert_encoded OUTPUT;
SELECT @cert_encoded = CERTENCODED(certificate_id)
from mastersys.service_broker_endpoints;
if(@cert_encoded is not null)
set @sql += "CREATE CERTIFICATE "+@login+"ProxyServiceBrokerCertificate
AUTHORIZATION "+@login+"User
FROM BINARY = "+CONVERT(VARCHAR(MAX), @cert_encoded, 1)+";
";
else
print '--> Cannot find the certificate for service endpoint. Run EXEC srb.enable_remote_access'
-- finally grant the connect permissions to login for the endpoint
set @sql += "
go
declare @endpoint_name sysname;
select @endpoint_name = name
from sys.service_broker_endpoints sbe;
-- Enable sender login on remote (sender) instance to connect to sender endpoint:
declare @sql = 'GRANT CONNECT ON ENDPOINT::' +@endpoint_name+ ' TO "+@login+"';
EXEC(sql);
";
PRINT '--> Execute the following script on the remote server instance:'
PRINT @sql
end
GO
-- Initialize route on the sender instance.
CREATE PROCEDURE srb.init_remote_proxy_route
@service SYSNAME,
@address varchar(256) = NULL,
@authorization sysname = 'dbo'
AS BEGIN
declare @sql NVARCHAR(MAX);
with route_info as (
select db_name = DB_NAME(DB_ID()), service_name = @service,
sb_guid = (select service_broker_guid from sys.databases where name = DB_NAME(DB_ID())),
protocol = te.protocol_desc,
server = isnull(ip_address, CAST(serverproperty('servername') as varchar(256))),
port
from sys.service_broker_endpoints sbe
join sys.tcp_endpoints te on sbe.endpoint_id = te.endpoint_id
where sbe.type = 3 -- SERVICE_BROKER
and EXISTS(SELECT * FROM sys.services WHERE name = @service)
)
select @sql = CONCAT("CREATE ROUTE [", server, "/", db_name, "/", service_name , "] AUTHORIZATION [",@authorization,"]
WITH SERVICE_NAME = N'",service_name,"' ,
BROKER_INSTANCE = N'",sb_guid,"' ,
ADDRESS = N'",
ISNULL(@address, CONCAT(protocol,"://",server,":",port)),
"'-- OR 'LOCAL' for intra-instance routes.")
from route_info;
PRINT 'Execute the following script on the remote server instance:'
PRINT @sql
END;
GO
CREATE OR ALTER VIEW srb.conversations AS
SELECT conversation_handle, source = s.name, target = far_service,
target_instance = far_broker_instance, state = state_desc,
target_queue = sq.name,
target_activation_procedure = sq.activation_procedure
FROM sys.conversation_endpoints ce
JOIN sys.services s ON ce.service_id = s.service_id
JOIN sys.service_queues sq ON s.service_queue_id = sq.object_id;
GO
CREATE OR ALTER PROCEDURE srb.kill_all_conversations
AS BEGIN
DECLARE @conversation_handle UNIQUEIDENTIFIER;
DECLARE conversation_cursor CURSOR FOR
SELECT DISTINCT conversation_handle FROM srb.conversations;
OPEN conversation_cursor;
FETCH NEXT FROM conversation_cursor
INTO @conversation_handle;
-- Check @@FETCH_STATUS to see if there are any more rows to fetch.
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC srb.drop_conversation @conversation_handle;
FETCH NEXT FROM conversation_cursor
INTO @conversation_handle;
END
CLOSE conversation_cursor;
DEALLOCATE conversation_cursor;
END
|
<reponame>mollfpr/Connectivly_Laravel
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.5.5-10.2.14-MariaDB)
# Database: connectivly
# Generation Time: 2018-09-23 17:37:55 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table customers
# ------------------------------------------------------------
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'name of the customer',
`email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'email of the customer',
`address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'address of the customer',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `customers_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT INTO `customers` (`id`, `name`, `email`, `address`, `created_at`, `updated_at`)
VALUES
(10,'<NAME>','<EMAIL>','Jalan Cendana Gang 10 No.38 RT.37','2018-09-23 08:10:22','2018-09-23 08:10:22'),
(11,'<NAME>','<EMAIL>','Jalan Cendana Gang 10 No.38 RT.37','2018-09-23 08:19:32','2018-09-23 08:19:32');
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table migrations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` (`id`, `migration`, `batch`)
VALUES
(1,'2014_10_12_000000_create_users_table',1),
(2,'2014_10_12_100000_create_password_resets_table',1),
(3,'2018_09_18_132802_create_products_table',2),
(4,'2018_09_18_132813_create_customers_table',2),
(5,'2018_09_18_132834_create_sales_orders_table',2),
(6,'2018_09_23_100135_add_qty_to_sales_order',3);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table password_resets
# ------------------------------------------------------------
DROP TABLE IF EXISTS `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,
KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
# Dump of table products
# ------------------------------------------------------------
DROP TABLE IF EXISTS `products`;
CREATE TABLE `products` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'code for the product',
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'name for the product',
`price` int(11) NOT NULL DEFAULT 0 COMMENT 'price for the product',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` (`id`, `code`, `name`, `price`, `created_at`, `updated_at`)
VALUES
(4,'R6sTl','barang 1',1000,'2018-09-23 09:57:46','2018-09-23 09:57:46'),
(5,'adGqJ','barang 2',1500,'2018-09-23 09:57:52','2018-09-23 09:57:52'),
(6,'ejz9e','barang 3',3000,'2018-09-23 09:57:58','2018-09-23 09:57:58');
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table sales_orders
# ------------------------------------------------------------
DROP TABLE IF EXISTS `sales_orders`;
CREATE TABLE `sales_orders` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`qty` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `sales_orders_customer_id_foreign` (`customer_id`),
KEY `sales_orders_product_id_foreign` (`product_id`),
CONSTRAINT `sales_orders_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
CONSTRAINT `sales_orders_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `sales_orders` WRITE;
/*!40000 ALTER TABLE `sales_orders` DISABLE KEYS */;
INSERT INTO `sales_orders` (`id`, `customer_id`, `product_id`, `created_at`, `updated_at`, `qty`)
VALUES
(11,10,4,'2018-09-23 17:32:34',NULL,21),
(12,10,5,'2018-09-23 17:32:34',NULL,3),
(13,11,6,'2018-09-23 17:33:10',NULL,3);
/*!40000 ALTER TABLE `sales_orders` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`)
VALUES
(1,'<NAME>','<EMAIL>',NULL,'$2y$10$/mSCr7ETfQLVmfuBGoD9huSrJXitu7l6uR2orExotq9/LuW6MuKOW','m7N9D8AfHB2ai7BGil1NeJ3WBb7aQ99GJd1hSVpPYvit7DI5G0JP6LYIg8uS','2018-09-18 13:22:07','2018-09-18 13:22:07');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<gh_stars>0
--
-- Table structure for table `publicado`
--
DROP TABLE IF EXISTS `publicado`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `publicado` (
`idpublicado` int(11) NOT NULL,
`idrede` int(11) NOT NULL,
`cpf` varchar(11) NOT NULL,
`idsensor` int(11) NOT NULL,
`idtm` int(11) NOT NULL,
`dthrgeracao` varchar(45) NOT NULL,
`dthrenvio` varchar(45) NOT NULL,
`valor` double NOT NULL,
`coverage` double DEFAULT NULL,
`up_to_dateness` double DEFAULT NULL,
`accuracy` double DEFAULT NULL,
`completeness` double DEFAULT NULL,
`significance` double DEFAULT NULL,
`qoc_geral` double DEFAULT NULL,
PRIMARY KEY (`idpublicado`,`idrede`,`cpf`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `publicado`
--
LOCK TABLES `publicado` WRITE;
/*!40000 ALTER TABLE `publicado` DISABLE KEYS */;
/*!40000 ALTER TABLE `publicado` ENABLE KEYS */;
UNLOCK TABLES;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 29 Jan 2019 pada 12.42
-- Versi Server: 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: `db_lf`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_barang`
--
CREATE TABLE `t_barang` (
`id_barang` int(255) NOT NULL,
`id_kota` int(255) NOT NULL,
`id_univ` int(255) NOT NULL,
`id_label` int(255) NOT NULL,
`id_user` int(255) NOT NULL,
`nama_barang` varchar(200) NOT NULL,
`foto_barang` varchar(200) NOT NULL,
`deskripsi` text NOT NULL,
`status_barang` tinyint(1) NOT NULL,
`tanggal_upload` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `t_barang`
--
INSERT INTO `t_barang` (`id_barang`, `id_kota`, `id_univ`, `id_label`, `id_user`, `nama_barang`, `foto_barang`, `deskripsi`, `status_barang`, `tanggal_upload`) VALUES
(15, 1, 1, 2, 11, 'stnk motor yamaha', 'stnk.jpg', 'stnk di temukan di dekat bogaraso', 1, '2019-01-29'),
(16, 1, 3, 1, 11, 'dompet lo<NAME>', 'maxresdefault.jpg', 'dompet merk louis vuitton warna coklat ditemukan dekat kafe double 8 ', 1, '2019-01-29'),
(17, 1, 1, 3, 11, 'kunci motor', 'khonda.jpg', 'kunci motor honda tanpa gantungan, ditemukan di parkiran dago', 1, '2019-01-29'),
(18, 1, 2, 4, 11, 'iphone 5s', '5s.jpg', 'iphone 5s warna putih, ditemukan di jalan ganesha ITB', 1, '2019-01-29'),
(19, 1, 1, 3, 11, 'kunci motor', 'vespa.jpg', 'kunci motor vespa matic, ditemukan di basement b3 unikom', 1, '2019-01-29'),
(20, 1, 2, 3, 11, 'kunci mobil', 'mercy.jpg', 'kunci mobil mercedes benz warna hitam, ditemukan di dekat mesjid salman ITB', 1, '2019-01-29'),
(21, 1, 1, 5, 11, 'SIM motor', 'sim.jpg', 'sim motor atas nama contoh doang, ditemukan dekat mcd simpang dago ', 1, '2019-01-29');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_kota`
--
CREATE TABLE `t_kota` (
`id_kota` int(255) NOT NULL,
`nama_kota` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `t_kota`
--
INSERT INTO `t_kota` (`id_kota`, `nama_kota`) VALUES
(1, 'Bandung Kota'),
(2, 'Bandung Barat'),
(3, 'Bandung Timur'),
(4, 'Kota Cimahi'),
(5, 'Bandung Selatan'),
(6, 'Cimahi Selatan & Utara');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_label`
--
CREATE TABLE `t_label` (
`id_label` int(255) NOT NULL,
`nama_label` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `t_label`
--
INSERT INTO `t_label` (`id_label`, `nama_label`) VALUES
(1, 'dompet'),
(2, 'STNK'),
(3, 'kunci'),
(4, 'handphone'),
(5, 'SIM');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_message`
--
CREATE TABLE `t_message` (
`id_message` int(255) NOT NULL,
`id_user` int(255) NOT NULL,
`id_user_tujuan` int(255) NOT NULL,
`subjek` varchar(25) NOT NULL,
`pesan` text NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '0',
`hapus` tinyint(1) NOT NULL DEFAULT '0',
`waktu` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `t_message`
--
INSERT INTO `t_message` (`id_message`, `id_user`, `id_user_tujuan`, `subjek`, `pesan`, `status`, `hapus`, `waktu`) VALUES
(2, 10, 11, 'Test', 'Tes tis', 1, 0, '2019-01-29 16:28:07'),
(3, 10, 11, 'test', 'testis', 0, 0, '2019-01-29 16:30:30');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_pesan`
--
CREATE TABLE `t_pesan` (
`id_pesan` int(11) NOT NULL,
`nama` varchar(25) NOT NULL,
`email` varchar(30) NOT NULL,
`subjek` varchar(25) NOT NULL,
`pesan` text NOT NULL,
`status` tinyint(1) NOT NULL,
`hapus` tinyint(1) NOT NULL,
`waktu` datetime NOT NULL,
`waktu_delete` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_univ`
--
CREATE TABLE `t_univ` (
`id_univ` int(255) NOT NULL,
`id_kota` int(255) NOT NULL,
`nama_univ` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `t_univ`
--
INSERT INTO `t_univ` (`id_univ`, `id_kota`, `nama_univ`) VALUES
(1, 1, 'Universitas Komputer Indonesia'),
(2, 1, 'ITB'),
(3, 1, 'ITHB');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_user`
--
CREATE TABLE `t_user` (
`id_user` int(255) NOT NULL,
`nik` varchar(16) NOT NULL,
`nama` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`password` varchar(255) NOT NULL,
`alamat` varchar(255) NOT NULL,
`file_foto` varchar(100) DEFAULT NULL,
`file_ktp` varchar(100) DEFAULT NULL,
`status` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `t_user`
--
INSERT INTO `t_user` (`id_user`, `nik`, `nama`, `email`, `password`, `alamat`, `file_foto`, `file_ktp`, `status`) VALUES
(10, 'admin', '<PASSWORD>', '<PASSWORD>', '<PASSWORD>', 'admin', 'avatar.png', NULL, 1),
(11, '10116254', 'Ferri', '<EMAIL>', '<PASSWORD>', 'Cipedes Bandung', 'IMG-20171218-WA0007.png', NULL, 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `t_barang`
--
ALTER TABLE `t_barang`
ADD PRIMARY KEY (`id_barang`),
ADD KEY `id_kota` (`id_kota`),
ADD KEY `id_label` (`id_label`),
ADD KEY `id_user` (`id_user`),
ADD KEY `id_univ` (`id_univ`);
--
-- Indexes for table `t_kota`
--
ALTER TABLE `t_kota`
ADD PRIMARY KEY (`id_kota`);
--
-- Indexes for table `t_label`
--
ALTER TABLE `t_label`
ADD PRIMARY KEY (`id_label`);
--
-- Indexes for table `t_message`
--
ALTER TABLE `t_message`
ADD PRIMARY KEY (`id_message`),
ADD KEY `id_user` (`id_user`);
--
-- Indexes for table `t_pesan`
--
ALTER TABLE `t_pesan`
ADD PRIMARY KEY (`id_pesan`);
--
-- Indexes for table `t_univ`
--
ALTER TABLE `t_univ`
ADD PRIMARY KEY (`id_univ`),
ADD KEY `id_kota` (`id_kota`);
--
-- Indexes for table `t_user`
--
ALTER TABLE `t_user`
ADD PRIMARY KEY (`id_user`),
ADD KEY `id_user` (`id_user`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `t_barang`
--
ALTER TABLE `t_barang`
MODIFY `id_barang` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `t_label`
--
ALTER TABLE `t_label`
MODIFY `id_label` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `t_message`
--
ALTER TABLE `t_message`
MODIFY `id_message` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `t_pesan`
--
ALTER TABLE `t_pesan`
MODIFY `id_pesan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;
--
-- AUTO_INCREMENT for table `t_univ`
--
ALTER TABLE `t_univ`
MODIFY `id_univ` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `t_user`
--
ALTER TABLE `t_user`
MODIFY `id_user` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `t_barang`
--
ALTER TABLE `t_barang`
ADD CONSTRAINT `t_barang_ibfk_1` FOREIGN KEY (`id_kota`) REFERENCES `t_kota` (`id_kota`),
ADD CONSTRAINT `t_barang_ibfk_3` FOREIGN KEY (`id_user`) REFERENCES `t_user` (`id_user`),
ADD CONSTRAINT `t_barang_ibfk_4` FOREIGN KEY (`id_univ`) REFERENCES `t_univ` (`id_univ`) ON DELETE NO ACTION ON UPDATE CASCADE,
ADD CONSTRAINT `t_barang_ibfk_5` FOREIGN KEY (`id_label`) REFERENCES `t_label` (`id_label`) ON DELETE NO ACTION ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `t_message`
--
ALTER TABLE `t_message`
ADD CONSTRAINT `t_message_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `t_user` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `t_univ`
--
ALTER TABLE `t_univ`
ADD CONSTRAINT `t_univ_ibfk_1` FOREIGN KEY (`id_kota`) REFERENCES `t_kota` (`id_kota`) ON DELETE NO ACTION ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
USE tool;
IF OBJECT_ID('StandardizeDate','FN') IS NOT NULL
DROP FUNCTION StandardizeDate;
CREATE FUNCTION dbo.StandardizeDate(@Date VARCHAR(255))
RETURNS DATE
AS
BEGIN
IF @Date = '' SET @Date = NULL
IF tool.dbo.RegexRemove(@Date,'[^0-9]') = '00000000' SET @Date = NULL
ELSE SET @Date = CONVERT(DATE,@Date)
RETURN @Date
END;
|
<filename>znodb/Scripts/import/import.2019.sql
:setvar ZnoYear 2019
:setvar CSV_CODEPAGE 1251
:r .\import_csv.sql
GO
:r .\fill_Data_Parsed.2019.sql
GO
:r .\resolve_duplicated_schools.sql
GO
|
<gh_stars>1-10
CREATE DATABASE CarRental
USE CarRental
CREATE TABLE Categories(
Id BIGINT PRIMARY KEY IDENTITY NOT NULL,
CategoryName NVARCHAR(20) NOT NULL,
DailyRate INT,
WeeklyRate INT,
MonthlyRate INT,
WeekendRate INT
)
CREATE TABLE Cars(
Id BIGINT PRIMARY KEY IDENTITY NOT NULL,
PlateNumber INT NOT NULL,
Manufacturer NVARCHAR(20) NOT NULL,
Model NVARCHAR(20) NOT NULL,
CarYear INT NOT NULL,
CategoryId BIGINT FOREIGN KEY REFERENCES Categories(Id) NOT NULL,
Doors INT NOT NULL,
Picture VARBINARY(MAX),
Condition BIT,
Available BIT NOT NULL,
)
CREATE TABLE Employees(
Id BIGINT PRIMARY KEY IDENTITY NOT NULL,
FirstName NVARCHAR(20) NOT NULL,
LastName NVARCHAR(20) NOT NULL,
Title NVARCHAR(20),
Notes NVARCHAR(20),
)
CREATE TABLE Customers(
Id BIGINT PRIMARY KEY IDENTITY NOT NULL,
DriverLicenceNumber BIGINT NOT NULL,
FullName NVARCHAR(20) NOT NULL,
[Address] NVARCHAR(20) NOT NULL,
City NVARCHAR(20) NOT NULL,
ZIPCode INT,
Notes INT,
)
CREATE TABLE RentalOrders(
Id BIGINT PRIMARY KEY IDENTITY NOT NULL,
EmployeeId BIGINT FOREIGN KEY REFERENCES Employees(Id) NOT NULL,
CustomerId BIGINT FOREIGN KEY REFERENCES Customers(Id) NOT NULL,
CarId BIGINT FOREIGN KEY REFERENCES Cars(Id) NOT NULL,
TankLevel INT NOT NULL,
KilometrageStart INT NOT NULL,
KilometrageEnd INT,
TotalKilometrage INT,
StartDate DATE NOT NULL,
EndDate DATE NOT NULL,
TotalDays INT ,
RateApplied INT,
TaxRate INT,
OrderStatus BIT NOT NULL,
Notes NVARCHAR(30)
)
INSERT INTO Categories(CategoryName)
VALUES
('Coupe'),
('Sedan'),
('Bus')
INSERT INTO Cars(PlateNumber,Manufacturer,Model,Doors,CarYear,CategoryId,Available)
VALUES
(12546,'Seat','Ibiza',4,2015,1,1 ),
(21547,'Audi','A6',5,2016,2,0),
(15412,'Mercedez','Tourizmo',6,2019,3,1)
INSERT INTO Employees(FirstName,LastName)
VALUES
('Petyr','Petrov'),
('Georgi','Georgiev'),
('Ivan','Ivanov')
INSERT INTO Customers(DriverLicenceNumber,FullName,[Address],City)
VALUES
(12546436,'<NAME>','ul, <NAME>','Sofia'),
(21547455,'<NAME>','ul. Skopie','Sofiq'),
(15412223,'<NAME>','ul. <NAME>','Sofia')
INSERT INTO RentalOrders(EmployeeId,CustomerId,CarId,TankLevel,KilometrageStart,StartDate,EndDate,OrderStatus)
VALUES
(1,1,1,5,50000,'05.15.2020','05.21.2020',1),
(1,2,2,7,50000,'05.15.2020','05.21.2020',1),
(2,1,1,5,50000,'05.15.2020','05.21.2020',0)
|
<filename>services/drone_racing/backend/resources/database/migrations/V01__create_users.sql
create table users
(
id serial primary key,
login varchar(100) unique,
password_hash varchar(60),
name varchar(100)
)
|
<gh_stars>1-10
CREATE TABLE targetgroup (
id INT4 NOT NULL PRIMARY KEY,
type VARCHAR(60) NOT NULL,
validfrom TIMESTAMP WITH TIME ZONE,
validto TIMESTAMP WITH TIME ZONE
);
-- Table comment
COMMENT ON TABLE targetgroup IS '{"description": "Target groups", "schemalastupdated": "06/03/2019", "dataversion": 1}';
-- Column comments
COMMENT ON COLUMN targetgroup.id IS '{"label": "Identifier", "description" This wont work: "Unique identifying column"';
COMMENT ON COLUMN targetgroup.type IS '{"label": "Target type", "description": "Target group type"}';
COMMENT ON COLUMN targetgroup.validfrom IS '{"label": "Valid from date" this is broken JSON, "description": "Item valid from date"}';
COMMENT ON COLUMN targetgroup.validto IS '{"label": "Valid to date", "description": "Item valid to date"}';
-- GRANTs
GRANT SELECT ON targetgroup TO ${anonuser};
GRANT SELECT ON targetgroup TO ${serviceuser};
GRANT SELECT ON targetgroup TO ${readonlyuser};
|
ALTER TABLE inventory ADD CONSTRAINT non_negative_stock CHECK (stock >= 0);
|
GO
USE [SoftUni]
GO
SELECT *
FROM [Employees]
WHERE [JobTitle] = 'Sales Representative'
|
<filename>src/test/resources/sql/insert/d5f2e550.sql
-- file:insert_conflict.sql ln:205 expect:true
insert into insertconflicttest values (25, 'Fig') on conflict (fruit) do update set fruit = excluded.fruit
|
<gh_stars>1000+
-- Script: Get-TriggerDDL.sql
-- Description: Return list of DDL triggers at the server level.
-- This must be run with the master database select to get the trigger definition.
SELECT name,
OBJECT_DEFINITION(OBJECT_ID) as trigger_definition,
parent_class_desc,
create_date,
modify_date,
is_ms_shipped,
is_disabled
FROM sys.server_triggers
|
metadata :name => "systemtype",
:description => "Checks system type out of file",
:author => "Mirantis Inc",
:license => "Apache License 2.0",
:version => "6.0.0",
:url => 'http://www.mirantis.com/',
:timeout => 60
action "get_type", :description => "Get the type" do
display :always
output :node_type,
:description => "Type out of file",
:display_as => "Node type"
end
|
SELECT COUNT(1) FROM requerimiento WHERE id = :id
|
CREATE TABLE `lh_group_work` ( `id` int(11) NOT NULL AUTO_INCREMENT, `group_id` int(11) NOT NULL, `group_work_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`)) DEFAULT CHARSET=utf8;
|
-- create helper function to get datatype name given oid
CREATE FUNCTION OidToDataType(@Oid integer)
RETURNS VARCHAR(50)
AS
BEGIN
DECLARE @datatype VARCHAR(50);
SET @datatype = (SELECT typname from pg_type where oid = @Oid);
RETURN @datatype;
END;
GO
-- create helper function to get procedure/table name given oid
CREATE FUNCTION OidToObject(@Oid integer)
RETURNS VARCHAR(50)
AS
BEGIN
DECLARE @object_name VARCHAR(50);
SET @object_name = (SELECT relname from pg_class where oid = @Oid);
IF (@object_name is null)
BEGIN
SET @object_name = (SELECT proname from pg_proc where oid = @Oid);
END
RETURN @object_name
END;
GO
-- create helper function to get collation name given oid
CREATE FUNCTION OidToCollation(@Oid integer)
RETURNS VARCHAR(50)
AS
BEGIN
DECLARE @collation VARCHAR(50);
SET @collation = (SELECT collname from pg_collation where oid = @Oid);
RETURN @collation;
END;
GO
-- Setup some procedures and tables
create procedure syscolumns_demo_proc1 @firstparam NVARCHAR(50) as select 1
GO
create procedure syscolumns_demo_proc2 @firstparam NVARCHAR(50), @secondparam VARCHAR(50) OUT as select 2
GO
create table syscolumns_demo_table (col_a int, col_b bigint, col_c char(10), col_d numeric(5,4))
GO
select name, OidToObject(id), OidToDataType(xtype), typestat, length from sys.syscolumns where name = '@firstparam' or name = '@secondparam' or name = 'col_a' or name = 'col_b' or name = 'col_c' or name = 'col_d' order by OidToObject(id) asc, name
GO
select colid, cdefault, domain, number from sys.syscolumns where name = '@firstparam' or name = '@secondparam' or name = 'col_a' or name = 'col_b' or name = 'col_c' or name = 'col_d' order by OidToObject(id) asc, name
GO
select OidToCollation(collationid), status, OidToDataType(type), prec, scale from sys.syscolumns where name = '@firstparam' or name = '@secondparam' or name = 'col_a' or name = 'col_b' or name = 'col_c' or name = 'col_d' order by OidToObject(id) asc, name
GO
select iscomputed, isoutparam, isnullable, collation from sys.syscolumns where name = '@firstparam' or name = '@secondparam' or name = 'col_a' or name = 'col_b' or name = 'col_c' or name = 'col_d' order by OidToObject(id) asc, name
GO
-- Cleanup
DROP FUNCTION OidToDataType
DROP FUNCTION OidToObject
DROP FUNCTION OidToCollation
DROP PROCEDURE syscolumns_demo_proc1
DROP PROCEDURE syscolumns_demo_proc2
DROP TABLE syscolumns_demo_table
GO
|
<filename>SQL/SQL_exercise_10/10_questions_and_solutions.sql
-- Used SQLite3 for this example
-- 10.1 Join table PEOPLE and ADDRESS, but keep only one address information for each person (we don't mind which record we take for each person).
-- i.e., the joined table should have the same number of rows as table PEOPLE
SELECT
PEOPLE.id, PEOPLE.name, TEMP.address
FROM
PEOPLE
LEFT JOIN
(
SELECT id, MAX(address) as address
FROM ADDRESS
GROUP BY id
)
AS TEMP
ON PEOPLE.id = TEMP.id;
-- 10.2 Join table PEOPLE and ADDRESS, but ONLY keep the LATEST address information for each person.
-- i.e., the joined table should have the same number of rows as table PEOPLE
SELECT
PEOPLE.id, PEOPLE.name, TEMP.address
FROM
PEOPLE
LEFT JOIN
(
SELECT id, address, MAX(updatedate)
FROM ADDRESS
GROUP BY id
)
AS TEMP
ON PEOPLE.id = TEMP.id;
|
<reponame>sjasthi/tandana
-- MySQL dump 10.13 Distrib 5.5.54, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: ics325sp1713
-- ------------------------------------------------------
-- Server version 5.5.54-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `dances`
--
DROP TABLE IF EXISTS `dances`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dances` (
`dance_id` int(11) NOT NULL AUTO_INCREMENT,
`dance_english_name` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`dance_alternate_name` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`dance_telugu_name` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`dance_category` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`dance_origin` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`dance_description` varchar(5000) COLLATE utf8_unicode_ci DEFAULT NULL,
`dance_image_reference` text COLLATE utf8_unicode_ci,
`dance_video_reference` text COLLATE utf8_unicode_ci,
`dance_key_words` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`dance_status` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`artist_images` text COLLATE utf8_unicode_ci NOT NULL,
`links` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`dance_id`),
UNIQUE KEY `dance_id` (`dance_id`)
) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `dances`
--
LOCK TABLES `dances` WRITE;
/*!40000 ALTER TABLE `dances` DISABLE KEYS */;
INSERT INTO `dances` VALUES (1,'For Testing by Kou','Breakdance','బ్రేక్ డాన్సు','Folk','USA','B-boying or breaking, also called breakdancing, is a style of street dance that originated primarily among Puerto Rican and African American youth, many former members of the Black Spades, the Young Spades, and the Baby Spades, during the mid 1970s.[1] Th','https://upload.wikimedia.org/wikipedia/commons/0/01/Breakdance.jpg, http://ttldancespringfieldmo.com/resources/Tagged_Class_Photos/Hip_Hop/BreakDance%20B%20Boy%20Springfield%20mo.jpg','https://www.youtube.com/embed/2oRysW2mm4A, https://www.youtube.com/embed/44kKLeDKIIc','breakdance, bboy, modern, other, usa','Done','assets/artist_images/artist_images.png','https://en.wikipedia.org/wiki/B-boying,\r\nhttps://simple.wikipedia.org/wiki/Breakdance,\r\nhttp://www.dictionary.com/browse/break-dancing,\r\nhttp://www.wikihow.com/Breakdance'),(3,'alaavu gitaalavaaru','','అలావు గీతాలవారు','Folk','','','','','','Submitted','assets/artist_images/edit.png',''),(5,'Lion Dance','Dragon Dance','సింహం నృత్య','Traditional','China','There has been an old tradition in China of dancers wearing masks to resemble animals or mythical beasts since antiquity, and performances described in ancient texts such as Shujing where wild beasts and phoenix danced may have been masked dances.[1][2] In Qin Dynasty sources, dancers performing exorcism rituals were described as wearing bearskin mask,[1] and it was also mentioned in Han Dynasty texts that "mime people" (象人) performed as fish, dragons, and phoenixes.[3][4] However, lion is not native to China, and the Lion Dance therefore has been suggested to have originated outside of China from countries such as India or Persia,[5][6] and introduced via Cental Asia.[7] According to ethnomusicologist <NAME>, the Chinese word for lion itself, shi (獅, written as 師 in the early periods), may have been derived from the Persian word šer.[8] The earliest use of the word shizi meaning lion first appeared in Han Dynasty texts and had strong association with Central Asia (an even earlier but obsolete term for lion was suanni (狻麑 or 狻猊)), and lions were presented to the Han court by emissaries from Central Asia and the Parthian Empire.[9] Detailed descriptions of Lion Dance appeared during the Tang Dynasty and it was already recognized by writers and poets then as a foreign dance, however, Lion dance may have been recorded in China as early as the third century AD where "lion acts" were referred to by a Three Kingdoms scholar <NAME> (孟康) in a commentary on Hanshu.[10][11][12] In the early periods it had association with Buddhism: it was recorded in a Northern Wei text, Description of Buddhist Temples in Luoyang (洛陽伽藍記), that a parade for a statue of Buddha of a temple was led by a lion to drive away evil spirits.[11][13][14] Japanese illustration of a Lion Dance that some argued represents the Tang Dynasty lion dance described by Bai Juyi.[15] The original painting is dated to the Heian period. There were different versions of the dance in the Tang Dynasty. In the Tang court, the lion dance was called the Great Peace Music (太平樂, Taiping yue) or the Lion Dance of the Five Directions (五方師子舞) where five large lions of different colours and expressing different moods were each led and manipulated on rope by two persons, and accompanied by 140 singers.[11][16] In a later account, the 5 lions were described as each over 3 metres tall and each had 12 "lion lads", who may tease the lions with red whisks.[11][17][18] Another version of the lion dance was described by the Tang poet Bai Juyi in his poem "Western Liang Arts" (西凉伎), where the dance was performed by two hu (胡, meaning here non-Han people from Central Asia) dancers who wore a lion costume made of a wooden head, a silk tail and furry body, with eyes gilded with gold and teeth plated with silver as well as ears that moved, a form that resembles today\'s Lion Dance.[11][19][20] By the eighth century, this lion dance had reached Japan. During the Song Dynasty the lion dance was commonly performed in festivals and it was known as the Northern Lion during the Southern Song. The Southern Lion is a later development in the south of China originating in the Guangdong province. There are a number of myths associated with the origin of the Southern Lion: one story relates that the dance originated as a celebration in a village where a mythical monster called Nian was successfully driven away;[7][21] another has it that the Qianlong Emperor dreamt of an auspicious animal while on a tour of Southern China, and ordered that the image of the animal be recreated and used during festivals. However it is likely that the Southern Lion of Guangzhou is an adaptation of the Northern Lion to local myths and characteristics, perhaps during the Ming Dynasty.[22][23]','http://shimworld.files.wordpress.com/2008/01/ccms-liondance-013.jpg, http://www.lansugarden.org/content/CI_events/287/lion-dance-cny__page-header.jpg','https://www.youtube.com/embed/n-0DJzxUdTE, https://www.youtube.com/embed/hJusyaRAq1I','china, dragon dance, lion dance, traditional','Submitted','',''),(7,'Seungmu','','Seungmu','Folk','','','','','','Submitted','assets/artist_images/seungmu.jpg',''),(8,'allaa ke naam paaTalu','','అల్లా కె నాం పాటలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/ఫకీరు_వేషాలు'),(9,'aasaadi kathalu','','ఆసాది కధలు','Folk','','','','','','Submitted','','https://groups.google.com/forum/#!topic/telugupadam/2YK-cJiuQPw, http://www.maganti.org/vyasavali/drpadmanabha/gramadevatalu.html'),(10,'aSva nRutyam','Dummy Horse Dance, గుర్రం ఆట, కీలు గుర్రాలు, Poikkal Kudhirai Aattam (Tamil),','అశ్వ నృత్యం','Folk','','','https://s-media-cache-ak0.pinimg.com/736x/e3/98/f5/e398f58d8067928324280e000f3571ed.jpg,https://s-media-cache-ak0.pinimg.com/564x/c3/ab/9b/c3ab9b4769402d07124bf85e8dc4f6f5.jpg, http://www.rajasthanvisit.com/Images/KachhiGhodidance3.jpg','https://www.youtube.com/embed/sBk6_AswVXA, https://www.youtube.com/embed/w1_iPp6n5zs,https://www.youtube.com/embed/qjC7YZP5pIY,https://www.youtube.com/embed/SNeispY9hrA,https://www.youtube.com/embed/Rw1bJiDH3vM','','Selected','','https://te.wikipedia.org/wiki/గొంతాలమ్మ_అశ్వనృత్యం'),(12,'bairaagi tatvaalu','','బైరాగి తత్వాలు','Folk','','','','','','Submitted','',''),(13,'baala paMtulu','','బాలపంతులు','Folk','','','','','','Submitted','',''),(14,'baTraajulu','భట్రాజులు','బట్రాజులు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/భట్రాజు_పొగడ్తలు'),(15,'bayakāni kadha ','','బయకాని కధ','Folk','','','','','','Submitted','',''),(16,'byalaaTa','బయలు నాటకం','బయలాట ','Folk','','','','','','Submitted','',''),(17,'bayaniiLLu','బైండ్లవారు','బయనీళ్ళు','Folk','','','','https://www.youtube.com/embed/4UQTB2Ooq5E','','Submitted','','https://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/బవనీలే_బైండ్లవారు'),(18,'Bharatanatyam','Bharathanatiyam','భరతనాట్యం','Folk','India','The theoretical foundations of Bharatanatyam are found in Natya Shastra, the ancient Hindu text of performance arts.[5][17][18]\r\n\r\nNatya Shastra is attributed to the ancient scholar Bharata Muni, and its first complete compilation is dated to between 200 BCE and 200 CE,[19][20] but estimates vary between 500 BCE and 500 CE.[21] The most studied version of the Natya Shastra text consists of about 6000 verses structured into 36 chapters.[19][22] The text, states Natalia Lidova, describes the theory of Tāṇḍava dance (Shiva), the theory of rasa, of bhāva, expression, gestures, acting techniques, basic steps, standing postures – all of which are part of Indian classical dances.[19][23] Dance and performance arts, states this ancient text,[24] are a form of expression of spiritual ideas, virtues and the essence of scriptures.[25]\r\n\r\nMore direct historical references to Bharatnatyam is found in the Tamil epics Silappatikaram (~2nd century CE[26]) and Manimegalai (~6th century).[5][8] The ancient text Silappatikaram, includes a story of a dancing girl named Madhavi; it describes the dance training regimen called Arangatrau Kathai of Madhavi in verses 113 through 159.[26] The carvings in Kanchipuram\'s Shiva temple that have been dated to 6th to 9th century CE suggest Bharatanatyam was a well developed performance art by about the mid 1st millennium CE.[5][8][27]\r\nLeft: 7th century Shiva in Karnataka;\r\nRight: Bharatanatyam pose\r\n\r\nA famous example of illustrative sculpture is in the southern gateway of the Chidambaram temple (~12th century) dedicated to Hindu god Shiva, where 108 poses of the Bharatnatyam, that are also described as karanas in the Natya Shastra, are carved in stone.[28][29]\r\n\r\nMany of the ancient Shiva sculptures in Hindu temples are same as the Bharata Natyam dance poses. For example, the Cave 1 of Badami cave temples, dated to 7th-century,[30] portrays the Tandava-dancing Shiva as Nataraja.[31][32][33] The image, 5 feet (1.5 m) tall, has 18 arms in a form that expresses the dance positions arranged in a geometric pattern.[33] The arms of Shiva express mudras (symbolic hand gestures),[34] that are found in Bharatanatyam.[5][35]\r\n\r\nBharatanatyam, state Allen Noble and Ashok Dutt, has been "a major source of inspiration to the musicians, poets, painters, singers and sculptors" in Indian history.[36]\r\nDevadasis, anti-dance movement, colonial ban and the decline\r\n\r\nSome colonial Indologists and modern authors have stated Bharatanatyam is a descendant of an ancient Devadasi (literally, servant girls of Deva temples) culture, suggesting historical origins to 300 BCE to 300 CE.[37] Modern scholarship has questioned this theory for lack of any direct textual or archeological evidence.[38][39] Historic sculpture and texts do describe and project dancing girls, as well as temple quarters dedicated to women, but they do not state them to be courtesans and prostitutes alleged by early colonial Indologists.[37] According to <NAME>, a critical examination of evidence suggest that the courtesan dancing is a modern era phenomena, which began in late 16th or 17th century of the Nayaka period of Tamil Nadu.[37] According to <NAME>, Bharatanatyam remained exclusive to Hindu temples through the 19th century, and it appeared on stage outside the temples only in the 20th century.[8]\r\nRukmini Devi Arundale helped revive Bharatanatyam, after all Hindu temple dancing was banned by the British colonial government in 1910.\r\n\r\nWith the arrival of colonial East India Company officials rule in the 18th century, and the establishment of British colonial rule in 19th, many classical Indian dance forms were ridiculed and discouraged, and these performance arts declined.[40] Christian missionaries and British officials presented "nautch girls" of north India (Kathak) and "devadasis" of south India (Bharatanatyam) as evidence of "harlots, debased erotic culture, slavery to idols and priests" tradition, and Christian missionaries demanded that this must be stopped, launching the "anti-dance movement" in 1892.[41][42][43] The anti-dance camp accused the dance form as a front for prostitution, while revivalists questioned the constructed histories by the colonial writers.[38][39]\r\n\r\nIn 1910, the Madras Presidency of the British Empire altogether banned temple dancing, and with it the Bharatanatyam tradition within Hindu temples.[11]\r\nPost colonial era: revival and rebirth\r\n\r\nThe 1910 ban triggered powerful protests against the stereotyping and dehumanization of temple dancers.[11] The Tamil people were concerned that a historic and rich dance tradition was being victimized under the excuse of social reform.[11][44] The classical art revivalists such as <NAME>, a lawyer and someone who had learnt the Bharatanatyam dance, questioned the cultural discrimination and the assumed connection, asking why prostitution needs years of learning and training for performance','http://www.jwalarejimon.com/admin/images/slider/21.jpg, http://www.culturalindia.net/iliimages/Bharatanatyam-1_1.jpg','https://www.youtube.com/embed/SgiLOzFQh14','classical, bharatanatyam, Bharathanatiyam','Done','','https://te.wikipedia.org/wiki/భరతనాట్యం'),(19,'Bihu','','బిహు','Folk','India','బిహూ నృత్యం (Bihu Dance) ఈశాన్య భారత దేశములో గల అస్సాం రాష్ట్రమునకు చెందిన జానపద నృత్య రీతి. ఈ వినోద నృత్యంలో నాట్యకారులు సంప్రదాయమైన అస్సామీ పట్టు, ముగా పట్టు దుస్తులు ధరిస్తారు. బిహూ పాటలకు అనుగుణంగా బిహూ నృత్యాన్ని చేస్తారు. బిహూ పాటలు అస్సామీ కొత్త సం','http://www.nelive.in/sites/default/files/12-04-16%20Jorhat-%20Bihu%20dance%20(1)_0.JPG, http://files.prokerala.com/gallery/pics/800/bihu-dancers-in-traditional-attire-performing-9743.jpg,http://www.bihufestival.org/img/Bihu-mobile-banner.jpg,http://www.vo','https://www.youtube.com/watch?v=_UVSMgaVjJE,https://www.youtube.com/watch?v=8qWgkOFaGqk','Bihu, Assam, Folk','In Progress','','https://te.wikipedia.org/wiki/బిహూ_నృత్యం'),(20,'biirannalu ','','బీరన్నలు','Folk','','','','','','Submitted','','http://10tv.in/tags/beeranna-bonalu'),(24,'buDabukkala vaaru','','బుడుబుక్కల వారు','Folk','','','http://img.sakshi.net/images/cms/2015-01/81420921211_Unknown.jpg,','https://www.youtube.com/embed/OZACsTPgX1E,https://www.youtube.com/embed/NuRyRFUdQeY,https://www.youtube.com/embed/l32NTivJqeA,https://www.youtube.com/embed/NbE3oNI9Rjg','','Selected','','http://telugubhasha.in/saahithyam/janapadha_budabukkala.php'),(25,'burra katha','ఒగ్గు కథ, బుర్ర కథ, జంగం కథ, తందాన కథ, తంబుర కథ, శారద కథ','బుర్ర కథ','Folk','AP, India','burra katha is from India','https://www.indianholiday.com/photo-gallery/andhra-pradesh/tourism--andhra/art-and-crafts/dances-of-andhra-pradesh/Burrakatha-2065.jpg,http://1.bp.blogspot.com/_Wsvv95vvWkI/S81bbfUwTfI/AAAAAAAAAD0/0e0Pcf81Ni4/s1600/Burra+Katha+Dancers+MedShot.jpg,\r\nhttps://i.ytimg.com/vi/AQU9IlTPl5w/0.jpg,\r\nhttps://upload.wikimedia.org/wikipedia/te/2/28/Burrakata_kalaakaarulu.JPG','https://www.youtube.com/embed/r3OrWpoAMLs','','Done','','https://en.wikipedia.org/wiki/Burra_katha, https://te.wikipedia.org/wiki/బుర్రకథ ,\r\nhttp://www.andhrabharati.com/vachana/vyAsamulu/buRRakatha.html,\r\nhttp://telugubhasha.in/saahithyam/janapadha_Burrkatha.php'),(27,'Capoeira','','కాపోయిరా','Folk','Brazil','Capoeira (Portuguese pronunciation: [kapuˈejɾɐ]) is a Brazilian martial art that combines elements of dance,[1][2][3] acrobatics[4] and music.[5][6] It was developed in Brazil mainly by Angolans, at the beginning of the 16th century. It is known for its quick and complex maneuvers, predominantly using power, speed, and leverage across a wide variety of kicks, spins and techniques. The most widely accepted origin of the word capoeira comes from the Tupi words ka\'a ("jungle") e pûer ("it was")[citation needed], referring to the areas of low vegetation in the Brazilian interior where fugitive slaves would hide. A practitioner of the art is called a capoeirista (Portuguese pronunciation: [kapuejˈɾistɐ]). On 26th November 2014 capoeira was granted a special protected status as "intangible cultural heritage" by UNESCO.[7]','http://capoeira-connection.com/capoeira/wp-content/uploads/2011/10/capoeira-contemporanea.jpg','https://www.youtube.com/embed/Z8xxgFpK-NM','capoeira, folk, brazil','Submitted','',''),(28,'chekka bhajana ','chirutala bhajana','చెక్క భజన, చిరుతల భజన','Folk','','NOTES: Same as చిరుతల రామాయణం (ఈ బ్రందాలు, చెక్క భజనతో, రామాయణం మాత్రమే చెబుతారు గనుక)','http://www.sssbpt.org/images/Hyd18Feb2012_01.jpg,https://shinylekhana.files.wordpress.com/2015/03/cvc_9236.jpg,http://www.nrityanjali.org/images/th_chek.jpg,https://shinylekhana.files.wordpress.com/2015/03/cvc_9213.jpg,\r\nhttps://shinylekhana.files.wordpress.com/2015/03/cvc_9226.jpg','https://www.youtube.com/embed/90TDM9DvfFs,\r\nhttps://www.youtube.com/embed/VQcAGEsFdo8,https://www.youtube.com/embed/VqTgkc_ngAA,https://www.youtube.com/embed/rpO7Js7vQDA','','Submitted','','https://te.wikipedia.org/wiki/చెక్క_భజన'),(29,'cheMchu Bhaagavathulu','','చెంచు భాగవతులు','Folk','','','','','','Submitted','','http://www.navatelangana.com/article/jaatara/174496'),(30,'cheMchu nRtyaalu','','చెంచు నృత్యాలు','Folk','','','','','','Submitted','',''),(31,'chaya naaTika','','ఛాయ నాటిక','Folk','','','','','','Submitted','',''),(32,'chiMdu bhaagavatulu','','చిందు భాగవతులు','Folk','','','http://urmilamohan.com/blog/2015/08/bose/image8.jpg,\r\nhttp://www.navatelangana.com/mm/20151026//144588312811.jpg','https://www.youtube.com/embed/Ew8RIQMaGBc,\r\nhttps://www.youtube.com/embed/PMTcVmQmkb8,\r\nhttps://www.youtube.com/embed/UeXbflSHSEs','','Submitted','','https://te.wikipedia.org/wiki/చిందు_భాగవతము ,\r\nhttp://m.navatelangana.com/article/jaatara/137301'),(33,'chiratala raamaayanaM','','చిరతల రామాయణం','Folk','','','https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Bajana_at_Hyd_book_fair.JPG/440px-Bajana_at_Hyd_book_fair.JPG, https://i.ytimg.com/vi/VkeNEgXXXhk/maxresdefault.jpg,\r\nhttps://upload.wikimedia.org/wikisource/te/thumb/c/c4/TeluguVariJanapadaKalarupalu.djvu/page512-3091px-TeluguVariJanapadaKalarupalu.djvu.jpg','https://www.youtube.com/embed/47fOKQZoGi8,\r\nhttps://www.youtube.com/embed/diOw4lfihTM,\r\nhttps://www.youtube.com/embed/eN-TGWjOJnE,','','Submitted','','http://www.navatelangana.com/article/jaatara/425138, https://te.wikipedia.org/wiki/చిరుతల_రామాయణం'),(34,'chitrakathaa vidhaanaM','','చిత్రకధా విధానం','Folk','','','','','','Submitted','',''),(35,'golla kalaapam','చోడిగాని కలాపం, chooDigaani kalaapaM','గొల్ల కలాపం','Folk','','','','','','Submitted','','https://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/చూడచక్కని_చోడిగాని_కలాపం'),(36,'chuTTu kaamuDU','','చుట్టుకాముడు','Folk','','','http://img.sakshi.net/images/cms/2016-07/81468955638_625x300.jpg','','','Submitted','','http://www.sakshi.com/news/district/chuttukamudu-in-raghunadhapuram-364325, https://te.wikipedia.org/wiki/చుట్టకాముడు'),(37,'daadinamma veeshaM','','దాదినమ్మ వేషం','Folk','','','','','','Submitted','',''),(38,'Dakkali kathalu','','డక్కలి కధలు','Folk','','','','','','Submitted','',''),(39,'daMDaa gaanaM','','దండా గానం','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/దండిగా_ప్రచారమైన_దండా_గానం'),(40,'Dappula kolaaTa nRtyaM','','డప్పుల కోలాట నృత్యం','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/డప్పుల_నృత్యం'),(41,'Dappulavaaru','','డప్పులవారు','Folk','','','','','','Submitted','',''),(42,'daasarulu','','దాసరులు','Folk','','','','','','Submitted','','http://www.navatelangana.com/article/jaatara/460780'),(43,'deevara peTTe','','దేవర పెట్టె','Folk','','','','','','Submitted','',''),(44,'dommaraaTalu','','దొమ్మరాటలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/దొమ్మరి_ఆటలు'),(45,'duulaanRtyaM','','దూలానృత్యం','Folk','','','','','','Submitted','',''),(46,'erukala daasari','','ఎరుకల దాసరి','Folk','','','','','','Submitted','',''),(47,'erukala paaTalu','','ఎరుకల పాటలు','Folk','','','','','','Submitted','',''),(48,'erukala soodi','','ఎరుకల సోది','Folk','','','https://c1.staticflickr.com/1/139/366082620_1e0021ef1e.jpg,https://c1.staticflickr.com/1/175/366082621_23e2cb557f_z.jpg?zz=1','https://www.youtube.com/embed/VPY7PzMnJ94','','Done','','https://te.wikipedia.org/wiki/సోది'),(50,'gaMgireddulavaaru','','గంగిరెద్దులవారు','Folk','','','https://upload.wikimedia.org/wikipedia/te/thumb/6/68/Gangireddu_01.JPG/440px-Gangireddu_01.JPG, https://upload.wikimedia.org/wikipedia/te/thumb/1/1d/GANGIREDDU.jpg/500px-GANGIREDDU.jpg,\r\nhttps://c1.staticflickr.com/9/8212/8306719948_0385dc3053_b.jpg,\r\nhttps://c1.staticflickr.com/3/2593/4271298823_d9b71f19d7_b.jpg,\r\nhttp://formsofdevotion.org/wp-content/uploads/2015/11/1426489789_mohammed-osman.jpg,\r\nhttps://www.indianartideas.in/photo/201412031335550204223001417593955.jpg','https://www.youtube.com/embed/DwXZ14XzODE;\r\nhttps://www.youtube.com/embed/G44Z_vx4EBk;\r\nhttps://www.youtube.com/embed/y2owXpfo7vU;\r\nhttps://www.youtube.com/embed/ECEV1iDOwUI','','Submitted','','https://te.wikipedia.org/wiki/గంగిరెద్దులాటలు , \r\nhttp://telugubhasha.in/saahithyam/janapadha_gangireddu.php'),(51,'gaMTaa saayibulu','','గంటా సాయబులు','Folk','','','','','','Submitted','',''),(52,'gaMTi bhaagavatulu','','గంటి భాగవతులు','Folk','','','','','','Submitted','',''),(53,'gaaraDii vidyalu','','గారడీ విద్యలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/గారడీ_విద్యలు'),(54,'garaga nRtyaM','','గరగ నృత్యం','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/గరగ_నృత్యం , http://www.navatelangana.com/article/jaatara/270860'),(55,'ghaMTa nRtyaM','','ఘంట నృత్యం','Folk','','','','','','Submitted','',''),(56,'golla bhaagavatulu','','గొల్ల భాగవతులు','Folk','','','','','','Submitted','',''),(57,'golla daasarulu','','గొల్ల దాసరులు','Folk','','','','','','Submitted','',''),(58,'golla suddulu','','గొల్ల సుద్దులు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/గొల్లసుద్దులు'),(59,'goMDalavaaru','','గొండలవారు','Folk','','','','','','Submitted','',''),(60,'gఊMDU nRtyaM','','గోండు నృత్యం','Folk','','','','','','Submitted','','http://www.visalaandhra.com/regional/article-20701'),(61,'gupppaDi','ulannaaru, ఉలన్నారు','గుప్పాడి ','Folk','','','','','','Submitted','',''),(62,'guruvayyalu ','','గురువయ్యలు','Folk','','','','','','Submitted','',''),(63,'haribhajanalu','','హరిభజనలు','Folk','','','','','','Submitted','',''),(64,'harihaaripadaalu','','హరిహారీపదాలు','Folk','','','','','','Submitted','',''),(65,'hari kadha ','','హరి కధ','Folk','','','http://www.thehansindia.com/assets/8244_harikatha.jpg,http://news.tirumala.org/wp-content/uploads/2014/08/Harikatha1.jpg,https://c1.staticflickr.com/1/66/174664443_99948d6fba_z.jpg?zz=1','https://www.youtube.com/embed/dVVvdyzLiTA, https://www.youtube.com/embed/adscsXtnnJ0,https://www.youtube.com/embed/qsnJpgmJizQ,https://www.youtube.com/embed/JO-aa4UT4WQ','','Selected','','http://www.andhrabharati.com/vachana/vyAsamulu/harikatha.html, https://te.wikipedia.org/wiki/హరికథ,\r\nhttp://telugubhasha.in/saahithyam/janapadha_Harikadha.php'),(66,'iidela nRtyaM','','ఈదెల నృత్యం','Folk','','','','','','Submitted','',''),(67,'jaDa koolaaTam','జడకొప్పు కోలాటం, జడగొప్పు కోలాటం, కోలాటం','జడ కోలాటం','Folk','','Also see koolaTaM','http://www.idlebrain.com/images5/50days-mithunam5.jpg, \r\nhttps://i.ytimg.com/vi/sZ4DuOoZz00/hqdefault.jpg,\r\nhttps://static.wixstatic.com/media/b67558_5de5861b9bf64ae3b6f7067aa0fb1742.jpg_srz_400_338_85_22_0.50_1.20_0.00_jpg_srz,\r\nhttps://i.ytimg.com/vi/neCqCuB2WDw/maxresdefault.jpg','https://www.youtube.com/embed/-riKBKA095M, https://www.youtube.com/embed/a-yAfGwK8PQ','','Submitted','','https://te.wikipedia.org/wiki/కోలాటం'),(68,'jakkula kadhalu ','','జక్కుల కధలు','Folk','','','','','','Submitted','',''),(69,'jaamBa puraaNaM','goosaMgi vEShaM, గోసంగి వేషం, డక్కలి, Dakkali','జాంబ పురాణం','Folk','','జాంబ పురాణాన్ని చిందు భాగవతులు గోసంగి వేషం కట్టి సంవాద రూపంలో ప్రదర్శిస్తారు.','http://pustakam.net/wp-content/uploads/2014/05/jambapuranam-689x1024.jpg,\r\nhttps://upload.wikimedia.org/wikipedia/te/thumb/4/4e/1375921_653743761324333_1210989073_n.jpg/400px-1375921_653743761324333_1210989073_n.jpg,\r\nhttp://pustakam.net/wp-content/uploads/2016/06/AKP3-e1467118182401-300x472.jpg','https://www.youtube.com/embed/35UYBqhVB7E,\r\nhttps://www.youtube.com/embed/j4J9Ef9c29Q','','Submitted','','http://pustakam.net/?p=19183,\r\nhttps://te.wikipedia.org/wiki/కుల_పురాణాలు'),(70,'jamukula kadha ','జక్కుల కథ, బుడికి పాట, బుణికి పాట, బోనుల పాట, బోనుల కథ, బుడికి కథ, టమక్ టమా, బుడబుక్కల పాట','జముకుల కధ','Folk','','','https://i1.ytimg.com/vi/L41zrzjSdC0/hqdefault.jpg,\r\nhttps://i.ytimg.com/vi/k9xrGZ9Qpvg/hqdefault.jpg','https://www.youtube.com/embed/k9xrGZ9Qpvg','','Submitted','','https://te.wikipedia.org/wiki/జముకుల_కథలు , http://kalingaseema.blogspot.in/search?q=జముకుల+కధ+'),(71,'jaMgaM kathalu','బుడిగే జంగాలు, బుడ్గి జంగాలు, బేడ జంగాలు','జంగం కధలు','Folk','','','https://upload.wikimedia.org/wikipedia/te/thumb/6/60/Jamgam_devara_1.JPG/300px-Jamgam_devara_1.JPG,\r\nhttps://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Jamgam_devara_two.JPG/440px-Jamgam_devara_two.JPG','https://www.youtube.com/embed/jKJ9DMJr3vs,\r\nhttps://www.youtube.com/embed/HWOgqqTQ_NE,\r\nhttps://www.youtube.com/embed/XdpFqYuvRGE','బుడిగ','Submitted','','http://kalingaseema.blogspot.in/search?q=జంగం+కధలు ,\r\nhttps://te.wikipedia.org/wiki/బుడిగె_జంగాలు'),(72,'jaMtara maMtara peTTe','','జంతర మంతర పెట్టె','Folk','బొమ్మల బండి','','http://3.bp.blogspot.com/-UZsGyRHBf8Y/VGsFo6vLfRI/AAAAAAAAJww/1jZ0pQqSgnY/s1600/DSC_0072.JPG,\r\nhttp://c8.alamy.com/comp/B9B2E7/man-standing-with-a-bioscope-new-delhi-india-B9B2E7.jpg,\r\nhttps://media-cdn.tripadvisor.com/media/photo-s/07/66/4d/6e/surajkund-lake.jpg,','https://www.youtube.com/embed/_2O0IzXsxz0,\r\nhttps://www.youtube.com/embed/z0NFVCPzMhw,\r\nhttps://www.youtube.com/embed/45FlS-oIYNQ','','Submitted','','https://te.wikipedia.org/wiki/జంతర_మంతర_పెట్టె'),(73,'jeegaMTa bhaagavatulu','','జేగంట భాగవతులు','Folk','','','','','','Submitted','',''),(74,'kaaki paDagalu','','కాకి పడగలు','Folk','','','','','','Submitted','',''),(75,'kaMjara katha','','కంజర కథ','Folk','','','','','','Submitted','',''),(76,'karyaali','kavvaali, కవ్వాలి','కర్యాలి ','Folk','','','','','','Submitted','',''),(78,'kathak ','','కథక్','Classical','India','A dance of northern India, Kathak is often a dance of love. It is performed by both men and women. The movements include intricate footwork accented by bells worn around the ankles and stylized gestures adapted from normal body language. It was originated','https://www.vadaamalar.com/media/catalog/product/cache/1/thumbnail/600x/9df78eab33525d08d6e5fb8d27136e95/k/a/kathak_costume006.jpg','https://www.youtube.com/embed/1ZmCmQjoehw','kathak, classical, india','','',''),(79,'kathaakaLi','','కథాకళి','Classical','India','Kathakali comes from southwestern India, around the state of Kerala. Like bharatanatyam, kathakali is a religious dance. It draws inspiration from the Ramayana and stories from Shaiva traditions. Kathakali is traditionally performed by boys and men, even','http://www.culturalindia.net/iliimages/Kathakali-1.jpg, https://www.keralatourism.org/images/artforms/large/kathakali20131111114431_15_2.jpg','https://www.youtube.com/embed/Tl3UKV1z9lM','','Submitted','',''),(80,'kaaTi paapala vaaLLu','కాటి పాపలు, కాటి కాపరి,','కాటి పాపల వాళ్ళు','Folk','','','https://upload.wikimedia.org/wikipedia/commons/9/97/Katipapalu3.jpg, \r\nhttps://i.ytimg.com/vi/QHwXDfM2Dr0/hqdefault.jpg,\r\nhttps://upload.wikimedia.org/wikipedia/commons/b/bb/Katipapalu1.jpg,http://akamai.vidz.zeecdn.com/zeecinemalu/2016/11/hari-18.jpg','https://www.youtube.com/embed/9pOIEgwztj8','','Submitted','','https://te.wikipedia.org/wiki/కాటిపాపల ,'),(81,'kinnera katha','','కిన్నెర కథ','Folk','','','','','','Submitted','',''),(82,'koola saMbaraM','','కోల సంబరం','Folk','','','','','','Submitted','',''),(83,'koolaaTa nRtyaM','','కోలాట నృత్యం','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/కోలాటం , http://telugubhasha.in/saahithyam/janapadha_kolatam.php'),(84,'koravaMji kathalu','','కొరవంజి కథలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/కురవంజి'),(85,'kOTakoMDa bhaagavatulu','','కోటకొండ భాగవతులు','Folk','','','','','','Submitted','','https://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/కూచిపూడి_వారసులే_కోటకొండ_భాగవతులు'),(86,'kooya nRtyaM','','కోయ నృత్యం','Folk','','','','','','Selected','','http://www.navatelangana.com/article/jaatara/538985'),(87,'kuppaM bhaagOtaM','tapasmaan, తపస్మాన్','కుప్పం భాగోతం ','Folk','','','','','','Submitted','',''),(88,'lambaaDi nRtyaM','Tribal Dance','లంబాడి నృత్యం','Folk','','','https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Lambadi_ei01-40.jpg/640px-Lambadi_ei01-40.jpg,\r\nhttps://4.bp.blogspot.com/-N8GgJcnTZVE/V8orny2AoGI/AAAAAAAACIk/mDgsJA4GcroaM0ZL8k1TkDwht5huQ_LPwCLcB/s1600/a72b09392e600e52e4784bce4942ba97.jpg,\r\nhttp://anubimb.com/wp-content/uploads/2009/12/lambadi-women.jpg,\r\nhttp://images.guidetrip.com/images/uploads/experiences/18459/2502431101_6d8e52ae02_b.jpg','https://www.youtube.com/watch?v=V1Ok-G5ed2g,\r\nhttps://www.youtube.com/watch?v=dpba3REAOLs','','Submitted','',''),(89,'maala bhaagavatulu','','మాలభాగావతులు','Folk','','','','','','Submitted','',''),(90,'maala daasarlu','','మాలదాసర్లు','Folk','','','','','','Submitted','',''),(91,'maala jaMgaalu','','మాలజంగాలు','Folk','','','','','','Submitted','',''),(92,'maMda hechchulu','మంచెంచులు, మంద హెచ్చు కధలు','మందహెచ్చులు','Folk','','','https://i.ytimg.com/vi/Km6VYwqWvd8/hqdefault.jpg,','https://www.youtube.com/embed/ZB9cREYH57g, https://www.youtube.com/embed/Km6VYwqWvd8','','Submitted','','https://www.ntnews.com/Editorial-News-in-Telugu/జానపద-పట్టుకుచ్చులు-మందెచ్చులు-1-7-489757.html ,\r\nhttp://kavithagalam.blogspot.com/2013/09/blog-post_1916.html'),(93,'marida pichchulu ','','మరిదపిచ్చులు','Folk','','','','','','Submitted','',''),(94,'muukaabhinayaM','','మూకాభినయం','Folk','','','','','','Submitted','',''),(95,'nakka jaMgaalu','','నక్కజంగాలు','Folk','','','','','','Submitted','',''),(96,'nakkala bhaagootaM','','నక్కల భాగోతం','Folk','','','','','','Submitted','',''),(97,'odissi','','ఒడిస్సీ','Classical','India','Odissi is indigenous to Orissa in eastern India. It is predominantly a dance for women, with postures that replicate those found in temple sculptures. Based on archaeological findings, odissi is belived to be the oldest of the surviving Indian classical d','http://mycitylinks.in/mycitylive/wp-content/uploads/2016/05/Dona-Ganguly-Egypt-Odissi-Dance.jpg, http://www.ananyadancetheatre.org/wp-content/uploads/2013/01/Odissi-Dance.jpg','https://www.youtube.com/embed/52bscmW8x80','odissi, india, classical','','',''),(98,'oggu katha','','ఒగ్గు కథ','Folk','','QUESTION: are ఒగ్గు కథ & ఒగ్గు డోలు same?','https://i.ytimg.com/vi/k6h_jTyC2f0/maxresdefault.jpg,\r\nhttp://10tv.in/sites/default/files/Screenshot%20from%202016-07-30%2021%3A40%3A52.png,','https://www.youtube.com/embed/k6h_jTyC2f0','','Submitted','','https://te.wikipedia.org/wiki/ఒగ్గు_కథ ,\r\nhttps://en.wikipedia.org/wiki/Oggu_Katha'),(99,'pagaTi veeShagaaLLU','పైటేషాలు, bahuruupulu, బహురూపులు, బైరప్పలు, పగటి వేషం','పగటి వేషగాళ్ళు','Folk','','','https://upload.wikimedia.org/wikipedia/te/thumb/5/59/DSCN3667.JPG/500px-DSCN3667.JPG,http://www.trjks.in/artforms/pagativeshagallu.jpg,https://i.ytimg.com/vi/wfakZRSF4Z8/hqdefault.jpg,','https://www.youtube.com/embed/wfakZRSF4Z8,https://www.youtube.com/embed/6wyvVCOd_4c','','Submitted','','http://m.dailyhunt.in/news/india/telugu/navatelangana-epaper-navatel/bahurupulu-newsid-49163720,\r\nhttps://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/ప్రజలకు_నచ్చిన_పగటి_వేషాలు ,\r\nhttps://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/పగటి_వేషధారులు_-_కూచిపూడివారు , http://www.andhrabharati.com/vachana/vyAsamulu/tAnA06_cs_09.html, https://wn.com/pagati_vesham__folk_art_form_in_telugu,\r\nhttp://www.navatelangana.com/article/jaatara/211817'),(100,'paMbala vaaru','','పంబల వారు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/పంబల_వారు'),(101,'paamula vaaDu','','పాముల వాడు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/పాములాటలు.....మోడీ'),(102,'panasala vaaru','','పనసల వారు','Folk','','','','','','Submitted','',''),(103,'paMDari bhajanalu','','పండరి భజనలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/పండరిభజనలు , https://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/పండరి_భజనలు'),(104,'paaMDavula kathalu','','పాండవులు కధలు','Folk','','','','','','Submitted','',''),(105,'paMdiri paaTa','','పందిరి పాట','Folk','','','','','','Submitted','',''),(106,'paTaala vaaru','','పటాల వారు','Folk','','','','','','Submitted','',''),(107,'peeriNi nRtyaM','యోధుల నృత్యం, తాండవనృత్యం, పేరిణి తాండవనృత్యం','పేరిణి నృత్యం','Folk','','','http://arangham.com/infopics/purush/Perini%20Thandavam%20_photo-Vivekanandan.jpg,\r\nhttp://goheritagerun.com.s3-us-west-1.amazonaws.com/wp-content/uploads/2015/03/15084752/2009091150340302_206300g1.jpg,\r\nhttps://i.ytimg.com/vi/OHM51lS2vlc/maxresdefault.jpg,\r\nhttp://dc-cdn.s3-ap-southeast-1.amazonaws.com/dc-Cover-g6v2ep46keakb6dfmnn0pl6gi7-20161006020850.Medi.jpeg,\r\nhttp://www.andhrawishesh.com/media/k2/items/src/TS-Govt-Decides-Perini-as-S.jpg','https://www.youtube.com/embed/B3Ib4Xl_dE8,https://www.youtube.com/embed/QRqueoBwmwA,\r\nhttps://www.youtube.com/embed/NniI5GhjfMw,https://www.youtube.com/embed/HqDtfDuwENE,https://www.youtube.com/embed/JFS9S5xamjA','','Selected','','https://te.wikipedia.org/wiki/పేరిణి_నృత్యం , http://www.bhaarattoday.com/news/bhaarateeyam/telangana-s-own-dance-form-perini/4895.html,\r\nhttp://www.andhrajyothy.com/artical?SID=234928,http://naatelangaana.blogspot.com/2012/06/blog-post.html,\r\nhttp://www.navatelangana.com/article/maanavi/47691,http://www.telugudanam.co.in/samskruti/janapada_kalaa_rupalu/perini.php,\r\nhttp://himazwala.blogspot.com/2012/12/blog-post_25.html,\r\nhttps://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/పేరెన్నికగన్న_పేరిణి_తాండవ_నృత్యం'),(108,'phakiiru veeShaalu','మాయల ఫకీరు','ఫకీరు వేషాలు','Folk','','','http://2.bp.blogspot.com/-n5IDJ9EinY4/UQEZbNyeyxI/AAAAAAAABL4/pqBz0m41n6k/s1600/pahkeer+vesham.jpg','','','Submitted','','https://te.wikipedia.org/wiki/ఫకీరు_వేషాలు'),(109,'pichchukuMTla kadhalu','','పిచ్చుకుంట్ల కధలు','Folk','','','','','','Submitted','','http://telugubhasha.in/saahithyam/janapadha_piccikuntlavaaru.php'),(110,'piTTaladora','latkoorusaabu, లత్కోరుసాబు, buDDar khaan, బుడ్డర్ ఖాన్, tupaaki raamuDu, తుపాకి రాముడు','పిట్టలదొర','Folk','','','https://i.ytimg.com/vi/gQF5Ob_ThkQ/0.jpg,http://2.bp.blogspot.com/-Is_kF-y0sy0/VDYoROsefYI/AAAAAAAAHKU/IplhRjSJoNk/s1600/Pittala%2BDora.tif, https://i.ytimg.com/vi/GQUDd81vHak/hqdefault.jpg,https://i.ytimg.com/vi/tnxVxbNP1Pw/hqdefault.jpg','https://www.youtube.com/embed/7mc7bv6azZE,https://www.youtube.com/embed/_beOrbmR30I,https://www.youtube.com/embed/BET2HowRQzI','','Submitted','','https://te.wikipedia.org/wiki/తెలంగాణా_లత్కోర్_సాబ్ , https://www.youtube.com/watch?v=VGPi_HPpojY'),(111,'poDapOtula vaaru','','పొడపోతుల వారు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/కాటమరాజు_కొమ్ము_కథలు'),(112,'puli naaTyaM','పెద్ద పులి నాట్యం','పులి నాట్యం','Folk','','','https://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Street_tiger_dance-andhrq.jpg/1024px-Street_tiger_dance-andhrq.jpg','https://www.youtube.com/embed/D1vwgBkXjBQ,\r\nhttps://www.youtube.com/embed/yKvd6otJzms/,\r\nhttps://www.youtube.com/embed/d6bU1a7Fcks','','Submitted','','https://te.wikipedia.org/wiki/పులి_వేషం'),(113,'puusala balija kathalu','','పూసలబలిజ కధలు','Folk','','','','','','Submitted','',''),(114,'reela paaTalu','','రేలపాటలు','Folk','','','','','','Submitted','',''),(115,'relli jaTTulu','','రెల్లిజట్టులు','Folk','','','','','','Submitted','',''),(116,'ruMjalu','','రుంజలు','Folk','','','','','','Submitted','',''),(117,'saadhana Suurulu','','సాధన శూరులు','Folk','','','','https://www.youtube.com/embed/_EVuF18rJcQ','','Submitted','','http://www.navatelangana.com/article/jaatara/511549'),(118,'saarada katha','','శారద కధ','Folk','','','','','','Submitted','',''),(119,'sarikEmuggula soodi','','సరికేముగ్గుల సోది','Folk','','','','','','Submitted','',''),(120,'saataani padaalu','','సాతాని పదాలు','Folk','','','','','','Submitted','',''),(121,'taMdanaana kathalu','','తందనాన కధలు','Folk','','','','','','Submitted','',''),(122,'tappeTa guLLu','','తప్పెట గుళ్ళు','Other','','','https://i.ytimg.com/vi/GsgVMfLVqAc/hqdefault.jpg,\r\nhttps://i.ytimg.com/vi/68QET7k1q2M/maxresdefault.jpg,\r\nhttp://www.thehindu.com/migration_catalog/article10477488.ece/ALTERNATES/LANDSCAPE_615/16VZMP_UTSAV1','https://www.youtube.com/watch?v=GsgVMfLVqAc,\r\nhttps://www.youtube.com/watch?v=68QET7k1q2M,\r\nhttps://www.youtube.com/watch?v=Zc2KhS6hs7o','','Selected','','https://te.wikipedia.org/wiki/తప్పెటగుళ్ళు'),(123,'tera chiirala pradarSana','','తెర చీరల ప్రదర్శన','Folk','','','','','','Submitted','',''),(124,'dhiMsaa nRtyaM','','థింసా నృత్యం','Folk','','','https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Araku_Tribal_Dancers.jpg/1920px-Araku_Tribal_Dancers.jpg,\r\nhttps://c1.staticflickr.com/3/2696/4250396457_4da4226750_z.jpg,\r\nhttp://www.andhrafolkarts.org/wp-content/uploads/2009/11/Dhimsa2.jpg,\r\nhttps://c1.staticflickr.com/9/8374/8560303662_eb57a586a7_b.jpg,\r\nhttps://c1.staticflickr.com/4/3933/15424654966_d72035d5d0_h.jpg','https://www.youtube.com/embed/Z0bHmDewfYE,\r\nhttps://www.youtube.com/embed/nmp4v74mRyo,\r\nhttps://www.youtube.com/embed/Avc57C0ZBBk,\r\nhttps://www.youtube.com/embed/iuHcjubgUNQ','','Submitted','','https://te.wikipedia.org/wiki/దింసా_నృత్యం,\r\nhttps://en.wikipedia.org/wiki/Dhimsa'),(125,'tuurpu bhaagootaM','','తూర్పు భాగోతం','Folk','','','','','','Submitted','',''),(126,'urumula nRtyaM','Thunder Dance','ఉరుముల నృత్యం','Folk','','చితికి జీర్ణమైపోయిన అనేక జానపద కళా రూపాల ఈనాడు మనకు కనబడకుండా కనుమరుగై పోయాయి. అలా కను మరుగైన కళారూపాలలో ఉరుముల నృత్యం ముఖ్యమైనది. తలకు అందంగా రుమాళ్ళు చుట్టుకుని మెడల్లో కాసుల దండలు ధరించి ఎఱ్ఱని, పచ్చనివీ శాలువలు కప్పుకుని, నిలువు అంగీలు ధరించి, పల్ల వేరు చెట్టు కర్రతో తయారు చేసిన ఉరుములకు చర్మపు మూతలు మూసి, కదర పుల్లలతో వాయించు కుంటూ దేవాలయ ప్రాంగణాల్లో, ఉరుముల నృత్యం చేస్తూ వుంటారు. ఉరుము అనే పేరును బట్టి వాయిద్య ధ్వని ఉరుమును పోలి వుండవచ్చును. అందు వల్ల వాటికి ఉరుములు అనే నామకరణం చేసి వుండవచ్చు.','https://scontent-ort2-1.xx.fbcdn.net/v/t1.0-9/545229_464710686922911_1235437945_n.jpg?oh=57834bdfd79e9d16ebcec533631b95c6&oe=5995D7C3,https://scontent-ort2-1.xx.fbcdn.net/v/t1.0-9/13575_464711206922859_1418224701_n.jpg?oh=d3d357c70051dcb62191d0882726ecf4&oe=5958F58B','https://www.youtube.com/embed/5mbl3mY_WFE,https://www.youtube.com/embed/BS6F6mDKlRo','','Selected','','https://te.wikipedia.org/wiki/ఉరుము_నృత్యము, https://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/ఉరుమును_మించిన_ఉరుముల_నృత్యం , http://www.webindia123.com/andhra/ART/urumulu.htm'),(127,'uyyaala paaTalu','','ఉయ్యాల పాటలు','Folk','','','http://images.kinige.com/cover600/5700/BangaruBatukammaUyyalaPatalu600.jpg','','','Submitted','','http://www.andhrajyothy.com/artical?SID=319513,'),(128,'vaishNava daasari paaTalu','','వైష్ణవ దాసరిపాటలు','Folk','','','','','','Submitted','','http://konamanini.blogspot.in/2012/01/blog-post_29.html'),(129,'vaalakaalu','','వాలకాలు','Folk','','','','','','Submitted','',''),(130,'viidhi bhaagavathulu','','వీధి భాగవతులు','Folk','','','','','','Submitted','',''),(131,'viidhi naaTakaalu','Street Play, వీధి నాటకము','వీధి నాటకాలు','Folk','','','https://i.ytimg.com/vi/p_ttveAwzB4/hqdefault.jpg,https://i.ytimg.com/vi/6wMsi-o11KI/maxresdefault.jpg,','','','Submitted','','http://telugubhasha.in/saahithyam/janapadha_veedhinatakam.php,\r\nhttp://api.navatelangana.com/Sopathi/81100'),(132,'viidhi puraaNaalu','','వీధి పురాణాలు','Folk','','','','','','Submitted','',''),(133,'viidhi daasarlu','','వీధి దాసర్లు','Folk','','','','','','Submitted','',''),(134,'vilaasini naaTyaM','చిన్న మేళం','విలాసిని నాట్యం','Folk','','','','','','Submitted','','https://en.wikipedia.org/wiki/Vilasini_Natyam'),(135,'vipra vinoodulu','','విప్రవినోదులు','Folk','','','','','','Submitted','',''),(136,'viira bhadra vinyaasaM','','వీరభద్ర విన్యాసం','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/వీర_శైవుల_వీర_భద్ర_విన్యాసాలు'),(137,'viira khaDgaalu','','వీరఖడ్గాలు','Folk','','','','','','Submitted','',''),(138,'viira muShTivaaru','','వీరముష్టివారు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/వీరముష్టివారు ,\r\nhttp://apculturedept.com/artservlets/jsp/ArtsView/kadhalu/gotoUrlImages/veera%20mushti.pdf,\r\nhttp://www.navatelangana.com/article/jaatara/538986,'),(139,'viira naaTyaalu','','వీరనాట్యాలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/వీరనాట్యమే_వీరుల_కొలువు'),(140,'viira vidyaavaMtulu','','వీరవిద్యావంతులు','Folk','','','','','','Submitted','',''),(141,'yaksha gaanaM','','యక్షగానం','Folk','','','http://files.prokerala.com/news/photos/imgs/800/artists-perform-yakshagana-organised-by-441510.jpg,http://1.bp.blogspot.com/-pDPB5bHbQm8/UPgM0hPkWyI/AAAAAAAAAIs/BXMwGR7Poco/s1600/208313-veera-vrushasena-yakshagana-play.jpg,https://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/FullPagadeYakshagana.jpg/220px-FullPagadeYakshagana.jpg,https://upload.wikimedia.org/wikipedia/commons/8/8d/Kondadakuli.jpg,','https://www.youtube.com/embed/LErVC7NQipY,https://www.youtube.com/embed/CTSUBIqdzEM,https://www.youtube.com/embed/4wcf-RYVBlE','','Submitted','','http://www.andhrabharati.com/vachana/vyAsamulu/yaxagAnamu.html, https://en.wikipedia.org/wiki/Yakshagana,\r\nhttps://te.wikipedia.org/wiki/యక్షగానం'),(142,'yaanaadi bhaagavatulu','','యానాది భాగవతులు','Folk','','','','','','Submitted','',''),(143,'koolaaTaM','Jada KolaTam, జడ కోలాటం, జడకొప్పు కోలాటం','కోలాటం','Folk','','','https://i.ytimg.com/vi/qDSW7Oi6iyY/maxresdefault.jpg, http://www.yohyoh.com/img_upload/server/php//files/54398fb913be590a7f31059500c22dbc5a08.jpeg, http://www.ourlaxminagar.org/gallery_pics/telangana_book/02.png','https://www.youtube.com/watch?v=Ng9pbl4mctI, \nhttps://www.youtube.com/watch?v=V0_ZViQvEPI,\nhttps://www.youtube.com/watch?v=CujKdQqL_ck,','','Submitted','','https://te.wikipedia.org/wiki/కోలాటం ,'),(144,'DO NOT DELETE','నొత్','జనరల్ - డిలీట్ చేయవద్దు','Folk','','http://yourshot.nationalgeographic.com/profile/662895/\r\nకోలాటం\r\nకొమ్మునృత్యం\r\nజముకు\r\nబొమ్మలకొలువు\r\nప్రభలు\r\nఅగటి, తుణాలిచిందులు, కరగలు లేక గరగలు, కరువనృత్యం, కావడిచిందు, కుగ్మా, కొయ్యకాళ్లు, కొలువులు, కోలాటం, గొబ్బి, చిరతలభజన, చెక్క్భజన, జంగంపాటలు, జడకోలాటం, జముకులు, డప్పు కోలాటం, తప్పెట గుండ్లు, వీరనాట్యం\r\nబుట్టబొమ్మలు\r\nబుర్ర కథ\r\nతండాలనృత్యం\r\nయక్షగానం\r\nతప్పెటగుళ్ళు\r\nజంగందేవరలు\r\nఎడ్లపందాలు\r\nపులివేషం\r\nహరిదాసులు\r\nగోరింటాకు\r\nముగ్గులు\r\nగుసాడీ\r\nథింసా\r\nడప్పు\r\nశరభనృత్యం\r\nచెమ్మచెక్క\r\nరుంజ\r\nగంగిరెద్దులు\r\nచెడుగుడు\r\nజంగందేవర\r\nచోడిగాడి కలాపం\r\nదేవదాసినృత్యం\r\nపకీరు వేషం\r\nడప్పరి నృత్యం\r\nపిట్టలదొర\r\nబుడబుక్కలవాడు\r\nగొంతెలమ్మ అశ్వనృత్యం\r\nలంబాడి గన్నెగాడు\r\nబుడిగే జంగాలు\r\nకనక తప్పెట్లు\r\nవాలకం నృత్యం\r\nచెంచునృత్యం\r\nఘటనృత్యం\r\nవిప్రవినోధం\r\nదేవతాకొలువులు\r\nదండగానం\r\nజిత్తుల గారడి\r\nఎరుకలసాని\r\nకొమ్మదాసరి\r\nఉరుముల నృత్యం\r\nచిందు భాగవతం\r\nభజన\r\nకాశీకావడి\r\nమందులవారి వేషాలు\r\nవీర శైవులు\r\nగొల్ల సుద్దులు\r\nవీరభద్ర విన్యాసం\r\nపగటి వేషాలు\r\n\r\nhttp://www.thehindu.com/lf/2002/03/19/stories/2002031904630200.htm,\r\n\r\nhttps://www.youtube.com/watch?v=dLRbFN4JRFI\r\n\r\nhttps://te.wikipedia.org/wiki/తెలుగు_సంస్కృతి\r\n\r\nజానపద గాయకులు - రుంజవారు, బీరన్నలవారు, వీరముష్టివారు, బవనీలవారు, జంగములు, పిచ్చుకగుంట్లవారు, దాసరులు, శారదకాండ్రు, మొదలైనవారు.వీరు అనేక విధములైన వాద్య విశేషములతో ఊరూరా తిరుగుతూ వాద్యాలను వినిపిస్తూ పాటలు పాడుతుంటారు. \r\n\r\nజానపద వాద్యవిశేషాలు:- వీరణములు, గుమ్మెట, ఒగ్గులు, కోలలు, శంఖము, శారద, అందేలు, కటివాద్యము, డప్పు, తప్పెట, తాళాలు, తంబుర, జమిడికలు, చిరుతలు, నాగస్వరము, గజ్జెలు, ఢిక్కి, పిల్లనగ్రోవి, కొమ్ముబూరలు, బుర్రలు, రుంజ మొదలయినవి. వీరు పాడే పాటల్లో, చెప్పే కథల్లో చారిత్రక, పౌరాణిక, పారమార్థిక ఇతివృత్తాలు ప్రధానాలు.\r\n\r\nజానపద కళారూపాలు ఎన్నో - మరెన్నో\r\n\r\nఒక్కొక్క కళను గురించి ఒక్కొక్క గ్రంధం రాయవచ్చు. కీలు బొమ్మలు, బుట్టబొమ్మలు, శారదగాండ్రు, మూకాభినయాలు, వీరభద్ర విన్యాసం, జముకుల కథలు, గారడీ ప్రదర్శనలు, డప్పుల కోలాటం, గరగ నృత్యం, పులివేషాలు, కాముని పున్నమి వినోదాలు, గొల్లసుద్దులు, వీరముష్టివారు, ఫకీరు వేషాలు, తుమ్మెదపాటలు, గోండుజాతి నృత్యాలు, విప్రవినోదులు, బతుకమ్మ, బొడ్డెమ్మ పండుగలు, సాధనాశూరులు, గంటె భాగవతులు, కాటి కాపటివాళ్ళు, బైండ్లవాళ్ళు, కోలాటనృత్యం, దొమ్మరాటలు, జంతరు పెట్టె, వీథిపురాణం, అశ్వనృత్యం - పిచ్చుకుంటల కథలు, హరిహరీపదాలు, ఘటనృత్యం, కాశీకావళ్ళు, బుడబుక్కలు - ఇలా ఒకటేమిటి - తెలుగు కళామతల్లి మణిహారాలుగా ఎన్నో వర్థిల్లాయి - వర్థిల్లుతున్నాయి ప్రతి కళకూ ఒక చరిత్ర - ఒక ప్రత్యేకత ఉంది. జానపద కళారూపాలు - ఇంకా ఎన్నో మరెన్నో దేశవ్యాప్తంగా ప్రజల మధ్య - ప్రజానందాన్ని అందిస్తూ - ప్రజాకళలుగా వర్థిల్లుతూనే ఉన్నాయి.','','https://www.youtube.com/embed/dLRbFN4JRFI,\r\nhttps://www.youtube.com/embed/L41zrzjSdC0&list=PLU6j6SJJ1t7oVBps29VXoUwN_-cSrs2dk','','Submitted','','https://www.ntnews.com/nipuna-education/తెలంగాణ-జానపద-కళారూపాలు-15-2-476996.aspx ,\r\nhttp://www.trjks.in/,http://www.maganti.org/andhrakalalu/videos/jogadhenu.pdf,\r\nhttps://www.youtube.com/watch?v=L41zrzjSdC0&list=PLU6j6SJJ1t7oVBps29VXoUwN_-cSrs2dk, https://te.wikipedia.org/wiki/కుల_పురాణాలు ,\r\nhttp://www.thehindu.com/lf/2002/03/19/stories/2002031904630200.htm,http://shodhganga.inflibnet.ac.in/bitstream/10603/65194/8/08_chapter%202.pdf, http://kalingaseema.blogspot.com/2010/12/blog-post_19.html,\r\nhttps://www.youtube.com/watch?v=dLRbFN4JRFI, https://te.wikipedia.org/wiki/తెలుగు_సంస్కృతి ,\r\nhttp://shodhganga.inflibnet.ac.in/bitstream/10603/65194/7/07_chapter%201.pdf, https://te.wikipedia.org/wiki/ఆదిమ_వాసుల_గిరిజన_కళా_రూపాలు ,http://navarasabharitham.blogspot.com/2012/01/blog-post_13.html,http://www.sakshi.com/news/funday/crops-festival-makar-sankranti-202765;\r\nhttp://yourshot.nationalgeographic.com/profile/662895/'),(145,'palle suddulu','','పల్లె సుద్దులు','Folk','','','','https://www.youtube.com/embed/hIFyWykXk2w;\r\nhttps://www.youtube.com/wembed/x4u6KiSvK9s','','Submitted','assets/artist_images/tana_6.PNG','http://www.navatelangana.com/article/khammam/502641'),(146,'saamu garaDi','కర్ర సాము, కత్తి సాము, karra saamu, katti saamu, Silambam, Silambattam, Silambattam, Chilambam','సాము గారడి','Folk','','','https://s-media-cache-ak0.pinimg.com/originals/03/13/bf/0313bfda94da528f6bd2e843886e1296.jpg,\r\nhttps://s-media-cache-ak0.pinimg.com/originals/85/f9/6b/85f96b00b570e498d0e71e1a808a4a83.jpg,\r\nhttps://s.yimg.com/ny/api/res/1.2/PEycVxriwvfYoSYXdtFJmw--/YXBwaWQ9aGlnaGxhbmRlcjtzbT0xO3c9ODAwO2lsPXBsYW5l/http://media.zenfs.com/en_us/News/ap_webfeeds/636a0b14d966191b7a0f6a7067006662.jpg','https://www.youtube.com/embed/RtyQr9uNDRU,https://www.youtube.com/embed/v5exUZOhT2Q,https://www.youtube.com/embed/uwxOAc16fWA,https://www.youtube.com/embed/jcybAnS4LYQ,','','Submitted','','https://te.wikipedia.org/wiki/సాము , https://te.wikipedia.org/wiki/కత్తిసాములు,_కర్ర_సాములు ,Silambam, Silambattam, Silambattam, Chilambam'),(147,'BABU TEST','trying out','బాబు టెస్ట్','Folk','Orissa','తెలుగునాట జానపద వినోదగాన ప్రక్రియలలో ప్రబోధానికీ, ప్రచారానికీ సాధనంగా ఈ నాటికీ విస్తృతంగా ఉపయోగపడే కళారూపం బుర్ర కథ. కథకుని చేతిప్రక్రియ ఇది. ప్రదర్శన సౌలభ్యాన్ని బట్టి, వీర గాథలు, త్యాగమూర్తుల కథలు బుర్ర కథల ఇతివృత్తాలుగా బాగా పేరు కొన్నాయి.ఈ ప్రక్రియ ప్రచార సాధనంగా ఎంతగానో ఉపకరిస్తోంది. కుటంబ నియంత్రణ, రాజకీయ ప్రచారము, ప్రజలను విజ్ఙానవంతులను చేయడము వంటి కార్యక్రమాలలో ఇది బాగా వాడబడింది.జంగంకథ, పంబలకథ, జముకులకథ, పిచ్చుకుంట్ల కథ, తరువాతవచ్చింది.డాలు, కత్తితో పాడే ప్రధాన కథకుడికి పిచ్చిగుంట్ల కథలో ఇద్దరు వంతలున్నట్లే బుర్రకథలోకూడా ఉంటారు.\r\nదీనికి మాన్యత కల్పించి పద్మశ్రీ బిరుదు సంపాదించుకున్నవారు షేక్ నాజర్. పేరునుబట్టి వీరు ఇస్లాం మతానికి చెందిన వారైనా చెప్పిన కథలలో ఎక్కువ భాగం హిందూ దేవీదేవతలకు చెందినవే. శ్రీకాకుళం పర్యటించినప్పుడు శ్రోతలు బొబ్బిలియుద్ధం కథ కోరారు. దానితో నాజర్ తానే కథారచనకూ నడుంబిగించాడు. అంతేకాదు సామ్యవాద దృక్పధం గల వీరిని 1940వ దశకంలో కమ్యూనిస్టు పార్టీ నెల జీతంమీద కథలు చెప్పించి పల్లెలలో తమ పార్టీ ప్రచారానికి ఉపయోగించుకున్నది.\r\nనాజర్ బొబ్బిలియుద్ధం, అల్లూరి సీతారామరాజు ప్రహ్లాద, క్రీస్తు, పల్నాటి యుద్ధం బెంగాల్ కరువు వంటి వస్తు వైవిధ్యంగల కథలను చెప్పి రక్తికట్టించారు. తెనాలిలోని బాలరత్న నాటక సమాజంలో ప్రారంభమైన నాజర్ కథాకథన ప్రస్థానం నాలుగు దశాబ్దాలు అవిచ్ఛిన్నంగా సాగింది.','http://1.bp.blogspot.com/_Wsvv95vvWkI/S81bbfUwTfI/AAAAAAAAAD0/0e0Pcf81Ni4/s1600/Burra+Katha+Dancers+MedShot.jpg,http://media.radiosai.org/journals/Portal/pd-articles/pdimages/28th_june/106_5116.jpg','https://www.youtube.com/embed/Vh8bkIKSCpY,https://www.youtube.com/embed/fg78lSiXeqo,https://www.youtube.com/embed/r3OrWpoAMLs','','In Progress','assets/artist_images/tana_10.JPG, assets/artist_images/tana_7.PNG','https://en.wikipedia.org/wiki/Burra_katha, http://www.nrityanjali.org/th_bur.html'),(148,'batukamma','','బతుకమ్మ','Folk','telangana','','','','','Submitted','','https://te.wikipedia.org/wiki/బతుకమ్మ , http://telugubhasha.in/saahithyam/janapadha_Batukamma.php'),(149,'toolu bommalaaTa','Leather Puppets, Shadow Puppets','తోలు బొమ్మలాట','Folk','','','https://c1.staticflickr.com/2/1376/5168099575_1efcc6dd65_b.jpg,\r\nhttp://www.exoticindia.com/books/tolu_bommalata_the_shadow_puppet_theatre_of_andhra_idk321.jpg,\r\nhttp://blog.gaatha.com/wp-content/uploads/2010/02/charmakari.jpg,\r\nhttps://s-media-cache-ak0.pinimg.com/236x/24/fa/a0/24faa007986069667230ce1979b27c71.jpg','','','Submitted','','https://te.wikipedia.org/wiki/తోలుబొమ్మలాట ,\r\nhttp://www.sakshi.com/news/family/today-is-the-day-of-the-world-pappetri-223599,\r\nhttps://scontent.xx.fbcdn.net/v/t1.0-9/1688302_730328190421093_8533719254081880913_n.jpg?oh=06a65beb599b3ecad619f675d4c32db2&oe=598B1179'),(150,'tummeda paaTalu','','తుమ్మెద పాటలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/తుమ్మెద_పాటలు'),(151,'kommula vaaru','కాటంరాజు కొమ్ము కథలు','కొమ్ముల వారు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/కాటమరాజు_కొమ్ము_కథలు'),(152,'komma daasari','','కొమ్మ దాసరి','Folk','','','','','','Submitted','','https://te.wikisource.org/wiki/తెలుగువారి_జానపద_కళారూపాలు/కొమ్మాయి_దాసుడే,_కొమ్మదాసరి'),(153,'dommari aaTalu','','దొమ్మరి ఆటలు','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/దొమ్మరి_ఆటలు'),(154,'nemali nRtyam','peacock dance','నెమలి నృత్యం','Folk','','','','https://www.youtube.com/embed/FZw_HJuNHCE','','Submitted','',''),(155,'gussaadi dance','','గుస్సాది నాట్యం','Folk','','','http://www.telanganafirst.in/wp-content/uploads/2015/08/GussadiDanceTELAN05aug2015.jpg,https://s-media-cache-ak0.pinimg.com/originals/bf/5e/2d/bf5e2dbd4a00109f68a4cdfd5dbdec74.jpg,http://telugustoday.com/wp-content/uploads/2015/08/Gussadai-dance-e1438788814865.jpg','https://www.youtube.com/embed/BALztBlBbQQ,https://www.youtube.com/embed/TthXWUQODRw','Tribal','Submitted','',''),(156,'prabhalu','','ప్రభలు','Folk','','','https://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Prabha_17.jpg/500px-Prabha_17.jpg,\r\nhttps://upload.wikimedia.org/wikipedia/commons/c/c2/Prabha_27.jpg,\r\nhttps://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Prabha_04.jpg/540px-Prabha_04.jpg,\r\nhttps://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Prabha_12.jpg/396px-Prabha_12.jpg','https://www.youtube.com/embed/3iQtOAaLoDk','','Submitted','','https://te.wikipedia.org/wiki/ప్రభల_సంస్కృతి ,'),(157,'kaaSi kaavaDi','','కాశీ కావడి','Folk','','','https://lh5.googleusercontent.com/proxy/nh1OMqIW_o81y3vM7e28DbJWydzyR0Jepg8XNV6_jkgxL-QfN9Q26MNlkCME57MOXEbYvB0iFl3BbI8BnVum-BYeLIldTsp9qmCMtKcMnYHCI4nN4s3r-a42lMmc=w5000-h5000,\r\nhttp://2.bp.blogspot.com/-ZLBWknmvbyo/VDYoNuX67oI/AAAAAAAAHJk/KsbjMhETCFA/s1600/Kasi%2BKavadi.tif','','','Submitted','','https://te.wikipedia.org/wiki/కాశీ_కథలు_చెప్పే_కాశీ_కావడి'),(158,'buTTa bommalu','','బుట్ట బొమ్మలు','Folk','','','http://anubimb.com/wp-content/uploads/2009/12/dasara-dolls.jpg,https://upload.wikimedia.org/wikipedia/te/c/ca/BUTTABOMMALU-2.jpg,http://www.andhrabulletin.in/AP_AB/images/Butta%20bommalu.gif,\r\nhttp://www.puppetindia.com/images/mP9.jpg','','','Submitted','','https://te.wikipedia.org/wiki/బుట్టబొమ్మలు ,\r\nhttp://www.andhrabulletin.in/AP_AB/andhra_jaanapadha_buttabommalu.php,\r\nhttp://www.puppetindia.com/misc3.htm'),(159,'oggu Dolu','','ఒగ్గు డోలు','Folk','','','http://img.sakshi.net/images/cms/2016-08/81471109200_625x300.jpg,\r\nhttp://4.bp.blogspot.com/-_ExovfNtg9M/VdBE-BSVbUI/AAAAAAAABcg/sy0RS26lD1A/s1600/20150810_165700.jpg,https://i.ytimg.com/vi/KsVb-7Zx-GY/maxresdefault.jpg,http://4.bp.blogspot.com/-xnPeuHCARqw/VdBFCxcZMnI/AAAAAAAABdM/Lxpk_11lP6U/s1600/20150810_171620.jpg,http://2.bp.blogspot.com/-Kpcz7aRyPH0/VcNhCMqtQPI/AAAAAAAABMM/Ah-Ha_0r54M/s1600/20150803_180320.jpg,','https://www.youtube.com/embed/L8nqwNBFXtA, https://www.youtube.com/embed/dKt86Hp4rcc','','Submitted','','http://www.sakshi.com/news/district/drum-ghallu-380376'),(160,'daasari bhaagavathaM','','దాసరి భాగవతం','Folk','','','','https://www.youtube.com/embed/e_fMjtNc16s','','Submitted','',''),(161,'gootroolooLLa bhaagavathaM','','గోత్రోలోళ్ళ భాగవతం','Folk','','','','https://www.youtube.com/embed/z4C5OhOJoRc','','Submitted','',''),(162,'naayi brahma puranam','','నాయీ బ్రహ్మ పురాణం','Folk','','','','https://www.youtube.com/embed/1gFww8XLg5o','','Submitted','',''),(163,'jaalari nRtyaM','','జాలరి నృత్యము','Folk','','','','https://www.youtube.com/watch?v=OI7lFBemUkk,','','Submitted','','http://andhrajalari.com,\r\nhttps://te.wikipedia.org/wiki/సంపత్_కుమార్'),(164,'150_Testing','','150_టెస్టింగ్','Folk','','150_టెస్టింగ్\r\n\r\nDescription is here','http://cms.ysu.edu/sites/default/files/images/web-ysu/Testing_in_Progress.gif,\r\nhttp://www.sevenhills.org/uploads/child_care_resources/CCR-BrainBuildingLogo200.png','','','Done','',''),(165,'Testing the spaces','','టెస్టింగ్ స్పేసెస్','Folk','','line one,\r\nline two will give two spaces after this line\r\n\r\nline three \r\nlive four','','','','Done','',''),(166,'testing delete','','','Folk','','','','','','Submitted','',''),(167,'Testing Delete 2','','','Folk','','','','','','Submitted','',''),(168,'siddI nrutyaM','','సిద్దీ నృత్యం','Folk','','','','','','Submitted','','https://te.wikipedia.org/wiki/సిద్దీ_నృత్యం'),(169,'dummy dance','','దమ్మీ దాన్స్','Folk','','','','','','Submitted','','');
/*!40000 ALTER TABLE `dances` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `login`
--
DROP TABLE IF EXISTS `login`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `login` (
`login_id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`login_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `login`
--
LOCK TABLES `login` WRITE;
/*!40000 ALTER TABLE `login` DISABLE KEYS */;
INSERT INTO `login` VALUES (1,'admin','d033e22ae348aeb5660fc2140aec35850c4da997'),(2,'ramu','2c5280f16cfa61571602a788d525c0b27d5b5163'),(3,'babu','38331fe6f80d82c118c1b893f901a6276b3f3999'),(4,'siva','1e09ffabe99d261ab86897d4a0677c71167ae3c0');
/*!40000 ALTER TABLE `login` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `word_list`
--
DROP TABLE IF EXISTS `word_list`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `word_list` (
`english_word` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`telugu_word` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`hindi_word` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`kannada_word` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`malayalam_word` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`gujarathi_word` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`english_word`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `word_list`
--
LOCK TABLES `word_list` WRITE;
/*!40000 ALTER TABLE `word_list` DISABLE KEYS */;
INSERT INTO `word_list` VALUES ('acrobat','శ్రమజీవి','कलाबाज','acrobat_k','acrobat_m',''),('aeroplane','విమానంలో','विमान','plane_k','plane_m','plane_g'),('air','ఎయిర్','वायु','air_k','air_m','air_g'),('alligator','ఎలిగేటర్','मगर','alligator_k','',''),('alphabets','వర్ణమాలలు','अक्षर','','',''),('anchor','లంగరు','लंगर','','',''),('Angle','కోణము','कोण','','',''),('animal','జంతువు','जानवर','animal_k','animal_m','animal_g'),('sun','సూర్యుని','रवि','sun_k','sun_m','sun_g');
/*!40000 ALTER TABLE `word_list` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-04-23 18:35:37
|
<reponame>ivconsult/eNeg-OfferApp<filename>citPOINT.OfferApp.DataBase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/uspConversationOfferSettingSelect.proc.sql
CREATE PROC [dbo].[uspConversationOfferSettingSelect]
@ConversationOfferSettingID UNIQUEIDENTIFIER
AS
SET NOCOUNT ON
SET XACT_ABORT ON
BEGIN TRAN
SELECT [ConversationOfferSettingID], [NegotiationOfferSettingID], [BaseOfferTypeID], [TargetTypeID], [TargetValue], [Deleted], [DeletedBy], [DeletedOn]
FROM [dbo].[ConversationOfferSetting]
WHERE ([ConversationOfferSettingID] = @ConversationOfferSettingID OR @ConversationOfferSettingID IS NULL)
COMMIT
|
<filename>cv.sql
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 23, 2019 at 05:49 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `cv`
--
-- --------------------------------------------------------
--
-- Table structure for table `biodata`
--
CREATE TABLE `biodata` (
`id` varchar(13) NOT NULL,
`photo` varchar(100) NOT NULL,
`name` varchar(20) NOT NULL,
`nick_name` varchar(10) NOT NULL,
`place` varchar(12) NOT NULL,
`date` date NOT NULL,
`job` varchar(20) NOT NULL,
`phone` varchar(15) NOT NULL,
`email` varchar(50) NOT NULL,
`address` varchar(100) NOT NULL,
`gender` varchar(6) NOT NULL,
`nationality` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `biodata`
--
INSERT INTO `biodata` (`id`, `photo`, `name`, `nick_name`, `place`, `date`, `job`, `phone`, `email`, `address`, `gender`, `nationality`) VALUES
('1', '', 'Rizka Nur Rahma', 'Rizka', 'Malang', '2002-01-10', 'Student', '087859159058', '<EMAIL>', '<NAME> AL-34', 'Female', 'Indonesia');
-- --------------------------------------------------------
--
-- Table structure for table `contact`
--
CREATE TABLE `contact` (
`id` varchar(13) NOT NULL,
`name` varchar(50) NOT NULL,
`link` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contact`
--
INSERT INTO `contact` (`id`, `name`, `link`) VALUES
('1', 'instagram', 'https://www.instagram.com/rizka.rhm/');
-- --------------------------------------------------------
--
-- Table structure for table `education`
--
CREATE TABLE `education` (
`id` varchar(13) NOT NULL,
`name` varchar(100) NOT NULL,
`year` varchar(100) NOT NULL,
`type` varchar(100) NOT NULL,
`about` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `education`
--
INSERT INTO `education` (`id`, `name`, `year`, `type`, `about`) VALUES
('1', 'SDN Banjararum 3', '2008- 2011', 'Elementary School', 'I Start my Elementary School in here');
-- --------------------------------------------------------
--
-- Table structure for table `experience`
--
CREATE TABLE `experience` (
`id` varchar(13) NOT NULL,
`name` varchar(100) NOT NULL,
`type` varchar(100) NOT NULL,
`year` varchar(100) NOT NULL,
`about` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `experience`
--
INSERT INTO `experience` (`id`, `name`, `type`, `year`, `about`) VALUES
('1', 'Ezy Industries', 'Industrial Pratice', 'July 2018 - December 2018', 'My fist experience about Mobile Progamming using React Native. I was work in team to build the Remap Aplication.');
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE `login` (
`id` varchar(13) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `login`
--
INSERT INTO `login` (`id`, `username`, `password`) VALUES
('1', 'rizka', '<PASSWORD>');
-- --------------------------------------------------------
--
-- Table structure for table `portofolio`
--
CREATE TABLE `portofolio` (
`id` varchar(13) NOT NULL,
`name` varchar(100) NOT NULL,
`type` varchar(100) NOT NULL,
`about` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `portofolio`
--
INSERT INTO `portofolio` (`id`, `name`, `type`, `about`) VALUES
('1', 'Remap', 'FRONT END DEVELOPER', 'Build with React Native for Front-end');
-- --------------------------------------------------------
--
-- Table structure for table `skills`
--
CREATE TABLE `skills` (
`id` varchar(13) NOT NULL,
`name` varchar(100) NOT NULL,
`percentage` int(3) NOT NULL,
`about` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `skills`
--
INSERT INTO `skills` (`id`, `name`, `percentage`, `about`) VALUES
('1', 'HTML', 90, 'HTML adalah hypertext markup language');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `biodata`
--
ALTER TABLE `biodata`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contact`
--
ALTER TABLE `contact`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `education`
--
ALTER TABLE `education`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id` (`id`),
ADD UNIQUE KEY `id_2` (`id`),
ADD KEY `id_3` (`id`);
--
-- Indexes for table `experience`
--
ALTER TABLE `experience`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `portofolio`
--
ALTER TABLE `portofolio`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `skills`
--
ALTER TABLE `skills`
ADD PRIMARY KEY (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<gh_stars>0
/* count total submissions of challenges of each user */
WITH data
AS
(
SELECT c.hacker_id as id, h.name as name, count(c.hacker_id) as counter
FROM Hackers h
JOIN Challenges c on c.hacker_id = h.hacker_id
GROUP BY c.hacker_id, h.name
)
/* select records from above */
SELECT id,name,counter
FROM data
WHERE
counter=(SELECT max(counter) FROM data) /*select user that has max count submission*/
OR
counter in (SELECT counter FROM data
GROUP BY counter
HAVING count(counter)=1 ) /*filter out the submission count which is unique*/
ORDER BY counter desc, id
|
CREATE DATABASE IF NOT EXISTS iexpresso_test;
CREATE DATABASE IF NOT EXISTS iexpresso_production;
CREATE DATABASE IF NOT EXISTS iexpresso_development;
USE iexpresso_development;
DROP TABLE IF EXISTS `Students`;
DROP TABLE IF EXISTS `Users`;
DROP TABLE IF EXISTS `RouteStop`;
DROP TABLE IF EXISTS `Routes`;
DROP TABLE IF EXISTS `Stops`;
CREATE TABLE IF NOT EXISTS `Routes` (`name` VARCHAR(255) , `createdAt` DATETIME DEFAULT now(), `updatedAt` DATETIME DEFAULT now(), PRIMARY KEY (`name`));
CREATE TABLE IF NOT EXISTS `Stops` (`name` VARCHAR(255) , `location` POINT, `createdAt` DATETIME DEFAULT now(), `updatedAt` DATETIME DEFAULT now(), PRIMARY KEY (`name`));
CREATE TABLE IF NOT EXISTS `Users` (`email` VARCHAR(255) , `role` VARCHAR(255) NOT NULL DEFAULT 'student', `password` VARCHAR(255) NOT NULL, `createdAt` DATETIME DEFAULT now(), `updatedAt` DATETIME DEFAULT now(), PRIMARY KEY (`email`));
CREATE TABLE IF NOT EXISTS `Students` (`id` VARCHAR(255) , `name` VARCHAR(255) NOT NULL, `startDate` DATETIME NOT NULL, `endDate` DATETIME NOT NULL, `createdAt` DATETIME DEFAULT now(), `updatedAt` DATETIME DEFAULT now(), `UserEmail` VARCHAR(255), PRIMARY KEY (`id`), FOREIGN KEY (`UserEmail`) REFERENCES `Users` (`email`) ON DELETE SET NULL ON UPDATE CASCADE);
CREATE TABLE IF NOT EXISTS `RouteStop` (`createdAt` DATETIME DEFAULT now(), `updatedAt` DATETIME DEFAULT now(), `StopName` VARCHAR(255) , `RouteName` VARCHAR(255) , PRIMARY KEY (`StopName`, `RouteName`), FOREIGN KEY (`StopName`) REFERENCES `Stops` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (`RouteName`) REFERENCES `Routes` (`name`) ON DELETE CASCADE ON UPDATE CASCADE);
INSERT INTO Users(email, role, password) VALUES(
'<EMAIL>',
'admin',
'$2a$10$Gw8WGWz0b96M/NTDaf7e9e0VRnyv2YpKh8ftT2QcsPmr1UfBftK5G'
), (
'<EMAIL>',
'admin',
'$2a$10$Gw8WGWz0b96M/NTDaf7e9e0VRnyv2YpKh8ftT2QcsPmr1UfBftK5G'
), (
'<EMAIL>',
'admin',
'$2a$10$Gw8WGWz0b96M/NTDaf7e9e0VRnyv2YpKh8ftT2QcsPmr1UfBftK5G'
), (
'<EMAIL>',
'admin',
'$2a$10$Gw8WGWz0b96M/NTDaf7e9e0VRnyv2YpKh8ftT2QcsPmr1UfBftK5G'
), (
'<EMAIL>',
'admin',
'$2a$10$Gw8WGWz0b96M/NTDaf7e9e0VRnyv2YpKh8ftT2QcsPmr1UfBftK5G'
), (
'<EMAIL>',
'student',
'$2a$10$Gw8WGWz0b96M/NTDaf7e9e0VRnyv2YpKh8ftT2QcsPmr1UfBftK5G'
);
-- Create students for testing
INSERT INTO Students(id, name, startDate, endDate, UserEmail) VALUES(
'A01631385',
'<NAME>',
'2015-05-02 13:05:22',
'2020-10-13 13:05:22',
'<EMAIL>'
);
-- Create admins
INSERT INTO Students(id, name, startDate, endDate, UserEmail) VALUES(
'A01631677',
'<NAME>',
'2015-05-02 13:05:22',
'2020-10-13 13:05:22',
'<EMAIL>'
), (
'A01225152',
'<NAME>',
'2015-05-02 13:05:22',
'2020-10-13 13:05:22',
'<EMAIL>'
), (
'A01228802',
'<NAME>',
'2015-05-02 13:05:22',
'2020-10-13 13:05:22',
'<EMAIL>'
), (
'A01421882',
'<NAME>',
'2015-05-02 13:05:22',
'2020-10-13 13:05:22',
'<EMAIL>'
), (
'A01226132',
'<NAME>',
'2015-05-02 13:05:22',
'2020-10-13 13:05:22',
'<EMAIL>'
);
INSERT INTO Routes(name) VALUES('Chapultepec'), ('Cañadas'), ('Ciudadela'), ('SantaAnita'), ('Guadalupe'), ('Palomar'), ('Sur'), ('Sur2');
-- -- RUTA TRÁNSITO [Not available]
-- INSERT INTO Stops(name, location) VALUES('Tránsito', GeomFromText('POINT()')),
-- ('Circunvalación y Ávila Camacho', GeomFromText('POINT()')),
-- ('Plaza Patria', GeomFromText('POINT()')),
-- ('<NAME>', GeomFromText('POINT()')),
-- ('<NAME> y <NAME>', GeomFromText('POINT()')),
-- ('Hospital Terranova', GeomFromText('POINT()')),
-- ('Restaurante La Mar', GeomFromText('POINT()')),
-- ('<NAME>', GeomFromText('POINT()')),
-- ('<NAME>', GeomFromText('POINT()')),
-- ('Chedraui', GeomFromText('POINT()'));
-- RUTA CHAPULTEPEC
INSERT IGNORE INTO Stops(name, location) VALUES('<NAME>', GeomFromText('POINT(20.6665073 -103.368906)')),
('Vallarta y Progreso', GeomFromText('POINT(20.6746732 -103.3670381)')),
('Centro Magno', GeomFromText('POINT(20.674495 -103.3793593)')),
('Plaza Bonita', GeomFromText('POINT(20.6779714 -103.4048787)')),
('Plaza Galerías', GeomFromText('POINT(20.68765 -103.4197713)')),
('Naciones Unidas y Patria', GeomFromText('POINT(20.6913151 -103.4150630)')),
('Plaza Universidad', GeomFromText('POINT(20.7000469 -103.4156384)')),
('Paseo Madrigal', GeomFromText('POINT(20.7058903 -103.4130326)')),
('Paseo Royal Country', GeomFromText('POINT(20.7094489 -103.4073544)')),
('Plaza Pabellón', GeomFromText('POINT(20.7313918 -103.4530056)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('Chapultepec', 'Glorieta Chapultepec'),
('Chapultepec', 'Vallarta y Progreso'),
('Chapultepec', 'Centro Magno'),
('Chapultepec', 'Plaza Bonita'),
('Chapultepec', 'Plaza Galerías'),
('Chapultepec', 'Naciones Unidas y Patria'),
('Chapultepec', 'Plaza Universidad'),
('Chapultepec', 'Paseo Madrigal'),
('Chapultepec', 'Paseo Royal Country'),
('Chapultepec', 'Plaza Pabellón');
-- RUTA CAÑADAS
INSERT IGNORE INTO Stops(name, location) VALUES('Cañadas', GeomFromText('POINT(20.7631766 -103.382678)')),
('Punto San Isidro', GeomFromText('POINT(20.7537261 -103.3842981)')),
('Valle de San Isidro', GeomFromText('POINT(20.7485492 -103.3855534)')),
('Jabil', GeomFromText('POINT(20.7406179 -103.3991146)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('Cañadas', 'Cañadas'),
('Cañadas', 'Punto San Isidro'),
('Cañadas', 'Valle de San Isidro'),
('Cañadas', 'Jabil');
-- RUTA SUR
INSERT IGNORE INTO Stops(name, location) VALUES('Plaza El Palomar', GeomFromText('POINT(20.5905875 -103.4426844)')),
('Bugambilias', GeomFromText('POINT(20.6819762 -103.4551359)')),
('<NAME>', GeomFromText('POINT(20.6592517 -103.4447256)')),
('<NAME>', GeomFromText('POINT(20.6590628 -103.4425322)')),
('La Calma', GeomFromText('POINT(20.6589536 -103.4405937)')),
('Plaza del Sol', GeomFromText('POINT(20.6589555 -103.4334978)')),
('<NAME>', GeomFromText('POINT(20.6617287 -103.4281414)')),
('<NAME>', GeomFromText('POINT(20.6624189 -103.4236032)')),
('Guadalupe y <NAME>', GeomFromText('POINT(20.6640351 -103.4154198)')),
('Guadalupe y <NAME>', GeomFromText('POINT(20.66531 -103.4086284)')),
('Guadalupe y Patria', GeomFromText('POINT(20.6669781 -103.4024709)')),
('Toreros', GeomFromText('POINT(20.653828 -103.40096)')),
('SRE', GeomFromText('POINT(20.6504146 -103.4031379)')),
('Super La Playa', GeomFromText('POINT(20.6343656 -103.4136656)')),
('Guadalupe y <NAME>', GeomFromText('POINT(20.6211366 -103.4224874)')),
('Guadalupe y San Lorenzo', GeomFromText('POINT(20.6015545 -103.4495186)')),
('Ciudad Judicial', GeomFromText('POINT(20.7318935 -103.4534374)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('Sur', 'Plaza El Palomar'),
('Sur', 'Bugambilias'),
('Sur', 'Las Fuentes'),
('Sur', 'Las Águilas'),
('Sur', 'La Calma'),
('Sur', 'Plaza del Sol'),
('Sur', 'Hotel Hilton'),
('Sur', 'Glorieta Chapalita'),
('Sur', 'Guadalupe y Niño Obrero'),
('Sur', 'Guadalupe y San Nicolás de Bari'),
('Sur', 'Guadalupe y Patria'),
('Sur', 'Toreros'),
('Sur', 'SRE'),
('Sur', 'Super La Playa'),
('Sur', 'Guadalupe y Santo Tomás'),
('Sur', 'Guadalupe y San Lorenzo'),
('Sur', 'Ciudad Judicial');
-- RUTA CIUDADELA
INSERT IGNORE INTO Stops(name, location) VALUES('Plaza Ciudadela', GeomFromText('POINT(20.6486428 -103.4221042)')),
('Cordilleras', GeomFromText('POINT(20.6574748 -103.4230721)')),
('Patria y Beethoven', GeomFromText('POINT(20.668821 -103.4243166)')),
('Patria y <NAME>', GeomFromText('POINT(20.6725266 -103.4230972)')),
('Galerías', GeomFromText('POINT(20.67604 -103.4294665)')),
('Los Tules', GeomFromText('POINT(20.6917617 -103.4503609)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('Ciudadela', 'Plaza Ciudadela'),
('Ciudadela', 'Cordilleras'),
('Ciudadela', '<NAME>'),
('Ciudadela', 'Patria y <NAME>'),
('Ciudadela', 'Galerías'),
('Ciudadela', 'Los Tules');
-- RUTA SANTA ANITA
INSERT IGNORE INTO Stops(name, location) VALUES('Plaza Xóchitl', GeomFromText('POINT(20.6545509 -103.406496)')),
('7 Eleven', GeomFromText('POINT(20.6456044 -103.4081537)')),
('Office Depot', GeomFromText('POINT(20.6373677 -103.4124881)')),
('Porsche', GeomFromText('POINT(20.633206 -103.4149343)')),
('Soriana Las Águilas', GeomFromText('POINT(20.6283663 -103.4182119)')),
('Starbucks Las Fuentes', GeomFromText('POINT(20.620509 -103.4233001)')),
('Bugambilias', GeomFromText('POINT(20.6014541 -103.4494114)')),
('Paseo Del Palomar', GeomFromText('POINT(20.5930782 -103.4465696)')),
('El Tajo', GeomFromText('POINT(20.581277 -103.4492451)')),
('Nueva Galicia', GeomFromText('POINT(20.5776309 -103.4441328)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('SantaAnita', 'Plaza Xóchitl'),
('SantaAnita', '7 Eleven'),
('SantaAnita', 'Office Depot'),
('SantaAnita', 'Porsche'),
('SantaAnita', 'Soriana Las Águilas'),
('SantaAnita', 'Starbucks Las Fuentes'),
('SantaAnita', 'Bugambilias'),
('SantaAnita', 'Paseo Del Palomar'),
('SantaAnita', 'El Tajo'),
('SantaAnita', 'Nueva Galicia');
-- RUTA GUADALUPE
INSERT IGNORE INTO Stops(name, location) VALUES('Glorieta Chapalita', GeomFromText('POINT(20.6662523 -103.4033794)')),
('Guadalupe y Niño Obrero', GeomFromText('POINT(20.6652692 -103.4086585)')),
('Guadalupe y San Nicolás de Bari', GeomFromText('POINT(20.664128 -103.4154224)')),
('Guadalupe y Patria', GeomFromText('POINT(20.6625017 -103.4235334)')),
('Guadalupe y Toreros', GeomFromText('POINT(20.6617037 -103.4280919)')),
('Plaza Alegra', GeomFromText('POINT(20.65870700 -103.4364295)')),
('Super La Playa', GeomFromText('POINT(20.6589831 -103.4405708)')),
('Guadalupe y Santo Tomás', GeomFromText('POINT(20.6591086 -103.4425315)')),
('Guadalupe y San Lorenzo', GeomFromText('POINT(20.6592742 -103.4447846)')),
('Ciudad Judicial', GeomFromText('POINT(20.681958 -103.4550950)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('Guadalupe', 'Glorieta Chapalita'),
('Guadalupe', 'Guadalupe y Niño Obrero'),
('Guadalupe', 'Guadalupe y San Nicolás de Bari'),
('Guadalupe', 'Guadalupe y Patria'),
('Guadalupe', 'Guadalupe y Toreros'),
('Guadalupe', 'Plaza Alegra'),
('Guadalupe', 'Super La Playa'),
('Guadalupe', 'Guadalupe y Santo Tomás'),
('Guadalupe', 'Guadalupe y San Lorenzo'),
('Guadalupe', 'Ciudad Judicial');
-- RUTA PALOMAR
INSERT IGNORE INTO Stops(name, location) VALUES('Paseo Del Palomar', GeomFromText('POINT(20.5930782 -103.4465696)')),
('Bugambilias', GeomFromText('POINT(20.6014541 -103.4494114)')),
('Las Fuentes', GeomFromText('POINT(20.6211228 -103.4224284)')),
('Las Águilas', GeomFromText('POINT(20.628409 -103.4184909)')),
('<NAME> Clouthier', GeomFromText('POINT(20.6398126 -103.4304857)')),
('<NAME> y <NAME>', GeomFromText('POINT(20.6317538 -103.4299157)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('Palomar', 'Paseo Del Palomar'),
('Palomar', 'Bugambilias'),
('Palomar', '<NAME>'),
('Palomar', 'Las Águilas'),
('Palomar', '<NAME>'),
('Palomar', '<NAME> y <NAME>');
-- RUTA SUR 2
-- FIXME: Revisar coordenadas
INSERT IGNORE INTO Stops(name, location) VALUES('Palomar', GeomFromText('POINT(20.6015094 -103.4494275)')),
('Bugambilias', GeomFromText('POINT(20.6819762 -103.4551359)')),
('Las Fuentes', GeomFromText('POINT(20.6592517 -103.4447256)')),
('Las Águilas', GeomFromText('POINT(20.6590628 -103.4425322)')),
('La Calma', GeomFromText('POINT(20.6589536 -103.4405937)')),
('Plaza del Sol', GeomFromText('POINT(20.6589555 -103.4334978)')),
('Plaza del Ángel', GeomFromText('POINT(20.6617287 -103.4281414)')),
('<NAME>', GeomFromText('POINT(20.6624189 -103.4236032)')),
('<NAME>', GeomFromText('POINT(20.6640351 -103.4154198)')),
('<NAME>', GeomFromText('POINT(20.66531 -103.4086284)')),
('Oxxo Patria', GeomFromText('POINT(20.6669781 -103.4024709)')),
('Toreros', GeomFromText('POINT(20.653828 -103.40096)')),
('SRE', GeomFromText('POINT(20.6504146 -103.4031379)')),
('La Playa', GeomFromText('POINT(20.6343656 -103.4136656)')),
('Santo Tomás', GeomFromText('POINT(20.6276672 -103.4181234)')),
('<NAME>', GeomFromText('POINT(20.6211366 -103.4224874)')),
('Ciudad Judicial', GeomFromText('POINT(20.6015545 -103.4495186)'));
INSERT INTO RouteStop(RouteName, StopName) VALUES('Sur2', 'Palomar'),
('Sur2', 'Bugambilias'),
('Sur2', 'Las Fuentes'),
('Sur2', 'Las Águilas'),
('Sur2', 'La Calma'),
('Sur2', 'Plaza del Sol'),
('Sur2', 'Plaza del Ángel'),
('Sur2', 'Glorieta Chapalita'),
('Sur2', 'Niño Obrero'),
('Sur2', 'Nicolás de Bari'),
('Sur2', 'O<NAME>'),
('Sur2', 'Toreros'),
('Sur2', 'SRE'),
('Sur2', 'La Playa'),
('Sur2', 'Santo Tomás'),
('Sur2', 'Miguel Ángel'),
('Sur2', 'Ciudad Judicial');
|
<filename>server/mysql/sharedhere.sql<gh_stars>0
CREATE DATABASE IF NOT EXISTS `sharedhere` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `sharedhere`;
-- MySQL dump 10.13 Distrib 5.5.16, for Win32 (x86)
--
-- Host: localhost Database: sharedhere
-- ------------------------------------------------------
-- Server version 5.1.59-community
/*!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 `content`
--
DROP TABLE IF EXISTS `content`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `content` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(256) DEFAULT NULL,
`timestamp` datetime DEFAULT NULL,
`filename` varchar(256) DEFAULT NULL,
`size` decimal(14,0) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `content`
--
LOCK TABLES `content` WRITE;
/*!40000 ALTER TABLE `content` DISABLE KEYS */;
/*!40000 ALTER TABLE `content` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `content_at`
--
DROP TABLE IF EXISTS `content_at`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `content_at` (
`content_id` int(11) NOT NULL,
`location_id` int(11) NOT NULL,
PRIMARY KEY (`content_id`,`location_id`),
KEY `content` (`content_id`),
KEY `location` (`location_id`),
CONSTRAINT `content` FOREIGN KEY (`content_id`) REFERENCES `content` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `location` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `content_at`
--
LOCK TABLES `content_at` WRITE;
/*!40000 ALTER TABLE `content_at` DISABLE KEYS */;
/*!40000 ALTER TABLE `content_at` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `location`
--
DROP TABLE IF EXISTS `location`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `location` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`latitude` decimal(6,4) DEFAULT NULL,
`longitude` decimal(7,4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `location`
--
LOCK TABLES `location` WRITE;
/*!40000 ALTER TABLE `location` DISABLE KEYS */;
/*!40000 ALTER TABLE `location` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `log`
--
DROP TABLE IF EXISTS `log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`op_type` enum('ContentInsert','ContentSelect','ContentDelete','LocationInsert','LocationSelect','LocationDelete') DEFAULT NULL,
`timestamp` datetime DEFAULT NULL,
`query` varchar(4096) DEFAULT NULL,
`client_name` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `log`
--
LOCK TABLES `log` WRITE;
/*!40000 ALTER TABLE `log` DISABLE KEYS */;
/*!40000 ALTER TABLE `log` 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 2012-12-05 16:15:23
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 08 Kwi 2019, 18:36
-- Wersja serwera: 10.1.32-MariaDB
-- Wersja PHP: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Baza danych: `wypozyczalniasamochodow`
--
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `administrator`
--
CREATE TABLE `administrator` (
`admin_id` int(11) NOT NULL,
`pracownik_id` int(11) DEFAULT NULL,
`login` varchar(30) CHARACTER SET utf16 COLLATE utf16_polish_ci DEFAULT NULL,
`haslo` varchar(30) CHARACTER SET utf16 COLLATE utf16_polish_ci DEFAULT NULL,
`imie` varchar(30) DEFAULT NULL,
`nazwisko` varchar(30) DEFAULT NULL,
`pesel` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `historia_udostepnien`
--
CREATE TABLE `historia_udostepnien` (
`his_udostepnienie_id` int(11) NOT NULL,
`klient_id` int(11) DEFAULT NULL,
`marka` varchar(30) DEFAULT NULL,
`model` varchar(30) DEFAULT NULL,
`rocznik` int(11) DEFAULT NULL,
`przebieg` float DEFAULT NULL,
`data_od` date DEFAULT NULL,
`data_do` date DEFAULT NULL,
`cena` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `historia_wypozyczen`
--
CREATE TABLE `historia_wypozyczen` (
`his_wypozyczenie_id` int(11) NOT NULL,
`klient_id` int(11) DEFAULT NULL,
`samochod_id` int(11) DEFAULT NULL,
`data_od` date DEFAULT NULL,
`data_do` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `klient`
--
CREATE TABLE `klient` (
`klient_id` int(11) NOT NULL,
`login` varchar(30) DEFAULT NULL,
`haslo` varchar(30) DEFAULT NULL,
`imie` varchar(30) DEFAULT NULL,
`nazwisko` varchar(30) DEFAULT NULL,
`data_urodzenia` date DEFAULT NULL,
`miejscowosc` varchar(40) DEFAULT NULL,
`pesel` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `pracownik`
--
CREATE TABLE `pracownik` (
`pracownik_id` int(11) NOT NULL,
`klient_id` int(11) DEFAULT NULL,
`login` varchar(30) DEFAULT NULL,
`haslo` varchar(30) DEFAULT NULL,
`imie` varchar(30) DEFAULT NULL,
`nazwisko` varchar(30) DEFAULT NULL,
`pesel` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `samochod`
--
CREATE TABLE `samochod` (
`samochod_id` int(11) NOT NULL,
`marka` varchar(30) DEFAULT NULL,
`model` varchar(30) DEFAULT NULL,
`rodzaj` varchar(30) NOT NULL,
`paliwo` varchar(30) NOT NULL,
`przebieg` int(11) NOT NULL,
`Cena` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `udostepnienie`
--
CREATE TABLE `udostepnienie` (
`udostepnienie_id` int(11) NOT NULL,
`klient_id` int(11) DEFAULT NULL,
`marka` varchar(30) DEFAULT NULL,
`model` varchar(30) DEFAULT NULL,
`rocznik` int(11) DEFAULT NULL,
`przebieg` float DEFAULT NULL,
`data_od` date DEFAULT NULL,
`data_do` date DEFAULT NULL,
`cena` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `wypozyczenie`
--
CREATE TABLE `wypozyczenie` (
`wypozyczenie_id` int(11) NOT NULL,
`klient_id` int(11) DEFAULT NULL,
`pracownik_id` int(11) DEFAULT NULL,
`samochod_id` int(11) DEFAULT NULL,
`data_od` date DEFAULT NULL,
`data_do` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indeksy dla zrzutów tabel
--
--
-- Indeksy dla tabeli `administrator`
--
ALTER TABLE `administrator`
ADD PRIMARY KEY (`admin_id`),
ADD KEY `pracownik_id` (`pracownik_id`);
--
-- Indeksy dla tabeli `historia_udostepnien`
--
ALTER TABLE `historia_udostepnien`
ADD PRIMARY KEY (`his_udostepnienie_id`),
ADD KEY `klient_id` (`klient_id`);
--
-- Indeksy dla tabeli `historia_wypozyczen`
--
ALTER TABLE `historia_wypozyczen`
ADD PRIMARY KEY (`his_wypozyczenie_id`),
ADD KEY `klient_id` (`klient_id`),
ADD KEY `samochod_id` (`samochod_id`);
--
-- Indeksy dla tabeli `klient`
--
ALTER TABLE `klient`
ADD PRIMARY KEY (`klient_id`);
--
-- Indeksy dla tabeli `pracownik`
--
ALTER TABLE `pracownik`
ADD PRIMARY KEY (`pracownik_id`),
ADD KEY `klient_id` (`klient_id`);
--
-- Indeksy dla tabeli `samochod`
--
ALTER TABLE `samochod`
ADD PRIMARY KEY (`samochod_id`);
--
-- Indeksy dla tabeli `udostepnienie`
--
ALTER TABLE `udostepnienie`
ADD PRIMARY KEY (`udostepnienie_id`),
ADD KEY `klient_id` (`klient_id`);
--
-- Indeksy dla tabeli `wypozyczenie`
--
ALTER TABLE `wypozyczenie`
ADD PRIMARY KEY (`wypozyczenie_id`),
ADD KEY `klient_id` (`klient_id`),
ADD KEY `samochod_id` (`samochod_id`),
ADD KEY `pracownik_id` (`pracownik_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT dla tabeli `administrator`
--
ALTER TABLE `administrator`
MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Ograniczenia dla zrzutów tabel
--
--
-- Ograniczenia dla tabeli `administrator`
--
ALTER TABLE `administrator`
ADD CONSTRAINT `administrator_ibfk_1` FOREIGN KEY (`pracownik_id`) REFERENCES `pracownik` (`pracownik_id`);
--
-- Ograniczenia dla tabeli `historia_udostepnien`
--
ALTER TABLE `historia_udostepnien`
ADD CONSTRAINT `historia_udostepnien_ibfk_1` FOREIGN KEY (`klient_id`) REFERENCES `klient` (`klient_id`);
--
-- Ograniczenia dla tabeli `historia_wypozyczen`
--
ALTER TABLE `historia_wypozyczen`
ADD CONSTRAINT `historia_wypozyczen_ibfk_1` FOREIGN KEY (`klient_id`) REFERENCES `klient` (`klient_id`),
ADD CONSTRAINT `historia_wypozyczen_ibfk_2` FOREIGN KEY (`samochod_id`) REFERENCES `samochod` (`samochod_id`);
--
-- Ograniczenia dla tabeli `pracownik`
--
ALTER TABLE `pracownik`
ADD CONSTRAINT `pracownik_ibfk_1` FOREIGN KEY (`klient_id`) REFERENCES `klient` (`klient_id`);
--
-- Ograniczenia dla tabeli `udostepnienie`
--
ALTER TABLE `udostepnienie`
ADD CONSTRAINT `udostepnienie_ibfk_1` FOREIGN KEY (`klient_id`) REFERENCES `klient` (`klient_id`);
--
-- Ograniczenia dla tabeli `wypozyczenie`
--
ALTER TABLE `wypozyczenie`
ADD CONSTRAINT `wypozyczenie_ibfk_1` FOREIGN KEY (`klient_id`) REFERENCES `klient` (`klient_id`),
ADD CONSTRAINT `wypozyczenie_ibfk_2` FOREIGN KEY (`samochod_id`) REFERENCES `samochod` (`samochod_id`),
ADD CONSTRAINT `wypozyczenie_ibfk_3` FOREIGN KEY (`pracownik_id`) REFERENCES `pracownik` (`pracownik_id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
--
-- iPeer Database
--
SET foreign_key_checks = 0;
-- --------------------------------------------------------
--
-- Table structure for table `acos`
--
DROP TABLE IF EXISTS `acos`;
CREATE TABLE IF NOT EXISTS `acos` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`parent_id` int(10) DEFAULT NULL,
`model` varchar(255) DEFAULT NULL,
`foreign_key` int(10) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`lft` int(10) DEFAULT NULL,
`rght` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
KEY `alias` (`alias`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `acos`
--
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
INSERT INTO acos (id, parent_id, model, foreign_key, alias, lft, rght) VALUES
(1,NULL,NULL,NULL,'adminpage',1,2),
(2,NULL,NULL,NULL,'controllers',3,598),
(3,2,NULL,NULL,'Pages',4,17),
(4,3,NULL,NULL,'display',5,6),
(5,3,NULL,NULL,'add',7,8),
(6,3,NULL,NULL,'edit',9,10),
(7,3,NULL,NULL,'index',11,12),
(8,3,NULL,NULL,'view',13,14),
(9,3,NULL,NULL,'delete',15,16),
(10,2,NULL,NULL,'Accesses',18,29),
(11,10,NULL,NULL,'view',19,20),
(12,10,NULL,NULL,'edit',21,22),
(13,10,NULL,NULL,'add',23,24),
(14,10,NULL,NULL,'index',25,26),
(15,10,NULL,NULL,'delete',27,28),
(16,2,NULL,NULL,'Courses',30,53),
(17,16,NULL,NULL,'daysLate',31,32),
(18,16,NULL,NULL,'index',33,34),
(19,16,NULL,NULL,'ajaxList',35,36),
(20,16,NULL,NULL,'view',37,38),
(21,16,NULL,NULL,'home',39,40),
(22,16,NULL,NULL,'add',41,42),
(23,16,NULL,NULL,'edit',43,44),
(24,16,NULL,NULL,'delete',45,46),
(25,16,NULL,NULL,'move',47,48),
(26,16,NULL,NULL,'ajax_options',49,50),
(27,16,NULL,NULL,'import',51,52),
(28,2,NULL,NULL,'Departments',54,65),
(29,28,NULL,NULL,'index',55,56),
(30,28,NULL,NULL,'view',57,58),
(31,28,NULL,NULL,'add',59,60),
(32,28,NULL,NULL,'edit',61,62),
(33,28,NULL,NULL,'delete',63,64),
(34,2,NULL,NULL,'Emailer',66,93),
(35,34,NULL,NULL,'setUpAjaxList',67,68),
(36,34,NULL,NULL,'ajaxList',69,70),
(37,34,NULL,NULL,'index',71,72),
(38,34,NULL,NULL,'write',73,74),
(39,34,NULL,NULL,'cancel',75,76),
(40,34,NULL,NULL,'view',77,78),
(41,34,NULL,NULL,'addRecipient',79,80),
(42,34,NULL,NULL,'deleteRecipient',81,82),
(43,34,NULL,NULL,'getRecipient',83,84),
(44,34,NULL,NULL,'searchByUserId',85,86),
(45,34,NULL,NULL,'add',87,88),
(46,34,NULL,NULL,'edit',89,90),
(47,34,NULL,NULL,'delete',91,92),
(48,2,NULL,NULL,'Emailtemplates',94,113),
(49,48,NULL,NULL,'setUpAjaxList',95,96),
(50,48,NULL,NULL,'ajaxList',97,98),
(51,48,NULL,NULL,'index',99,100),
(52,48,NULL,NULL,'add',101,102),
(53,48,NULL,NULL,'edit',103,104),
(54,48,NULL,NULL,'delete',105,106),
(55,48,NULL,NULL,'view',107,108),
(56,48,NULL,NULL,'displayTemplateContent',109,110),
(57,48,NULL,NULL,'displayTemplateSubject',111,112),
(58,2,NULL,NULL,'Evaltools',114,125),
(59,58,NULL,NULL,'index',115,116),
(60,58,NULL,NULL,'add',117,118),
(61,58,NULL,NULL,'edit',119,120),
(62,58,NULL,NULL,'view',121,122),
(63,58,NULL,NULL,'delete',123,124),
(64,2,NULL,NULL,'Evaluations',126,165),
(65,64,NULL,NULL,'setUpAjaxList',127,128),
(66,64,NULL,NULL,'ajaxList',129,130),
(67,64,NULL,NULL,'view',131,132),
(68,64,NULL,NULL,'index',133,134),
(69,64,NULL,NULL,'export',135,136),
(70,64,NULL,NULL,'makeEvaluation',137,138),
(71,64,NULL,NULL,'completeEvaluationRubric',139,140),
(72,64,NULL,NULL,'viewEvaluationResults',141,142),
(73,64,NULL,NULL,'studentViewEvaluationResult',143,144),
(74,64,NULL,NULL,'markEventReviewed',145,146),
(75,64,NULL,NULL,'markGradeRelease',147,148),
(76,64,NULL,NULL,'markCommentRelease',149,150),
(77,64,NULL,NULL,'changeAllCommentRelease',151,152),
(78,64,NULL,NULL,'changeAllGradeRelease',153,154),
(79,64,NULL,NULL,'viewGroupSubmissionDetails',155,156),
(80,64,NULL,NULL,'viewSurveySummary',157,158),
(81,64,NULL,NULL,'add',159,160),
(82,64,NULL,NULL,'edit',161,162),
(83,64,NULL,NULL,'delete',163,164),
(84,2,NULL,NULL,'Events',166,193),
(85,84,NULL,NULL,'postProcessData',167,168),
(86,84,NULL,NULL,'setUpAjaxList',169,170),
(87,84,NULL,NULL,'index',171,172),
(88,84,NULL,NULL,'ajaxList',173,174),
(89,84,NULL,NULL,'view',175,176),
(90,84,NULL,NULL,'add',177,178),
(91,84,NULL,NULL,'setSchedule',179,180),
(92,84,NULL,NULL,'getGroupMembers',181,182),
(93,84,NULL,NULL,'edit',183,184),
(94,84,NULL,NULL,'checkIfChanged',185,186),
(95,84,NULL,NULL,'calculateFrequency',187,188),
(96,84,NULL,NULL,'delete',189,190),
(97,84,NULL,NULL,'checkDuplicateName',191,192),
(98,2,NULL,NULL,'Faculties',194,205),
(99,98,NULL,NULL,'index',195,196),
(100,98,NULL,NULL,'view',197,198),
(101,98,NULL,NULL,'add',199,200),
(102,98,NULL,NULL,'edit',201,202),
(103,98,NULL,NULL,'delete',203,204),
(104,2,NULL,NULL,'Framework',206,221),
(105,104,NULL,NULL,'calendarDisplay',207,208),
(106,104,NULL,NULL,'tutIndex',209,210),
(107,104,NULL,NULL,'add',211,212),
(108,104,NULL,NULL,'edit',213,214),
(109,104,NULL,NULL,'index',215,216),
(110,104,NULL,NULL,'view',217,218),
(111,104,NULL,NULL,'delete',219,220),
(112,2,NULL,NULL,'Groups',222,241),
(113,112,NULL,NULL,'setUpAjaxList',223,224),
(114,112,NULL,NULL,'index',225,226),
(115,112,NULL,NULL,'ajaxList',227,228),
(116,112,NULL,NULL,'view',229,230),
(117,112,NULL,NULL,'add',231,232),
(118,112,NULL,NULL,'edit',233,234),
(119,112,NULL,NULL,'delete',235,236),
(120,112,NULL,NULL,'import',237,238),
(121,112,NULL,NULL,'export',239,240),
(122,2,NULL,NULL,'Home',242,253),
(123,122,NULL,NULL,'index',243,244),
(124,122,NULL,NULL,'add',245,246),
(125,122,NULL,NULL,'edit',247,248),
(126,122,NULL,NULL,'view',249,250),
(127,122,NULL,NULL,'delete',251,252),
(128,2,NULL,NULL,'Install',254,275),
(129,128,NULL,NULL,'index',255,256),
(130,128,NULL,NULL,'install2',257,258),
(131,128,NULL,NULL,'install3',259,260),
(132,128,NULL,NULL,'install4',261,262),
(133,128,NULL,NULL,'install5',263,264),
(134,128,NULL,NULL,'gpl',265,266),
(135,128,NULL,NULL,'add',267,268),
(136,128,NULL,NULL,'edit',269,270),
(137,128,NULL,NULL,'view',271,272),
(138,128,NULL,NULL,'delete',273,274),
(139,2,NULL,NULL,'Lti',276,287),
(140,139,NULL,NULL,'index',277,278),
(141,139,NULL,NULL,'add',279,280),
(142,139,NULL,NULL,'edit',281,282),
(143,139,NULL,NULL,'view',283,284),
(144,139,NULL,NULL,'delete',285,286),
(145,2,NULL,NULL,'Mixevals',288,305),
(146,145,NULL,NULL,'setUpAjaxList',289,290),
(147,145,NULL,NULL,'index',291,292),
(148,145,NULL,NULL,'ajaxList',293,294),
(149,145,NULL,NULL,'view',295,296),
(150,145,NULL,NULL,'add',297,298),
(151,145,NULL,NULL,'edit',299,300),
(152,145,NULL,NULL,'copy',301,302),
(153,145,NULL,NULL,'delete',303,304),
(154,2,NULL,NULL,'Oauthclients',306,317),
(155,154,NULL,NULL,'index',307,308),
(156,154,NULL,NULL,'add',309,310),
(157,154,NULL,NULL,'edit',311,312),
(158,154,NULL,NULL,'delete',313,314),
(159,154,NULL,NULL,'view',315,316),
(160,2,NULL,NULL,'Oauthtokens',318,329),
(161,160,NULL,NULL,'index',319,320),
(162,160,NULL,NULL,'add',321,322),
(163,160,NULL,NULL,'edit',323,324),
(164,160,NULL,NULL,'delete',325,326),
(165,160,NULL,NULL,'view',327,328),
(166,2,NULL,NULL,'Penalty',330,343),
(167,166,NULL,NULL,'save',331,332),
(168,166,NULL,NULL,'add',333,334),
(169,166,NULL,NULL,'edit',335,336),
(170,166,NULL,NULL,'index',337,338),
(171,166,NULL,NULL,'view',339,340),
(172,166,NULL,NULL,'delete',341,342),
(173,2,NULL,NULL,'Rubrics',344,363),
(174,173,NULL,NULL,'postProcess',345,346),
(175,173,NULL,NULL,'setUpAjaxList',347,348),
(176,173,NULL,NULL,'index',349,350),
(177,173,NULL,NULL,'ajaxList',351,352),
(178,173,NULL,NULL,'view',353,354),
(179,173,NULL,NULL,'add',355,356),
(180,173,NULL,NULL,'edit',357,358),
(181,173,NULL,NULL,'copy',359,360),
(182,173,NULL,NULL,'delete',361,362),
(183,2,NULL,NULL,'Searchs',364,391),
(184,183,NULL,NULL,'update',365,366),
(185,183,NULL,NULL,'index',367,368),
(186,183,NULL,NULL,'searchEvaluation',369,370),
(187,183,NULL,NULL,'searchResult',371,372),
(188,183,NULL,NULL,'searchInstructor',373,374),
(189,183,NULL,NULL,'eventBoxSearch',375,376),
(190,183,NULL,NULL,'formatSearchEvaluation',377,378),
(191,183,NULL,NULL,'formatSearchInstructor',379,380),
(192,183,NULL,NULL,'formatSearchEvaluationResult',381,382),
(193,183,NULL,NULL,'add',383,384),
(194,183,NULL,NULL,'edit',385,386),
(195,183,NULL,NULL,'view',387,388),
(196,183,NULL,NULL,'delete',389,390),
(197,2,NULL,NULL,'Simpleevaluations',392,411),
(198,197,NULL,NULL,'postProcess',393,394),
(199,197,NULL,NULL,'setUpAjaxList',395,396),
(200,197,NULL,NULL,'index',397,398),
(201,197,NULL,NULL,'ajaxList',399,400),
(202,197,NULL,NULL,'view',401,402),
(203,197,NULL,NULL,'add',403,404),
(204,197,NULL,NULL,'edit',405,406),
(205,197,NULL,NULL,'copy',407,408),
(206,197,NULL,NULL,'delete',409,410),
(207,2,NULL,NULL,'Surveygroups',412,443),
(208,207,NULL,NULL,'postProcess',413,414),
(209,207,NULL,NULL,'setUpAjaxList',415,416),
(210,207,NULL,NULL,'index',417,418),
(211,207,NULL,NULL,'ajaxList',419,420),
(212,207,NULL,NULL,'makegroups',421,422),
(213,207,NULL,NULL,'makegroupssearch',423,424),
(214,207,NULL,NULL,'maketmgroups',425,426),
(215,207,NULL,NULL,'savegroups',427,428),
(216,207,NULL,NULL,'release',429,430),
(217,207,NULL,NULL,'delete',431,432),
(218,207,NULL,NULL,'edit',433,434),
(219,207,NULL,NULL,'changegroupset',435,436),
(220,207,NULL,NULL,'export',437,438),
(221,207,NULL,NULL,'add',439,440),
(222,207,NULL,NULL,'view',441,442),
(223,2,NULL,NULL,'Surveys',444,473),
(224,223,NULL,NULL,'setUpAjaxList',445,446),
(225,223,NULL,NULL,'index',447,448),
(226,223,NULL,NULL,'ajaxList',449,450),
(227,223,NULL,NULL,'view',451,452),
(228,223,NULL,NULL,'add',453,454),
(229,223,NULL,NULL,'edit',455,456),
(230,223,NULL,NULL,'copy',457,458),
(231,223,NULL,NULL,'delete',459,460),
(232,223,NULL,NULL,'questionsSummary',461,462),
(233,223,NULL,NULL,'moveQuestion',463,464),
(234,223,NULL,NULL,'removeQuestion',465,466),
(235,223,NULL,NULL,'addQuestion',467,468),
(236,223,NULL,NULL,'editQuestion',469,470),
(237,223,NULL,NULL,'surveyAccess',471,472),
(238,2,NULL,NULL,'Sysparameters',474,489),
(239,238,NULL,NULL,'setUpAjaxList',475,476),
(240,238,NULL,NULL,'index',477,478),
(241,238,NULL,NULL,'ajaxList',479,480),
(242,238,NULL,NULL,'view',481,482),
(243,238,NULL,NULL,'add',483,484),
(244,238,NULL,NULL,'edit',485,486),
(245,238,NULL,NULL,'delete',487,488),
(246,2,NULL,NULL,'Upgrade',490,503),
(247,246,NULL,NULL,'index',491,492),
(248,246,NULL,NULL,'step2',493,494),
(249,246,NULL,NULL,'add',495,496),
(250,246,NULL,NULL,'edit',497,498),
(251,246,NULL,NULL,'view',499,500),
(252,246,NULL,NULL,'delete',501,502),
(253,2,NULL,NULL,'Users',504,543),
(254,253,NULL,NULL,'ajaxList',505,506),
(255,253,NULL,NULL,'index',507,508),
(256,253,NULL,NULL,'goToClassList',509,510),
(257,253,NULL,NULL,'determineIfStudentFromThisData',511,512),
(258,253,NULL,NULL,'view',513,514),
(259,253,NULL,NULL,'add',515,516),
(260,253,NULL,NULL,'enrol',517,518),
(261,253,NULL,NULL,'readd',519,520),
(262,253,NULL,NULL,'edit',521,522),
(263,253,NULL,NULL,'editProfile',523,524),
(264,253,NULL,NULL,'delete',525,526),
(265,253,NULL,NULL,'checkDuplicateName',527,528),
(266,253,NULL,NULL,'resetPassword',529,530),
(267,253,NULL,NULL,'resetPasswordWithoutEmail',531,532),
(268,253,NULL,NULL,'import',533,534),
(269,253,NULL,NULL,'merge',535,536),
(270,253,NULL,NULL,'ajax_merge',537,538),
(271,253,NULL,NULL,'update',539,540),
(272,253,NULL,NULL,'showEvents',541,542),
(273,2,NULL,NULL,'V1',544,579),
(274,273,NULL,NULL,'oauth',545,546),
(275,273,NULL,NULL,'oauth_error',547,548),
(276,273,NULL,NULL,'users',549,550),
(277,273,NULL,NULL,'courses',551,552),
(278,273,NULL,NULL,'groups',553,554),
(279,273,NULL,NULL,'groupMembers',555,556),
(280,273,NULL,NULL,'events',557,558),
(281,273,NULL,NULL,'grades',559,560),
(282,273,NULL,NULL,'departments',561,562),
(283,273,NULL,NULL,'courseDepartments',563,564),
(284,273,NULL,NULL,'userEvents',565,566),
(285,273,NULL,NULL,'enrolment',567,568),
(286,273,NULL,NULL,'add',569,570),
(287,273,NULL,NULL,'edit',571,572),
(288,273,NULL,NULL,'index',573,574),
(289,273,NULL,NULL,'view',575,576),
(290,273,NULL,NULL,'delete',577,578),
(291,2,NULL,NULL,'Guard',580,597),
(292,291,NULL,NULL,'Guard',581,596),
(293,292,NULL,NULL,'login',582,583),
(294,292,NULL,NULL,'logout',584,585),
(295,292,NULL,NULL,'add',586,587),
(296,292,NULL,NULL,'edit',588,589),
(297,292,NULL,NULL,'index',590,591),
(298,292,NULL,NULL,'view',592,593),
(299,292,NULL,NULL,'delete',594,595),
(300,NULL,NULL,NULL,'functions',599,664),
(301,300,NULL,NULL,'user',600,627),
(302,301,NULL,NULL,'superadmin',601,602),
(303,301,NULL,NULL,'admin',603,604),
(304,301,NULL,NULL,'instructor',605,606),
(305,301,NULL,NULL,'tutor',607,608),
(306,301,NULL,NULL,'student',609,610),
(307,301,NULL,NULL,'import',611,612),
(308,301,NULL,NULL,'password_reset',613,624),
(309,308,NULL,NULL,'superadmin',614,615),
(310,308,NULL,NULL,'admin',616,617),
(311,308,NULL,NULL,'instructor',618,619),
(312,308,NULL,NULL,'tutor',620,621),
(313,308,NULL,NULL,'student',622,623),
(314,301,NULL,NULL,'index',625,626),
(315,300,NULL,NULL,'role',628,639),
(316,315,NULL,NULL,'superadmin',629,630),
(317,315,NULL,NULL,'admin',631,632),
(318,315,NULL,NULL,'instructor',633,634),
(319,315,NULL,NULL,'tutor',635,636),
(320,315,NULL,NULL,'student',637,638),
(321,300,NULL,NULL,'evaluation',640,641),
(322,300,NULL,NULL,'email',642,649),
(323,322,NULL,NULL,'allUsers',643,644),
(324,322,NULL,NULL,'allGroups',645,646),
(325,322,NULL,NULL,'allCourses',647,648),
(326,300,NULL,NULL,'emailtemplate',650,651),
(327,300,NULL,NULL,'viewstudentresults',652,653),
(328,300,NULL,NULL,'viewemailaddresses',654,655),
(329,300,NULL,NULL,'superadmin',656,657),
(330,300,NULL,NULL,'coursemanager',658,659),
(331,300,NULL,NULL,'viewusername',660,661),
(332,300,NULL,NULL,'submitstudenteval',662,663),
(333,84,NULL,NULL,'export',193,194),
(334,84,NULL,NULL,'import',195,196);
-- --------------------------------------------------------
--
-- Table structure for table `aros`
--
DROP TABLE IF EXISTS `aros`;
CREATE TABLE IF NOT EXISTS `aros` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`parent_id` int(10) DEFAULT NULL,
`model` varchar(255) DEFAULT NULL,
`foreign_key` int(10) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`lft` int(10) DEFAULT NULL,
`rght` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `aros`
--
INSERT INTO `aros` (`id`, `parent_id`, `model`, `foreign_key`, `alias`, `lft`, `rght`) VALUES
(1, NULL, 'Role', 1, NULL, 1, 2),
(2, NULL, 'Role', 2, NULL, 3, 4),
(3, NULL, 'Role', 3, NULL, 5, 6),
(4, NULL, 'Role', 4, NULL, 7, 8),
(5, NULL, 'Role', 5, NULL, 9, 10);
-- --------------------------------------------------------
--
-- Table structure for table `aros_acos`
--
DROP TABLE IF EXISTS `aros_acos`;
CREATE TABLE IF NOT EXISTS `aros_acos` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`aro_id` int(10) NOT NULL,
`aco_id` int(10) NOT NULL,
`_create` varchar(2) NOT NULL DEFAULT '0',
`_read` varchar(2) NOT NULL DEFAULT '0',
`_update` varchar(2) NOT NULL DEFAULT '0',
`_delete` varchar(2) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `ARO_ACO_KEY` (`aro_id`,`aco_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `aros_acos`
--
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
INSERT INTO aros_acos (id, aro_id, aco_id, _create, _read, _update, _delete) VALUES
(1,1,2,'1','1','1','1'),
(2,1,300,'1','1','1','1'),
(3,1,1,'1','1','1','1'),
(4,2,2,'-1','-1','-1','-1'),
(5,2,122,'1','1','1','1'),
(6,2,16,'1','1','1','1'),
(7,2,28,'1','1','1','1'),
(8,2,31,'-1','-1','-1','-1'),
(9,2,30,'-1','-1','-1','-1'),
(10,2,33,'-1','-1','-1','-1'),
(11,2,32,'-1','-1','-1','-1'),
(12,2,29,'-1','-1','-1','-1'),
(13,2,34,'1','1','1','1'),
(14,2,48,'1','1','1','1'),
(15,2,58,'1','1','1','1'),
(16,2,64,'1','1','1','1'),
(17,2,84,'1','1','1','1'),
(18,2,112,'1','1','1','1'),
(19,2,145,'1','1','1','1'),
(20,2,173,'1','1','1','1'),
(21,2,197,'1','1','1','1'),
(22,2,223,'1','1','1','1'),
(23,2,207,'1','1','1','1'),
(24,2,253,'1','1','1','1'),
(25,2,267,'-1','-1','-1','-1'),
(26,2,294,'1','1','1','1'),
(27,2,300,'-1','-1','-1','-1'),
(28,2,326,'1','1','1','1'),
(29,2,321,'1','1','1','1'),
(30,2,323,'1','1','1','1'),
(31,2,301,'1','1','1','1'),
(32,2,303,'1','1','1','-1'),
(33,2,302,'-1','-1','-1','-1'),
(34,2,328,'1','1','1','1'),
(35,2,331,'1','1','1','1'),
(36,2,330,'1','1','1','1'),
(37,2,329,'-1','-1','-1','-1'),
(38,2,332,'1','1','1','1'),
(39,3,2,'-1','-1','-1','-1'),
(40,3,122,'1','1','1','1'),
(41,3,16,'1','1','1','1'),
(42,3,34,'1','1','1','1'),
(43,3,48,'1','1','1','1'),
(44,3,58,'1','1','1','1'),
(45,3,64,'1','1','1','1'),
(46,3,84,'1','1','1','1'),
(47,3,112,'1','1','1','1'),
(48,3,145,'1','1','1','1'),
(49,3,173,'1','1','1','1'),
(50,3,197,'1','1','1','1'),
(51,3,223,'1','1','1','1'),
(52,3,207,'1','1','1','1'),
(53,3,253,'1','1','1','1'),
(54,3,294,'1','1','1','1'),
(55,3,156,'1','1','1','1'),
(56,3,158,'1','1','1','1'),
(57,3,162,'1','1','1','1'),
(58,3,164,'1','1','1','1'),
(59,3,269,'-1','-1','-1','-1'),
(60,3,272,'1','1','1','1'),
(61,3,267,'-1','-1','-1','-1'),
(62,3,300,'-1','-1','-1','-1'),
(63,3,321,'1','1','-1','-1'),
(64,3,301,'1','1','1','1'),
(65,3,303,'-1','-1','-1','-1'),
(66,3,302,'-1','-1','-1','-1'),
(67,3,304,'-1','1','-1','-1'),
(68,3,314,'-1','-1','-1','-1'),
(69,3,328,'-1','-1','-1','-1'),
(70,3,329,'-1','-1','-1','-1'),
(71,3,330,'1','1','1','1'),
(72,3,332,'-1','-1','-1','-1'),
(73,4,2,'-1','-1','-1','-1'),
(74,4,122,'1','1','1','1'),
(75,4,16,'-1','-1','-1','-1'),
(76,4,34,'-1','-1','-1','-1'),
(77,4,48,'-1','-1','-1','-1'),
(78,4,58,'-1','-1','-1','-1'),
(79,4,84,'-1','-1','-1','-1'),
(80,4,112,'-1','-1','-1','-1'),
(81,4,145,'-1','-1','-1','-1'),
(82,4,173,'-1','-1','-1','-1'),
(83,4,197,'-1','-1','-1','-1'),
(84,4,223,'-1','-1','-1','-1'),
(85,4,207,'-1','-1','-1','-1'),
(86,4,253,'-1','-1','-1','-1'),
(87,4,294,'1','1','1','1'),
(88,4,70,'1','1','1','1'),
(89,4,73,'1','1','1','1'),
(90,4,71,'1','1','1','1'),
(91,4,263,'1','1','1','1'),
(92,4,300,'-1','-1','-1','-1'),
(93,4,328,'-1','-1','-1','-1'),
(94,4,329,'-1','-1','-1','-1'),
(95,5,2,'-1','-1','-1','-1'),
(96,5,122,'1','1','1','1'),
(97,5,16,'-1','-1','-1','-1'),
(98,5,34,'-1','-1','-1','-1'),
(99,5,48,'-1','-1','-1','-1'),
(100,5,58,'-1','-1','-1','-1'),
(101,5,84,'-1','-1','-1','-1'),
(102,5,112,'-1','-1','-1','-1'),
(103,5,145,'-1','-1','-1','-1'),
(104,5,173,'-1','-1','-1','-1'),
(105,5,197,'-1','-1','-1','-1'),
(106,5,223,'-1','-1','-1','-1'),
(107,5,207,'-1','-1','-1','-1'),
(108,5,253,'-1','-1','-1','-1'),
(109,5,294,'1','1','1','1'),
(110,5,70,'1','1','1','1'),
(111,5,73,'1','1','1','1'),
(112,5,71,'1','1','1','1'),
(113,5,263,'1','1','1','1'),
(114,5,156,'1','1','1','1'),
(115,5,158,'1','1','1','1'),
(116,5,162,'1','1','1','1'),
(117,5,164,'1','1','1','1'),
(118,5,300,'-1','-1','-1','-1'),
(119,5,327,'1','1','1','1'),
(120,5,328,'-1','-1','-1','-1'),
(121,5,329,'-1','-1','-1','-1');
-- --------------------------------------------------------
--
-- Table structure for table `courses`
--
DROP TABLE IF EXISTS `courses`;
CREATE TABLE `courses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`course` varchar(80) NOT NULL default '',
`title` varchar(80) default NULL,
`homepage` varchar(100) default NULL,
`self_enroll` varchar(3) default 'off',
`password` varchar(25) default NULL,
`record_status` varchar(1) NOT NULL default 'A',
`creator_id` int(11) NOT NULL default '0',
`created` datetime,
`updater_id` int(11) default NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `course` (`course`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `courses`
--
INSERT INTO `courses` (`id`, `course`, `title`, `homepage`, `self_enroll`, `password`, `record_status`, `creator_id`, `created`, `updater_id`, `modified`) VALUES
(1, 'MECH 328', 'Mechanical Engineering Design Project', 'http://www.mech.ubc.ca', 'off', NULL, 'A', 1, '2006-06-20 14:14:45', NULL, '2006-06-20 14:14:45'),
(2, 'APSC 201', 'Technical Communication', 'http://www.apsc.ubc.ca', 'off', NULL, 'A', 1, '2006-06-20 14:15:38', NULL, '2006-06-20 14:39:31'),
(3, 'CPSC 101', 'Connecting with Computer Science', 'http://www.ugrad.cs.ubc.ca/~cs101/', 'off', NULL, 'I', 1, '2006-06-20 00:00:00', NULL, NULL),
(4, 'CPSC 404', 'Advanced Software Engineering', 'http://www.ugrad.cs.ubc.ca/~cs404/', 'off', NULL, 'A', 1, '2014-12-15 00:00:00', NULL, '2014-12-15 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(80) NOT NULL,
`password` varchar(80) NOT NULL DEFAULT '',
`first_name` varchar(80) DEFAULT '',
`last_name` varchar(80) DEFAULT '',
`student_no` varchar(30) DEFAULT '',
`title` varchar(80) DEFAULT '',
-- The maximum length for an email address is 254 chars by RFC3696 errata
`email` varchar(254) DEFAULT '',
`last_login` datetime,
`last_logout` datetime,
`last_accessed` varchar(10) DEFAULT NULL,
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
`lti_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE (`lti_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `first_name`, `last_name`, `student_no`, `title`, `email`, `last_login`, `last_logout`, `last_accessed`, `record_status`, `creator_id`, `created`, `updater_id`, `modified`, `lti_id`) VALUES
(1, 'root', '<PASSWORD>', 'Super', 'Admin', NULL, NULL, '', NULL, NULL, NULL, 'A', 1, NOW(), NULL, NOW(), NULL),
(2, 'instructor1', '<PASSWORD>', 'Instructor', '1', NULL, 'Instructor', '<EMAIL>', NULL, NULL, NULL, 'A', 1, '2006-06-19 16:25:24', NULL, '2006-06-19 16:25:24', NULL),
(3, 'instructor2', '<PASSWORD>', 'Instructor', '2', NULL, 'Professor', '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:17:02', NULL, '2006-06-20 14:17:02', NULL),
(4, 'instructor3', 'b17c3f638781ecd22648b509e138c00f', 'Instructor', '3', NULL, 'Assistant Professor', '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:17:53', NULL, '2006-06-20 14:17:53', NULL),
(5, 'redshirt0001', 'b17c3f638781ecd22648b509e138c00f', 'Ed', 'Student', '65498451', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:19:18', NULL, '2006-06-20 14:19:18', NULL),
(6, 'redshirt0002', 'b17c3f638781ecd22648b509e138c00f', 'Alex', 'Student', '65468188', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:26:59', NULL, '2006-06-20 14:26:59', NULL),
(7, 'redshirt0003', 'b17c3f638781ecd22648b509e138c00f', 'Matt', 'Student', '98985481', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:27:24', NULL, '2006-06-20 14:27:24', NULL),
(8, 'redshirt0004', 'b17c3f638781ecd22648b509e138c00f', 'Chris', 'Student', '16585158', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:27:43', NULL, '2006-06-20 14:27:43', NULL),
(9, 'redshirt0005', 'b17c3f638781ecd22648b509e138c00f', 'Johnny', 'Student', '81121651', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:28:08', NULL, '2006-06-20 14:28:08', NULL),
(10, 'redshirt0006', 'b17c3f638781ecd22648b509e138c00f', 'Travis', 'Student', '87800283', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:28:29', NULL, '2006-06-20 14:28:29', NULL),
(11, 'redshirt0007', 'b17c3f638781ecd22648b509e138c00f', 'Kelly', 'Student', '68541180', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:28:49', NULL, '2006-06-20 14:28:49', NULL),
(12, 'redshirt0008', 'b17c3f638781ecd22648b509e138c00f', 'Peter', 'Student', '48451389', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:29:07', NULL, '2006-06-20 14:29:07', NULL),
(13, 'redshirt0009', 'b17c3f638781ecd22648b509e138c00f', 'Damien', 'Student', '84188465', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:31:17', NULL, '2006-06-20 14:31:17', NULL),
(14, 'redshirt0010', 'b17c3f638781ecd22648b509e138c00f', 'Hajar', 'Student', '27701036', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 14:47:34', NULL, '2006-06-20 14:47:34', NULL),
(15, 'redshirt0011', 'b17c3f638781ecd22648b509e138c00f', 'Jennifer', 'Student', '48877031', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:00:35', NULL, '2006-06-20 15:00:35', NULL),
(16, 'redshirt0012', 'b17c3f638781ecd22648b509e138c00f', 'Chad', 'Student', '25731063', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:01:09', NULL, '2006-06-20 15:01:09', NULL),
(17, 'redshirt0013', 'b17c3f638781ecd22648b509e138c00f', 'Edna', 'Student', '37116036', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:01:24', NULL, '2006-06-20 15:01:24', NULL),
(18, 'redshirt0014', 'b17c3f638781ecd22648b509e138c00f', 'Denny', 'Student', '76035030', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:01:52', NULL, '2006-06-20 15:01:52', NULL),
(19, 'redshirt0015', 'b17c3f638781ecd22648b509e138c00f', 'Jonathan', 'Student', '90938044', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:02:20', NULL, '2006-06-20 15:02:20', NULL),
(20, 'redshirt0016', 'b17c3f638781ecd22648b509e138c00f', 'Soroush', 'Student', '88505045', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:03:27', NULL, '2006-06-20 15:03:27', NULL),
(21, 'redshirt0017', 'b17c3f638781ecd22648b509e138c00f', 'Nicole', 'Student', '22784037', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:03:47', NULL, '2006-06-20 15:03:47', NULL),
(22, 'redshirt0018', 'b17c3f638781ecd22648b509e138c00f', 'Vivian', 'Student', '37048022', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:04:22', NULL, '2006-06-20 15:04:22', NULL),
(23, 'redshirt0019', 'b17c3f638781ecd22648b509e138c00f', 'Trevor', 'Student', '89947048', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:05:55', NULL, '2006-06-20 15:05:55', NULL),
(24, 'redshirt0020', 'b17c3f638781ecd22648b509e138c00f', 'Michael', 'Student', '39823059', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:06:20', NULL, '2006-06-20 15:06:20', NULL),
(25, 'redshirt0021', 'b17c3f638781ecd22648b509e138c00f', 'Steven', 'Student', '35644039', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:06:46', NULL, '2006-06-20 15:06:46', NULL),
(26, 'redshirt0022', 'b17c3f638781ecd22648b509e138c00f', 'Bill', 'Student', '19524032', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:07:01', NULL, '2006-06-20 15:07:01', NULL),
(27, 'redshirt0023', 'b17c3f638781ecd22648b509e138c00f', '<NAME>', 'Student', '40289059', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:07:37', NULL, '2006-06-20 15:07:37', NULL),
(28, 'redshirt0024', 'b17c3f638781ecd22648b509e138c00f', 'Michael', 'Student', '38058020', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:08:04', NULL, '2006-06-20 15:08:04', NULL),
(29, 'redshirt0025', 'b17c3f638781ecd22648b509e138c00f', 'Jonathan', 'Student', '38861035', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:08:31', NULL, '2006-06-20 15:08:31', NULL),
(30, 'redshirt0026', 'b17c3f638781ecd22648b509e138c00f', 'Geoff', 'Student', '27879030', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:08:47', NULL, '2006-06-20 15:08:47', NULL),
(31, 'redshirt0027', 'b17c3f638781ecd22648b509e138c00f', 'Hui', 'Student', '10186039', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:10:16', NULL, '2006-06-20 15:10:16', NULL),
(32, 'redshirt0028', 'b17c3f638781ecd22648b509e138c00f', 'Bowinn', 'Student', '19803030', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-20 15:10:32', NULL, '2006-06-20 15:10:32', NULL),
(33, 'redshirt0029', 'b17c3f638781ecd22648b509e138c00f', 'Joe', 'Student', '51516498', NULL, '', NULL, NULL, NULL, 'A', 1, '2006-06-21 08:44:09', 33, '2006-06-21 08:45:00', NULL),
(34, 'admin1', '<PASSWORD>', '', '', '', '', '', NULL, NULL, NULL, 'A', 1, '2012-05-25 15:48:08', 1, '2012-05-25 15:48:08', NULL),
(35, 'tutor1', 'b<PASSWORD>', 'Tutor', '1', '', '', '', NULL, NULL, NULL, 'A', 1, '2012-05-25 15:48:08', 1, '2012-05-25 15:48:08', NULL),
(36, 'tutor2', 'b17c3f638781ecd22648b509e138c00f', 'Tutor', '2', '', '', '', NULL, NULL, NULL, 'A', 1, '2012-05-25 15:48:08', 1, '2012-05-25 15:48:08', NULL),
(37, 'tutor3', 'b17c3f638781ecd<PASSWORD>8<PASSWORD>', 'Tutor', '3', '', '', '', NULL, NULL, NULL, 'A', 1, '2012-05-25 15:48:08', 1, '2012-05-25 15:48:08', NULL),
(38, 'admin2', '<PASSWORD>', '', '', '', '', '', NULL, NULL, NULL, 'A', 1, '2012-05-25 15:48:08', 1, '2012-05-25 15:48:08', NULL),
(39, 'admin3', '<PASSWORD>638781<PASSWORD>648<PASSWORD>', '', '', '', '', '', NULL, NULL, NULL, 'A', 1, '2014-12-15 00:00:00', 1, '2014-12-16 00:00:00', NULL),
(40, 'admin4', '<PASSWORD>', '', '', '', '', '', NULL, NULL, NULL, 'A', 1, '2014-12-15 00:00:00', 1, '2014-12-16 00:00:00', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `faculties`
--
DROP TABLE IF EXISTS `faculties`;
CREATE TABLE IF NOT EXISTS `faculties` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(80) NOT NULL,
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `faculties`
--
INSERT INTO `faculties` (`id`, `name`, `creator_id`, `created`, `updater_id`, `modified`) VALUES
(1, 'Applied Science', 0, NOW(), NULL, '2012-05-23 11:29:58'),
(2, 'Science', 0, NOW(), NULL, '2012-05-23 11:30:05');
-- --------------------------------------------------------
--
-- Table structure for table `departments`
--
DROP TABLE IF EXISTS `departments`;
CREATE TABLE IF NOT EXISTS `departments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(80) NOT NULL,
`faculty_id` int NOT NULL,
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
FOREIGN KEY (`faculty_id`) REFERENCES `faculties` (`id`) ON DELETE CASCADE,
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `departments`
--
INSERT INTO `departments` (`id`, `name`, `faculty_id`, `creator_id`, `created`, `updater_id`, `modified`) VALUES
(1, 'MECH', 1, 0, NOW(), NULL, '2012-05-23 11:30:41'),
(2, 'APSC', 1, 0, NOW(), NULL, '2012-05-23 11:30:57'),
(3, 'CPSC', 2, 0, NOW(), NULL, '2012-05-23 11:31:07');
-- --------------------------------------------------------
--
-- Table structure for table `course_departments`
--
DROP TABLE IF EXISTS `course_departments`;
CREATE TABLE `course_departments` (
`id` int NOT NULL AUTO_INCREMENT,
`course_id` int NOT NULL,
`department_id` int NOT NULL,
FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `course_departments`
--
INSERT INTO `course_departments` (`id`, `course_id`, `department_id`) VALUES
(1, 2, 2),
(2, 1, 1),
(3, 3, 3),
(4, 3, 2),
(5, 4, 3);
-- --------------------------------------------------------
--
-- Table structure for table `email_merges`
--
DROP TABLE IF EXISTS `email_merges`;
CREATE TABLE IF NOT EXISTS `email_merges` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(80) NOT NULL,
`value` varchar(80) NOT NULL,
`table_name` varchar(80) NOT NULL,
`field_name` varchar(80) NOT NULL,
`created` datetime,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `email_merges`
--
INSERT INTO `email_merges` (`id`, `key`, `value`, `table_name`, `field_name`, `created`, `modified`) VALUES
(1, 'Username', '{{{USERNAME}}}', 'User', 'username', NOW(), NOW()),
(2, 'First Name', '{{{FIRSTNAME}}}', 'User', 'first_name', NOW(), NOW()),
(3, 'Last Name', '{{{LASTNAME}}}', 'User', 'last_name', NOW(), NOW()),
(4, 'Email Address', '{{{Email}}}', 'User', 'email', NOW(), NOW()),
(5, 'Course Name', '{{{COURSENAME}}}', 'Course', 'course', NOW(), NOW()),
(6, 'Event Title', '{{{EVENTTITLE}}}', 'Event', 'title', NOW(), NOW()),
(7, 'Event Due Date', '{{{DUEDATE}}}', 'Event', 'due_date', NOW(), NOW()),
(8, 'Event Close Date', '{{{CLOSEDATE}}}', 'Event', 'release_date_end', NOW(), NOW());
-- --------------------------------------------------------
--
-- Table structure for table `email_schedules`
--
DROP TABLE IF EXISTS `email_schedules`;
CREATE TABLE IF NOT EXISTS `email_schedules` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`subject` varchar(80) NOT NULL,
`content` text NOT NULL,
`date` datetime,
`from` varchar(80) NOT NULL,
`to` text NOT NULL,
`course_id` int(11) DEFAULT NULL,
`event_id` int(11) DEFAULT NULL,
`grp_id` int(11) DEFAULT NULL,
`sent` tinyint(1) NOT NULL DEFAULT '0',
`creator_id` int(11) NOT NULL,
`created` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `email_schedules`
--
INSERT INTO `email_schedules` (`id`, `subject`, `content`, `date`, `from`, `to`, `course_id`, `event_id`, `grp_id`, `sent`, `creator_id`, `created`) VALUES
(1, 'Email Template', 'Hello, {{{FIRSTNAME}}}', CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 1 YEAR)), '-07-18 16:52:31'), '1', '5;6;7;13;15;17;19;21;26;28;31;32;33', NULL, NULL, NULL, 0, 1, '2012-07-16 16:52:50'),
(2, 'Email Template', 'Hello, {{{USERNAME}}}', '2011-07-18 16:52:31', '1', '5;6;7;13;15;17;19;21;26;28;31;32;33', NULL, NULL, NULL, 0, 1, '2010-07-16 16:57:50'),
(3, 'Email Template', 'Hi, {{{USERNAME}}}', '2011-07-18 17:52:31', '1', '5;6;7;13;15;17;19;21;26;28;31;32;33', NULL, NULL, NULL, 1, 1, '2010-07-16 16:57:50');
-- --------------------------------------------------------
--
-- Table structure for table `email_templates`
--
DROP TABLE IF EXISTS `email_templates`;
CREATE TABLE IF NOT EXISTS `email_templates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(80) NOT NULL,
`description` text NOT NULL,
`subject` varchar(80) NOT NULL,
`content` text NOT NULL,
`availability` tinyint(4) NOT NULL,
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`updated` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `email_templates`
--
INSERT INTO `email_templates` (`id`, `name`, `description`, `subject`, `content`, `availability`, `creator_id`, `created`, `updater_id`, `updated`) VALUES
(2, 'Email template example', 'This is an email template example', 'Email Template', 'Hello, {{{USERNAME}}}',1, 1, NOW(), NULL, NULL),
(3, 'Email template example2', 'email template ex2', 'Email Template2', 'Hello, {{{FIRSTNAME}}}',1, 2, NOW(), NULL, NULL),
(4, 'Email template example3', 'email temp example3', 'Email Template3', 'Hello,',1, 3, NOW(), NULL, NULL),
(5, 'Evaluation Reminder Template', 'evaluation reminder template', 'iPeer Evaluation Reminder', 'Hello {{{FIRSTNAME}}},\n\nA evaluation for {{{COURSENAME}}} is made available to you in iPeer, which has yet to be completed.\n\nName: {{{EVENTTITLE}}}\nDue Date: {{{DUEDATE}}}\nClose Date: {{{CLOSEDATE}}}\n\nThank You', 1, 1, NOW(), NULL, NULL),
(6, 'MECH 328 Evaluation Reminder Template', 'MECH 328 evaluation reminder template', 'MECH 328 - iPeer Evaluation Reminder', 'Hello {{{FIRSTNAME}}},\n\nA evaluation for {{{COURSENAME}}} is made available to you in iPeer, which has yet to be completed.\n\nName: {{{EVENTTITLE}}}\nDue Date: {{{DUEDATE}}}\nClose Date: {{{CLOSEDATE}}}\n\nThank You', 1, 1, NOW(), NULL, NULL),
(7, 'MECH 328 Survey Reminder Template', 'MECH 328 survey reminder template', 'MECH 328 - iPeer Survey Reminder', 'Hello {{{FIRSTNAME}}},\n\nA evaluation for {{{COURSENAME}}} is made available to you in iPeer, which has yet to be completed.\n\nName: {{{EVENTTITLE}}}\nDue Date: {{{DUEDATE}}}\nClose Date: {{{CLOSEDATE}}}\n\nThank You', 1, 1, NOW(), NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `evaluation_mixeval_details`
--
DROP TABLE IF EXISTS `evaluation_mixeval_details`;
CREATE TABLE IF NOT EXISTS `evaluation_mixeval_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`evaluation_mixeval_id` int(11) NOT NULL DEFAULT '0',
`question_number` int(11) NOT NULL DEFAULT '0',
`question_comment` text,
`selected_lom` int(11) NOT NULL DEFAULT '0',
`grade` double(12,2) NOT NULL DEFAULT '0.00',
`comment_release` int(1) NOT NULL DEFAULT '0',
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `evaluation_mixeval_id` (`evaluation_mixeval_id`,`question_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `evaluation_mixeval_details`
--
INSERT INTO evaluation_mixeval_details (id, evaluation_mixeval_id, question_number, question_comment, selected_lom, grade, record_status, creator_id, created, updater_id, modified) VALUES
(1, 1, 1, NULL, 5, 1.00, 'A', 7, '2012-07-13 10:38:20', 7, '2012-07-13 10:38:20'),
(2, 1, 2, NULL, 5, 1.00, 'A', 7, '2012-07-13 10:38:20', 7, '2012-07-13 10:38:20'),
(3, 1, 3, NULL, 5, 1.00, 'A', 7, '2012-07-13 10:38:20', 7, '2012-07-13 10:38:20'),
(4, 1, 4, 'work very efficiently', 0, 0.00, 'A', 7, '2012-07-13 10:38:20', 7, '2012-07-13 10:38:20'),
(5, 1, 5, 'Contributed his part', 0, 0.00, 'A', 7, '2012-07-13 10:38:20', 7, '2012-07-13 10:38:20'),
(6, 1, 6, 'very easy to work with', 0, 0.00, 'A', 7, '2012-07-13 10:38:20', 7, '2012-07-13 10:38:20'),
(7, 2, 1, NULL, 4, 0.80, 'A', 7, '2012-07-13 10:39:28', 7, '2012-07-13 10:39:28'),
(8, 2, 2, NULL, 4, 0.80, 'A', 7, '2012-07-13 10:39:28', 7, '2012-07-13 10:39:28'),
(9, 2, 3, NULL, 4, 0.80, 'A', 7, '2012-07-13 10:39:28', 7, '2012-07-13 10:39:28'),
(10, 2, 4, 'Yes', 0, 0.00, 'A', 7, '2012-07-13 10:39:28', 7, '2012-07-13 10:39:28'),
(11, 2, 5, 'He contributed in all parts of the project.', 0, 0.00, 'A', 7, '2012-07-13 10:39:28', 7, '2012-07-13 10:39:28'),
(12, 2, 6, 'He is very easy to communicate with.', 0, 0.00, 'A', 7, '2012-07-13 10:39:28', 7, '2012-07-13 10:39:28'),
(13, 3, 1, NULL, 5, 1.00, 'A', 31, '2012-07-13 10:42:49', 31, '2012-07-13 10:42:49'),
(14, 3, 2, NULL, 5, 1.00, 'A', 31, '2012-07-13 10:42:49', 31, '2012-07-13 10:42:49'),
(15, 3, 3, NULL, 5, 1.00, 'A', 31, '2012-07-13 10:42:49', 31, '2012-07-13 10:42:49'),
(16, 3, 4, 'does great work', 0, 0.00, 'A', 31, '2012-07-13 10:42:49', 31, '2012-07-13 10:42:49'),
(17, 3, 5, 'willing to do their part', 0, 0.00, 'A', 31, '2012-07-13 10:42:49', 31, '2012-07-13 10:42:49'),
(18, 3, 6, 'absolutely easy to work with', 0, 0.00, 'A', 31, '2012-07-13 10:42:49', 31, '2012-07-13 10:42:49'),
(19, 4, 1, NULL, 4, 0.80, 'A', 31, '2012-07-13 10:43:59', 31, '2012-07-13 10:43:59'),
(20, 4, 2, NULL, 4, 0.80, 'A', 31, '2012-07-13 10:43:59', 31, '2012-07-13 10:43:59'),
(21, 4, 3, NULL, 5, 1.00, 'A', 31, '2012-07-13 10:43:59', 31, '2012-07-13 10:43:59'),
(22, 4, 4, 'produce efficient work', 0, 0.00, 'A', 31, '2012-07-13 10:43:59', 31, '2012-07-13 10:43:59'),
(23, 4, 5, 'definitely', 0, 0.00, 'A', 31, '2012-07-13 10:43:59', 31, '2012-07-13 10:43:59'),
(24, 4, 6, 'very easy to get along with', 0, 0.00, 'A', 31, '2012-07-13 10:43:59', 31, '2012-07-13 10:43:59'),
(25, 5, 1, NULL, 4, 0.80, 'A', 5, '2012-07-13 15:19:26', 5, '2012-07-13 15:19:26'),
(26, 5, 2, NULL, 4, 0.80, 'A', 5, '2012-07-13 15:19:26', 5, '2012-07-13 15:19:26'),
(27, 5, 3, NULL, 4, 0.80, 'A', 5, '2012-07-13 15:19:26', 5, '2012-07-13 15:19:26'),
(28, 5, 4, 'Yes', 0, 0.00, 'A', 5, '2012-07-13 15:19:26', 5, '2012-07-13 15:19:26'),
(29, 5, 5, 'Yes', 0, 0.00, 'A', 5, '2012-07-13 15:19:26', 5, '2012-07-13 15:19:26'),
(30, 5, 6, 'Yes', 0, 0.00, 'A', 5, '2012-07-13 15:19:26', 5, '2012-07-13 15:19:26');
-- --------------------------------------------------------
--
-- Table structure for table `evaluation_mixevals`
--
DROP TABLE IF EXISTS `evaluation_mixevals`;
CREATE TABLE IF NOT EXISTS `evaluation_mixevals` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`evaluator` int(11) NOT NULL DEFAULT '0',
`evaluatee` int(11) NOT NULL DEFAULT '0',
`score` double(12,2) NOT NULL DEFAULT '0.00',
`comment_release` int(1) NOT NULL DEFAULT '0',
`grade_release` int(1) NOT NULL DEFAULT '0',
`grp_event_id` int(11) NOT NULL DEFAULT '0',
`event_id` int(11) NOT NULL DEFAULT '0',
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
INDEX `evaluator` (`evaluator`),
INDEX `evaluatee` (`evaluatee`),
INDEX `grp_event_id` (`grp_event_id`),
INDEX `event_id` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `evaluation_mixevals`
--
INSERT INTO evaluation_mixevals (id, evaluator, evaluatee, score, comment_release, grade_release, grp_event_id, event_id, record_status, creator_id, created, updater_id, modified) VALUES
(1, 7, 5, 3.00, 0, 0, 5, 3, 'A', 7, '2012-07-13 10:38:20', 7, '2012-07-13 10:38:20'),
(2, 7, 6, 2.40, 0, 0, 5, 3, 'A', 7, '2012-07-13 10:39:28', 7, '2012-07-13 10:39:28'),
(3, 31, 32, 3.00, 0, 0, 6, 3, 'A', 31, '2012-07-13 10:42:49', 31, '2012-07-13 10:42:49'),
(4, 31, 33, 2.60, 0, 0, 6, 3, 'A', 31, '2012-07-13 10:43:59', 31, '2012-07-13 10:43:59'),
(5, 5, 6, 2.40, 0, 0, 5, 3, 'A', 5, '2012-07-13 15:19:26', 5, '2012-07-13 15:19:26');
-- --------------------------------------------------------
--
-- Table structure for table `evaluation_rubric_details`
--
DROP TABLE IF EXISTS `evaluation_rubric_details`;
CREATE TABLE IF NOT EXISTS `evaluation_rubric_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`evaluation_rubric_id` int(11) NOT NULL DEFAULT '0',
`criteria_number` int(11) NOT NULL DEFAULT '0',
`criteria_comment` TEXT DEFAULT NULL,
`selected_lom` int(11) NOT NULL DEFAULT '0',
`grade` double(12,2) NOT NULL DEFAULT '0.00',
`comment_release` int(1) NOT NULL DEFAULT '0',
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `evaluation_rubric_id` (`evaluation_rubric_id`,`criteria_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `evaluation_rubric_details`
--
INSERT INTO evaluation_rubric_details (id, evaluation_rubric_id, criteria_number, criteria_comment, selected_lom, grade, record_status, creator_id, created, updater_id, modified) VALUES
(1, 1, 1, 'always on time', 5, 5.00, 'A', 31, '2012-07-13 10:26:47', 31, '2012-07-13 10:26:47'),
(2, 1, 2, 'willing to do their part', 5, 5.00, 'A', 31, '2012-07-13 10:26:47', 31, '2012-07-13 10:26:47'),
(3, 1, 3, 'everything was done a day early', 5, 5.00, 'A', 31, '2012-07-13 10:26:47', 31, '2012-07-13 10:26:47'),
(4, 2, 1, 'attended most meetings', 4, 4.00, 'A', 31, '2012-07-13 10:29:15', 31, '2012-07-13 10:29:15'),
(5, 2, 2, 'very co-operative', 5, 5.00, 'A', 31, '2012-07-13 10:29:15', 31, '2012-07-13 10:29:15'),
(6, 2, 3, 'finished all his work on time', 5, 5.00, 'A', 31, '2012-07-13 10:29:15', 31, '2012-07-13 10:29:15'),
(7, 3, 1, 'Yes', 5, 5.00, 'A', 7, '2012-07-13 10:30:29', 7, '2012-07-13 10:30:29'),
(8, 3, 2, 'Absolutely', 4, 4.00, 'A', 7, '2012-07-13 10:30:29', 7, '2012-07-13 10:30:29'),
(9, 3, 3, 'Definitely', 5, 5.00, 'A', 7, '2012-07-13 10:30:29', 7, '2012-07-13 10:30:29'),
(10, 4, 1, 'attended all of our team meetings', 5, 5.00, 'A', 7, '2012-07-13 10:31:19', 7, '2012-07-13 10:31:19'),
(11, 4, 2, 'very helpful in all parts of the project', 5, 5.00, 'A', 7, '2012-07-13 10:31:19', 7, '2012-07-13 10:31:19'),
(12, 4, 3, 'Yes', 5, 5.00, 'A', 7, '2012-07-13 10:31:19', 7, '2012-07-13 10:31:19');
-- --------------------------------------------------------
--
-- Table structure for table `evaluation_rubrics`
--
DROP TABLE IF EXISTS `evaluation_rubrics`;
CREATE TABLE IF NOT EXISTS `evaluation_rubrics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`evaluator` int(11) NOT NULL DEFAULT '0',
`evaluatee` int(11) NOT NULL DEFAULT '0',
`comment` text,
`score` double(12,2) NOT NULL DEFAULT '0.00',
`comment_release` int(1) NOT NULL DEFAULT '0',
`grade_release` int(1) NOT NULL DEFAULT '0',
`grp_event_id` int(11) NOT NULL DEFAULT '0',
`event_id` int(11) NOT NULL DEFAULT '0',
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
`rubric_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `evaluator` (`evaluator`),
INDEX `evaluatee` (`evaluatee`),
INDEX `grp_event_id` (`grp_event_id`),
INDEX `event_id` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `evaluation_rubrics`
--
INSERT INTO evaluation_rubrics (id, evaluator, evaluatee, comment, score, comment_release, grade_release, grp_event_id, event_id, record_status, creator_id, created, updater_id, modified, rubric_id) VALUES
(1, 31, 32, 'We work well together.', 15.00, 0, 0, 4, 2, 'A', 31, '2012-07-13 10:26:47', 31, '2012-07-13 10:26:47', 1),
(2, 31, 33, 'He did a great job.', 14.00, 1, 1, 4, 2, 'A', 31, '2012-07-13 10:29:14', 31, '2012-07-13 10:29:15', 1),
(3, 7, 5, 'Good group member.', 14.00, 0, 0, 3, 2, 'A', 7, '2012-07-13 10:30:29', 7, '2012-07-13 10:30:29', 1),
(4, 7, 6, 'Good job.', 15.00, 0, 0, 3, 2, 'A', 7, '2012-07-13 10:31:19', 7, '2012-07-13 10:31:19', 1);
-- --------------------------------------------------------
--
-- Table structure for table `evaluation_simples`
--
DROP TABLE IF EXISTS `evaluation_simples`;
CREATE TABLE IF NOT EXISTS `evaluation_simples` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`evaluator` int(11) NOT NULL DEFAULT '0',
`evaluatee` int(11) NOT NULL DEFAULT '0',
`score` int(5) NOT NULL DEFAULT '0',
`comment` text,
`release_status` int(1) NOT NULL DEFAULT '0',
`grp_event_id` int(11) NOT NULL DEFAULT '0',
`event_id` bigint(11) NOT NULL DEFAULT '0',
`date_submitted` datetime,
`grade_release` int(1) DEFAULT NULL,
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
INDEX `evaluator` (`evaluator`),
INDEX `evaluatee` (`evaluatee`),
INDEX `grp_event_id` (`grp_event_id`),
INDEX `event_id` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `evaluation_simples`
--
INSERT INTO evaluation_simples (id, evaluator, evaluatee, score, comment, release_status, grp_event_id, event_id, date_submitted, grade_release, record_status, creator_id, created, updater_id, modified) VALUES
(1, 7, 5, 95, 'very hard working', 0, 1, 1, '2012-07-13 10:21:57', 0, 'A', 7, '2012-07-13 10:21:57', 7, '2012-07-13 10:21:57'),
(2, 7, 6, 105, 'did a decent job', 0, 1, 1, '2012-07-13 10:21:57', 0, 'A', 7, '2012-07-13 10:21:57', 7, '2012-07-13 10:21:57'),
(3, 31, 32, 125, 'very good job', 0, 2, 1, '2012-07-13 10:23:11', 0, 'A', 31, '2012-07-13 10:23:11', 31, '2012-07-13 10:23:11'),
(4, 31, 33, 75, 'he participated', 0, 2, 1, '2012-07-13 10:23:11', 0, 'A', 31, '2012-07-13 10:23:11', 31, '2012-07-13 10:23:11'),
(6, 5, 7, 105, '', 0, 7, 6, '2012-11-21 12:24:51', 0, 'A', 5, '2012-11-21 12:24:51', 5, '2012-11-21 12:24:51'),
(7, 5, 6, 95, '', 0, 7, 6, '2012-11-21 12:24:51', 0, 'A', 5, '2012-11-21 12:24:51', 5, '2012-11-21 12:24:51'),
(8, 5, 7, 105, '', 0, 10, 8, '2012-11-21 12:24:51', 0, 'A', 5, '2012-11-21 12:24:51', 5, '2012-11-21 12:24:51'),
(9, 5, 6, 95, '', 0, 10, 8, '2012-11-21 12:24:51', 0, 'A', 5, '2012-11-21 12:24:51', 5, '2012-11-21 12:24:51');
-- --------------------------------------------------------
--
-- Table structure for table `evaluation_submissions`
--
DROP TABLE IF EXISTS `evaluation_submissions`;
CREATE TABLE IF NOT EXISTS `evaluation_submissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) NOT NULL DEFAULT '0',
`grp_event_id` int(11) DEFAULT NULL,
`submitter_id` int(11) NOT NULL DEFAULT '0',
`submitted` tinyint(1) NOT NULL DEFAULT '0',
`date_submitted` datetime,
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `grp_event_id` (`grp_event_id`,`submitter_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `evaluation_submissions`
--
INSERT INTO evaluation_submissions (id, event_id, grp_event_id, submitter_id, submitted, date_submitted, record_status, creator_id, created, updater_id, modified) VALUES
(1, 1, 1, 7, 1, '2012-07-13 10:21:57', 'A', 7, '2012-07-13 10:21:57', 7, '2012-07-13 10:21:57'),
(2, 2, 3, 7, 1, '2012-07-13 11:04:11', 'A', 7, '2012-07-13 11:04:11', 7, '2012-07-13 11:04:11'),
(3, 3, 5, 7, 1, '2012-07-13 11:04:23', 'A', 7, '2012-07-13 11:04:23', 7, '2012-07-13 11:04:23'),
(4, 1, 2, 31, 1, '2012-07-13 10:23:11', 'A', 31, '2012-07-13 10:23:11', 31, '2012-07-13 10:23:11'),
(5, 2, 4, 31, 1, '2012-07-13 11:04:11', 'A', 31, '2012-07-13 11:04:11', 31, '2012-07-13 11:04:11'),
(6, 3, 6, 31, 1, '2012-07-13 11:06:23', 'A', 31, '2012-07-13 11:06:23', 31, '2012-07-13 11:06:23'),
(7, 4, NULL, 7, 1, '2012-07-13 11:23:31', 'A', 7, '2012-07-13 11:23:31', 7, '2012-07-13 11:23:31'),
(8, 4, NULL, 31, 1, '2012-07-13 11:24:09', 'A', 31, '2012-07-13 11:24:09', 31, '2012-07-13 11:24:09'),
(9, 5, NULL, 17, 1, '2012-07-17 10:10:10', 'A', 17, '2012-07-17 10:10:10', 17, '2012-07-17 10:10:10'),
(10, 6, 7, 5, 1, '2012-11-21 12:24:51', 'A', 5, '2012-11-21 12:24:51', 5, '2012-11-21 12:24:51'),
(11, 8, 10, 5, 1, '2012-11-21 12:24:51', 'A', 5, '2012-11-21 12:24:51', 5, '2012-11-21 12:24:51');
-- --------------------------------------------------------
--
-- Table structure for table `event_template_types`
--
DROP TABLE IF EXISTS `event_template_types`;
CREATE TABLE IF NOT EXISTS `event_template_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_name` varchar(50) NOT NULL DEFAULT '',
`table_name` varchar(50) NOT NULL DEFAULT '',
`model_name` varchar(80) NOT NULL DEFAULT '',
`display_for_selection` tinyint(1) NOT NULL DEFAULT '1',
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `type_name` (`type_name`),
UNIQUE KEY `table_name` (`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `event_template_types`
--
INSERT INTO `event_template_types` (`id`, `type_name`, `table_name`, `model_name`, `display_for_selection`, `record_status`, `creator_id`, `created`, `updater_id`, `modified`) VALUES
(1, 'SIMPLE', 'simple_evaluations', 'SimpleEvaluation', 1, 'A', 0, NOW(), NULL, NULL),
(2, 'RUBRIC', 'rubrics', 'Rubric', 1, 'A', 0, NOW(), NULL, NULL),
(3, 'SURVEY', 'surveys', '', 1, 'A', 0, NOW(), NULL, NULL),
(4, 'MIX EVALUATION', 'mixevals', 'Mixeval', 1, 'A', 0, '2006-04-03 11:51:02', 0, '2006-04-06 15:31:48');
-- --------------------------------------------------------
--
-- Table structure for table `events`
--
DROP TABLE IF EXISTS `events`;
CREATE TABLE IF NOT EXISTS `events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`course_id` int(11) NOT NULL DEFAULT '0',
`description` text,
`event_template_type_id` int(20) NOT NULL DEFAULT '0',
`template_id` int(11) NOT NULL DEFAULT '2',
`self_eval` varchar(11) NOT NULL DEFAULT '0',
`com_req` int(11) NOT NULL DEFAULT '0',
`auto_release` int(11) NOT NULL DEFAULT '0',
`enable_details` int(11) NOT NULL DEFAULT '1',
`due_date` datetime,
`release_date_begin` datetime,
`release_date_end` datetime,
`result_release_date_begin` datetime,
`result_release_date_end` datetime,
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `events`
--
SET @year = YEAR(NOW())+1;
INSERT INTO events (id, title, course_id, description, event_template_type_id, template_id, self_eval, com_req, auto_release, enable_details, due_date, release_date_begin, release_date_end, result_release_date_begin, result_release_date_end, record_status, creator_id, created, updater_id, modified) VALUES
(1, 'Term 1 Evaluation', 1, '', 1, 1, '0', 0, 0, 1, CONCAT(@year, '-07-02 16:34:43'), '2011-06-16 16:34:49', '2023-07-22 16:34:53', '2024-07-04 16:34:43', '2024-07-30 16:34:43', 'A', 1, '2006-06-20 16:27:33', 1, '2006-06-21 08:51:20'),
(2, 'Term Report Evaluation', 1, '', 2, 1, '0', 0, 0, 1, CONCAT(@year, '-06-08 08:59:29'), '2011-06-06 08:59:35', '2023-07-02 08:59:41', '2024-06-09 08:59:29', '2024-07-08 08:59:29', 'A', 1, '2006-06-21 08:52:20', 1, '2006-06-21 08:54:25'),
(3, 'Project Evaluation', 1, '', 4, 1, '0', 0, 0, 1, CONCAT(@year, '-07-02 09:00:28'), '2011-06-07 09:00:35', '2023-07-09 09:00:39', '2023-07-04 09:00:28', '2024-07-12 09:00:28', 'A', 1, '2006-06-21 08:53:14', 1, '2006-06-21 09:07:26'),
(4, 'Team Creation Survey', 1, NULL, 3, 1, '1', 1, 0, 1, CONCAT(@year, '-07-31 11:20:00'), '2012-07-01 11:20:00', CONCAT(@year, '-12-31 11:20:00'), NULL, NULL, 'A', 2, '2012-07-13 11:18:56', 2, '2012-07-13 11:18:56'),
(5, 'Survey, all Q types', 1, NULL, 3, 2, '1', 1, 0, 1, CONCAT(@year, '-07-31 11:20:00'), '2012-07-01 11:20:00', CONCAT(@year, '-12-31 11:20:00'), NULL, NULL, 'A', 1, '2012-07-13 11:18:56', 1, '2012-07-13 11:18:56'),
(6, 'simple evaluation 2', 1, '2nd simple evaluation', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(7, 'simple evaluation 3', 1, '3rd simple evaluation for testing overdue event', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2012-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(8, 'simple evaluation 4', 1, 'result released with submission', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2012-11-29 00:00:00', '2012-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(9, 'simple evaluation 5', 1, 'result released with no submission', 1, 1, '0', 0, 0, 1, '2012-11-28 00:00:00', '2012-11-20 00:00:00', '2012-11-29 00:00:00', '2012-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(10, 'simple evaluation 6', 1, 'result released with no submission', 1, 1, '0', 0, 0, 1, CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 2 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 1 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 2 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 2 YEAR)), '-07-31 11:20:00'), CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 3 YEAR)), '-07-31 11:20:00'), 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(11, 'timezone test A', 1, 'before DST', 1, 1, '0', 0, 0, 1, '2013-02-14 00:00:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(12, 'timezone test B', 1, 'transition to DST', 1, 1, '0', 0, 0, 1, '2013-03-10 02:00:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(13, 'timezone test C', 1, 'during DST', 1, 1, '0', 0, 0, 1, '2013-06-12 00:00:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(14, 'timezone test D', 1, 'transition from DST', 1, 1, '0', 0, 0, 1, '2013-11-03 02:00:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(15, 'timezone test E', 1, 'after DST', 1, 1, '0', 0, 0, 1, '2013-11-04 00:00:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(16, 'timezone test B1', 1, 'missed time from transition to DST', 1, 1, '0', 0, 0, 1, '2013-03-10 02:30:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13'),
(17, 'timezone test D1', 1, 'overlapped time from transition from DST', 1, 1, '0', 0, 0, 1, '2013-11-03 01:30:00', '2012-11-20 00:00:00', '2022-11-29 00:00:00', '2022-11-30 00:00:00', '2022-12-12 00:00:00', 'A', 1, '2012-11-21 12:23:13', 1, '2012-11-21 12:23:13')
;
-- --------------------------------------------------------
--
-- Table structure for table `group_events`
--
DROP TABLE IF EXISTS `group_events`;
CREATE TABLE IF NOT EXISTS `group_events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL DEFAULT '0',
`event_id` int(11) NOT NULL DEFAULT '0',
`marked` varchar(20) NOT NULL DEFAULT 'not reviewed',
`grade` double(12,2) DEFAULT NULL,
`grade_release_status` varchar(20) NOT NULL DEFAULT 'None',
`comment_release_status` varchar(20) NOT NULL DEFAULT 'None',
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `group_id` (`event_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `group_events`
--
INSERT INTO `group_events` VALUES (1, 1, 1, 'not reviewed', NULL, 'None', 'None', 'A', 0, '2006-06-20 16:27:33', NULL, '2006-06-20 16:27:33');
INSERT INTO `group_events` VALUES (2, 2, 1, 'not reviewed', NULL, 'None', 'None', 'A', 0, '2006-06-21 08:50:22', NULL, '2006-06-21 08:50:22');
INSERT INTO `group_events` VALUES (3, 1, 2, 'not reviewed', NULL, 'None', 'None', 'A', 0, '2006-06-21 08:52:20', NULL, '2006-06-21 08:52:20');
INSERT INTO `group_events` VALUES (4, 2, 2, 'not reviewed', NULL, 'None', 'None', 'A', 0, '2006-06-21 08:52:20', NULL, '2006-06-21 08:52:20');
INSERT INTO `group_events` VALUES (5, 1, 3, 'not reviewed', NULL, 'None', 'None', 'A', 0, '2006-06-21 08:53:23', NULL, '2006-06-21 08:53:23');
INSERT INTO `group_events` VALUES (6, 2, 3, 'not reviewed', NULL, 'None', 'None', 'A', 0, '2006-06-21 08:53:23', NULL, '2006-06-21 08:53:23');
INSERT INTO `group_events` VALUES (7, 1, 6, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
INSERT INTO `group_events` VALUES (8, 2, 6, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
INSERT INTO `group_events` VALUES (9, 1, 7, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
INSERT INTO `group_events` VALUES (10, 1, 8, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
INSERT INTO `group_events` VALUES (11, 1, 9, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
INSERT INTO `group_events` VALUES (12, 1, 10, 'not reviewed', NULL, 'None', 'None', 'A', 0, NOW(), NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
DROP TABLE IF EXISTS `groups`;
CREATE TABLE IF NOT EXISTS `groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_num` int(4) NOT NULL DEFAULT '0',
`group_name` varchar(80) DEFAULT NULL,
`course_id` int(11) DEFAULT NULL,
`record_status` varchar(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `groups`
--
INSERT INTO `groups` VALUES (1, 1, 'Reapers', 1, 'A', 0, '2006-06-20 16:23:40', NULL, '2006-06-20 16:23:40');
INSERT INTO `groups` VALUES (2, 2, 'Lazy Engineers', 1, 'A', 0, '2006-06-21 08:47:04', NULL, '2006-06-21 08:49:53');
-- --------------------------------------------------------
--
-- Table structure for table `groups_members`
--
DROP TABLE IF EXISTS `groups_members`;
CREATE TABLE IF NOT EXISTS `groups_members` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `group_user` (`group_id`,`user_id`),
KEY `group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `groups_members`
--
INSERT INTO `groups_members` VALUES (1, 1, 5);
INSERT INTO `groups_members` VALUES (2, 1, 6);
INSERT INTO `groups_members` VALUES (3, 1, 7);
INSERT INTO `groups_members` VALUES (4, 1, 35);
INSERT INTO `groups_members` VALUES (5, 2, 31);
INSERT INTO `groups_members` VALUES (6, 2, 32);
INSERT INTO `groups_members` VALUES (7, 2, 33);
INSERT INTO `groups_members` VALUES (8, 2, 7);
-- --------------------------------------------------------
--
-- Table structure for table `mixevals`
--
DROP TABLE IF EXISTS `mixevals`;
CREATE TABLE IF NOT EXISTS `mixevals` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(80) NOT NULL DEFAULT '',
`zero_mark` tinyint(1) NOT NULL DEFAULT '0',
`availability` varchar(10) NOT NULL DEFAULT 'public',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `mixevals`
--
INSERT INTO `mixevals` (`id`, `name`, `zero_mark`, `availability`, `creator_id`, `created`, `updater_id`, `modified`) VALUES
(1, 'Default Mix Evaluation', 0, 'public', 1, '2006-09-12 13:34:30', 1, '2006-09-12 13:47:57');
-- --------------------------------------------------------
--
-- Table structure for table `mixeval_question_types`
--
DROP TABLE IF EXISTS `mixeval_question_types`;
CREATE TABLE IF NOT EXISTS `mixeval_question_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `mixeval_question_types`
--
INSERT INTO `mixeval_question_types` (`id`, `type`) VALUES
(1, 'Likert'),
(2, 'Paragraph'),
(3, 'Sentence'),
(4, 'ScoreDropdown');
-- --------------------------------------------------------
--
-- Table structure for table `mixeval_questions`
--
DROP TABLE IF EXISTS `mixeval_questions`;
CREATE TABLE IF NOT EXISTS `mixeval_questions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`mixeval_id` int(11) NOT NULL DEFAULT '0',
`question_num` int(11) NOT NULL DEFAULT '0',
`title` text,
`instructions` text,
`mixeval_question_type_id` int(11) NOT NULL,
`required` tinyint(1) NOT NULL DEFAULT '1',
`self_eval` tinyint(1) NOT NULL DEFAULT '0',
`multiplier` int(11) NOT NULL DEFAULT '0',
`scale_level` int(11) NOT NULL DEFAULT '0',
`show_marks` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
FOREIGN KEY (`mixeval_question_type_id`) REFERENCES `mixeval_question_types`
(`id`) ON DELETE CASCADE,
FOREIGN KEY (`mixeval_id`) REFERENCES `mixevals`
(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `mixeval_questions`
--
INSERT INTO `mixeval_questions` (`id`, `mixeval_id`, `question_num`, `title`, `instructions`, `mixeval_question_type_id`, `required`, `self_eval`, `multiplier`, `scale_level`, `show_marks`) VALUES
(1, 1, 1, 'Participated in Team Meetings', "Please rate performance.", 1, 1, 0, 1, 5, 1),
(2, 1, 2, 'Was Helpful and co-operative', NULL, 1, 1, 0, 1, 5, 0),
(3, 1, 3, 'Submitted work on time', NULL, 1, 1, 0, 1, 5, 1),
(4, 1, 4, 'Produced efficient work?', NULL, 3, 1, 0, 0, 5, NULL),
(5, 1, 5, 'Contributed?', "Please give a paragraph answer.", 2, 1, 0, 0, 5, NULL),
(6, 1, 6, 'Easy to work with?', NULL, 3, 0, 0, 0, 5, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `mixeval_question_descs`
--
DROP TABLE IF EXISTS `mixeval_question_descs`;
CREATE TABLE IF NOT EXISTS `mixeval_question_descs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`question_id` int(11) NOT NULL DEFAULT '0',
`scale_level` int(11) NOT NULL DEFAULT '0',
`descriptor` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`question_id`) REFERENCES `mixeval_questions`
(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `mixeval_question_descs`
--
INSERT INTO `mixeval_question_descs` (`id`, `question_id`, `scale_level`, `descriptor`) VALUES
(1, 1, 1, 'Lowest'),
(2, 1, 2, NULL),
(3, 1, 3, 'Middle'),
(4, 1, 4, NULL),
(5, 1, 5, 'Highest'),
(6, 2, 1, 'Lowest'),
(7, 2, 2, NULL),
(8, 2, 3, 'Middle'),
(9, 2, 4, NULL),
(10, 2, 5, 'Highest'),
(11, 3, 1, 'Lowest'),
(12, 3, 2, NULL),
(13, 3, 3, 'Middle'),
(14, 3, 4, NULL),
(15, 3, 5, 'Highest');
-- --------------------------------------------------------
--
-- Table structure for table `oauth_clients`
-- This stores OAuth client credentials (AKA: consumer key and secret).
-- Client credentails are used to identify client software.
--
DROP TABLE IF EXISTS `oauth_clients`;
CREATE TABLE IF NOT EXISTS `oauth_clients` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`key` varchar(255) NOT NULL,
`secret` varchar(255) NOT NULL,
`comment` text DEFAULT '',
`enabled` tinyint(1) DEFAULT 1,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `oauth_clients`
--
INSERT INTO `oauth_clients` (`id`, `user_id`, `key`, `secret`, `comment`, `enabled`) VALUES
(1, 1, 'i//dt5l+kFYk/', 'M++SgeLVtL//locYEjkb/aLg2Q/', '', 1);
-- --------------------------------------------------------
--
-- Table structure for table `oauth_nonces`
-- Stores nonces to defeat replay attacks.
--
DROP TABLE IF EXISTS `oauth_nonces`;
CREATE TABLE IF NOT EXISTS `oauth_nonces` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nonce` varchar(255) NOT NULL,
`expires` TIMESTAMP NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `oauth_tokens`
-- This stores OAuth token credentials (AKA: access token and secret).
-- Token credentials are used to identify a user.
--
DROP TABLE IF EXISTS `oauth_tokens`;
CREATE TABLE IF NOT EXISTS `oauth_tokens` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`key` varchar(255) NOT NULL,
`secret` varchar(255) NOT NULL,
`expires` date NOT NULL,
`comment` text DEFAULT '',
`enabled` tinyint(1) DEFAULT 1,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `oauth_tokens`
--
INSERT INTO `oauth_tokens` (`id`, `user_id`, `key`, `secret`, `expires`, `comment`, `enabled`) VALUES
(1, 1, '//qu+Bfa/gr+C//p8//', '//Bgc3Ql+QQR/O+PEi6sJZG//', '2032-08-13', '', 1);
-- --------------------------------------------------------
--
-- Table structure for table `penalties`
--
DROP TABLE IF EXISTS `penalties`;
CREATE TABLE IF NOT EXISTS `penalties` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) DEFAULT NULL,
`days_late` int(11) NOT NULL,
`percent_penalty` int(11) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `penalties`
--
INSERT INTO penalties (id, event_id, days_late, percent_penalty) VALUES
(1, 1, 1, 20),
(2, 1, 2, 40),
(3, 1, 3, 60),
(4, 1, 4, 100),
(5, 2, 1, 15),
(6, 2, 2, 30),
(7, 2, 3, 45),
(8, 2, 4, 60),
(9, 6, 1, 5),
(10, 6, 2, 10);
-- --------------------------------------------------------
--
-- Table structure for table `personalizes`
--
DROP TABLE IF EXISTS `personalizes`;
CREATE TABLE IF NOT EXISTS `personalizes` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`attribute_code` varchar(80) DEFAULT NULL,
`attribute_value` varchar(80) DEFAULT NULL,
`created` datetime,
`updated` datetime,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`,`attribute_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `personalizes`
--
INSERT INTO `personalizes` VALUES (1, 1, 'Course.SubMenu.EvalEvents.Show', 'true', NULL, '2006-04-03 09:08:36');
INSERT INTO `personalizes` VALUES (2, 1, 'Course.SubMenu.SimpleEvals.Show', 'true', NULL, '2006-04-03 09:08:42');
INSERT INTO `personalizes` VALUES (3, 1, 'Course.SubMenu.Student.Show', 'true', NULL, '2006-04-03 09:08:47');
INSERT INTO `personalizes` VALUES (4, 1, 'Course.SubMenu.Group.Show', 'none', NULL, '2006-04-03 09:08:50');
INSERT INTO `personalizes` VALUES (5, 1, 'Course.SubMenu.EvalResults.Show', 'true', NULL, '2006-04-03 09:10:04');
INSERT INTO `personalizes` VALUES (6, 1, 'Course.SubMenu.Rubric.Show', 'true', NULL, '2006-04-04 14:40:46');
INSERT INTO `personalizes` VALUES (7, 1, 'Course.SubMenu.TeamMaker.Show', 'true', NULL, '2006-05-03 14:26:26');
INSERT INTO `personalizes` VALUES (8, 1, 'Mixeval.ListMenu.Limit.Show', '10', NULL, '2006-06-21 09:06:47');
INSERT INTO `personalizes` VALUES (9, 1, 'Course.ListMenu.Limit.Show', '10', '2006-06-21 09:06:52', '2006-06-21 09:06:52');
INSERT INTO `personalizes` VALUES (10, 1, 'Event.ListMenu.Limit.Show', '10', '2006-06-21 09:07:06', '2006-06-21 09:07:06');
INSERT INTO `personalizes` VALUES (11, 1, 'Survey.ListMenu.Limit.Show', '10', '2006-06-21 09:43:13', '2006-06-21 09:43:13');
INSERT INTO `personalizes` VALUES (12, 1, 'SurveyGroupSet.List.Limit.Show', '10', '2006-06-21 12:22:19', '2006-06-21 12:22:19');
INSERT INTO `personalizes` VALUES (13, 1, 'User.ListMenu.Limit.Show', '10', '2006-06-21 15:11:00', '2006-06-21 15:11:00');
INSERT INTO `personalizes` VALUES (14, 1, 'SimpleEval.ListMenu.Limit.Show', '10', '2006-06-21 15:12:56', '2006-06-21 15:12:56');
INSERT INTO `personalizes` VALUES (15, 1, 'Search.ListMenu.Limit.Show', '10', '2006-06-21 15:16:35', '2006-06-21 15:16:35');
INSERT INTO `personalizes` VALUES (16, 1, 'SysParam.ListMenu.Limit.Show', '10', '2006-06-21 15:16:37', '2006-06-21 15:16:37');
-- --------------------------------------------------------
--
-- Table structure for table `questions`
--
DROP TABLE IF EXISTS `questions`;
CREATE TABLE IF NOT EXISTS `questions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`prompt` varchar(255) NOT NULL DEFAULT '',
`type` varchar(1) DEFAULT NULL,
`master` varchar(3) NOT NULL DEFAULT 'yes',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `questions`
--
INSERT INTO `questions` VALUES (1, 'What was your GPA last term?', 'M', 'no');
INSERT INTO `questions` VALUES (2, 'Do you own a laptop?', 'M', 'no');
INSERT INTO `questions` VALUES (3, 'Testing out MC', 'M', 'no');
INSERT INTO `questions` VALUES (4, 'Testing out checkboxes', 'C', 'no');
INSERT INTO `questions` VALUES (5, 'Testing out single line answers', 'S', 'no');
INSERT INTO `questions` VALUES (6, 'Testing out multi-line long answers', 'L', 'no');
-- --------------------------------------------------------
--
-- Table structure for table `responses`
--
DROP TABLE IF EXISTS `responses`;
CREATE TABLE IF NOT EXISTS `responses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`question_id` int(11) NOT NULL DEFAULT '0',
`response` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `responses`
--
INSERT INTO `responses` VALUES (1, 1, '4+');
INSERT INTO `responses` VALUES (2, 1, '3-4');
INSERT INTO `responses` VALUES (3, 1, '2-3');
INSERT INTO `responses` VALUES (4, 1, '<2');
INSERT INTO `responses` VALUES (5, 2, 'yes');
INSERT INTO `responses` VALUES (6, 2, 'no');
INSERT INTO `responses` VALUES (7, 3, 'A');
INSERT INTO `responses` VALUES (8, 3, 'B');
INSERT INTO `responses` VALUES (9, 3, 'C');
INSERT INTO `responses` VALUES (10, 3, 'D');
INSERT INTO `responses` VALUES (11, 4, 'choose me');
INSERT INTO `responses` VALUES (12, 4, 'no, me');
INSERT INTO `responses` VALUES (13, 4, 'me please');
-- --------------------------------------------------------
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
CREATE TABLE IF NOT EXISTS `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`created` datetime,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `roles`
--
INSERT INTO `roles` (`id`, `name`, `created`, `modified`) VALUES
(1, 'superadmin', '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(2, 'admin', '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(3, 'instructor', '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(4, 'tutor', '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 'student', '2010-10-27 16:17:29', '2010-10-27 16:17:29');
-- --------------------------------------------------------
--
-- Table structure for table `roles_users`
--
DROP TABLE IF EXISTS `roles_users`;
CREATE TABLE IF NOT EXISTS `roles_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`role_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`created` datetime,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `roles_users`
--
INSERT INTO `roles_users` (`role_id`, `user_id`, `created`, `modified`) VALUES
(1, 1, NOW(), NOW()),
(3, 2, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(3, 3, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(3, 4, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 5, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 6, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 7, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 8, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 9, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 10, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 11, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 12, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 13, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 14, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 15, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 16, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 17, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 18, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 19, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 20, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 21, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 22, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 23, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 24, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 25, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 26, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 27, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 28, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 29, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 30, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 31, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 32, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(5, 33, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(2, 34, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(4, 35, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(4, 36, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(4, 37, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(2, 38, '2010-10-27 16:17:29', '2010-10-27 16:17:29'),
(2, 39, '2014-12-15 00:00:00', '2014-12-15 00:00:00'),
(2, 40, '2014-12-15 00:00:00', '2014-12-15 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `rubrics`
--
DROP TABLE IF EXISTS `rubrics`;
CREATE TABLE IF NOT EXISTS `rubrics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(80) NOT NULL DEFAULT '',
`zero_mark` tinyint(1) NOT NULL DEFAULT '0',
`lom_max` int(11) DEFAULT NULL,
`criteria` int(11) DEFAULT NULL,
`view_mode` varchar(10) NOT NULL DEFAULT 'student',
`availability` varchar(10) NOT NULL DEFAULT 'public',
`template` varchar(20) NOT NULL DEFAULT 'horizontal',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `rubrics`
--
INSERT INTO `rubrics` VALUES (1, 'Term Report Evaluation', 0, 5, 3, 'student', 'public', 'horizontal', 1, '2006-06-20 15:21:50', NULL, '2006-06-20 15:21:50');
-- --------------------------------------------------------
--
-- Table structure for table `rubrics_criteria_comments`
--
DROP TABLE IF EXISTS `rubrics_criteria_comments`;
CREATE TABLE IF NOT EXISTS `rubrics_criteria_comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`criteria_id` int(11) NOT NULL,
`rubrics_loms_id` int(11) NOT NULL,
`criteria_comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `criteria_id` (`criteria_id`),
KEY `rubrics_loms_id` (`rubrics_loms_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `rubrics_criteria_comments`
--
INSERT INTO `rubrics_criteria_comments` VALUES (1, 1, 1, "No participation.");
INSERT INTO `rubrics_criteria_comments` VALUES (2, 1, 2, "Little participation.");
INSERT INTO `rubrics_criteria_comments` VALUES (3, 1, 3, "Some participation.");
INSERT INTO `rubrics_criteria_comments` VALUES (4, 1, 4, "Good participation.");
INSERT INTO `rubrics_criteria_comments` VALUES (5, 1, 5, "Great participation.");
INSERT INTO `rubrics_criteria_comments` VALUES (6, 2, 1, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (7, 2, 2, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (8, 2, 3, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (9, 2, 4, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (10, 2, 5, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (11, 3, 1, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (12, 3, 2, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (13, 3, 3, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (14, 3, 4, NULL);
INSERT INTO `rubrics_criteria_comments` VALUES (15, 3, 5, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `rubrics_criterias`
--
DROP TABLE IF EXISTS `rubrics_criterias`;
CREATE TABLE IF NOT EXISTS `rubrics_criterias` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rubric_id` int(11) NOT NULL DEFAULT '0',
`criteria_num` int(11) NOT NULL DEFAULT '999',
`criteria` varchar(255) DEFAULT NULL,
`multiplier` int(11) NOT NULL DEFAULT '0',
`show_marks` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `rubrics_criterias`
--
INSERT INTO `rubrics_criterias` VALUES (1, 1, 1, 'Participated in Team Meetings', 5, 0);
INSERT INTO `rubrics_criterias` VALUES (2, 1, 2, 'Was Helpful and Co-operative', 5, 1);
INSERT INTO `rubrics_criterias` VALUES (3, 1, 3, 'Submitted Work on Time', 5, 1);
-- --------------------------------------------------------
--
-- Table structure for table `rubrics_loms`
--
DROP TABLE IF EXISTS `rubrics_loms`;
CREATE TABLE IF NOT EXISTS `rubrics_loms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rubric_id` int(11) NOT NULL DEFAULT '0',
`lom_num` int(11) NOT NULL DEFAULT '999',
`lom_comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `rubrics_loms`
--
INSERT INTO `rubrics_loms` VALUES (1, 1, 1, 'Poor');
INSERT INTO `rubrics_loms` VALUES (2, 1, 2, 'Below Average');
INSERT INTO `rubrics_loms` VALUES (3, 1, 3, 'Average');
INSERT INTO `rubrics_loms` VALUES (4, 1, 4, 'Above Average');
INSERT INTO `rubrics_loms` VALUES (5, 1, 5, 'Excellent');
-- --------------------------------------------------------
--
-- Table structure for table `simple_evaluations`
--
DROP TABLE IF EXISTS `simple_evaluations`;
CREATE TABLE IF NOT EXISTS `simple_evaluations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`description` text NOT NULL,
`point_per_member` int(10) NOT NULL DEFAULT '0',
`record_status` char(1) NOT NULL DEFAULT 'A',
`availability` varchar(10) NOT NULL DEFAULT 'public',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `simple_evaluations`
--
INSERT INTO `simple_evaluations` VALUES (1, 'Module 1 Project Evaluation', '', 100, 'A', 'public', 1, '2006-06-20 15:17:47', NULL, '2006-06-20 15:17:47');
-- --------------------------------------------------------
--
-- Table structure for table `survey_group_members`
--
DROP TABLE IF EXISTS `survey_group_members`;
CREATE TABLE IF NOT EXISTS `survey_group_members` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_set_id` int(11) DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `survey_group_members`
--
INSERT INTO `survey_group_members` VALUES (25, 3, 5, 17);
INSERT INTO `survey_group_members` VALUES (26, 3, 5, 21);
INSERT INTO `survey_group_members` VALUES (27, 3, 5, 15);
INSERT INTO `survey_group_members` VALUES (28, 3, 5, 19);
INSERT INTO `survey_group_members` VALUES (29, 3, 6, 6);
INSERT INTO `survey_group_members` VALUES (30, 3, 6, 32);
INSERT INTO `survey_group_members` VALUES (31, 3, 6, 26);
INSERT INTO `survey_group_members` VALUES (32, 3, 6, 13);
INSERT INTO `survey_group_members` VALUES (33, 3, 7, 7);
INSERT INTO `survey_group_members` VALUES (34, 3, 7, 28);
INSERT INTO `survey_group_members` VALUES (35, 3, 7, 5);
INSERT INTO `survey_group_members` VALUES (36, 3, 7, 33);
-- --------------------------------------------------------
--
-- Table structure for table `survey_group_sets`
--
DROP TABLE IF EXISTS `survey_group_sets`;
CREATE TABLE IF NOT EXISTS `survey_group_sets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`survey_id` int(11) NOT NULL DEFAULT '0',
`set_description` text NOT NULL,
`num_groups` int(11) NOT NULL DEFAULT '0',
`date` int(11) NOT NULL DEFAULT '0',
`released` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `survey_id` (`survey_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `survey_group_sets`
--
INSERT INTO `survey_group_sets` VALUES (3, 4, 'test groupset', 3, 1150923956, 0);
-- --------------------------------------------------------
--
-- Table structure for table `survey_groups`
--
DROP TABLE IF EXISTS `survey_groups`;
CREATE TABLE IF NOT EXISTS `survey_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_set_id` int(11) NOT NULL DEFAULT '0',
`group_number` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `survey_groups`
--
INSERT INTO `survey_groups` VALUES (5, 3, 1);
INSERT INTO `survey_groups` VALUES (6, 3, 2);
INSERT INTO `survey_groups` VALUES (7, 3, 3);
-- --------------------------------------------------------
--
-- Table structure for table `survey_inputs`
--
DROP TABLE IF EXISTS `survey_inputs`;
CREATE TABLE IF NOT EXISTS `survey_inputs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`question_id` int(11) NOT NULL DEFAULT '0',
`response_text` text,
`response_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `survey_inputs`
--
INSERT INTO survey_inputs (id, event_id, user_id, question_id, response_text, response_id) VALUES
(1, 4, 7, 1, '4+', 1),
(2, 4, 7, 2, 'yes', 5),
(3, 4, 31, 1, '3-4', 2),
(4, 4, 31, 2, 'no', 6),
(5, 5, 17, 3, 'B', 8),
(6, 5, 17, 4, 'choose me', 11),
(7, 5, 17, 4, 'no, me', 12),
(8, 5, 17, 5, 'single line rah rah', 0),
(9, 5, 17, 6, 'long answer what what', 0);
-- --------------------------------------------------------
--
-- Table structure for table `survey_questions`
--
DROP TABLE IF EXISTS `survey_questions`;
CREATE TABLE IF NOT EXISTS `survey_questions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`survey_id` int(11) NOT NULL DEFAULT '0',
`number` int(11) NOT NULL DEFAULT '9999',
`question_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `question_id` (`question_id`),
KEY `survey_id` (`survey_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `survey_questions`
--
INSERT INTO survey_questions (id, survey_id, number, question_id) VALUES
(1, 1, 1, 1),
(2, 1, 2, 2),
(3, 2, 1, 3),
(4, 2, 2, 4),
(5, 2, 3, 5),
(6, 2, 4, 6);
-- --------------------------------------------------------
--
-- Table structure for table `surveys`
--
DROP TABLE IF EXISTS `surveys`;
CREATE TABLE IF NOT EXISTS `surveys` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`availability` varchar(10) NOT NULL DEFAULT 'public',
`due_date` datetime,
`release_date_begin` datetime,
`release_date_end` datetime,
`released` tinyint(1) NOT NULL DEFAULT '0',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `surveys`
--
INSERT INTO surveys (id, name, due_date, release_date_begin, release_date_end, released, creator_id, created, updater_id, modified) VALUES
(1, 'Team Creation Survey', '2012-07-31 11:20:00', '2012-07-01 11:20:00', '2013-12-31 11:20:00', 0, 2, '2012-07-13 11:18:56', 2, '2012-07-13 11:18:56'),
(2, 'Survey, all Q types', '2012-07-31 11:20:00', '2012-07-01 11:20:00', '2013-12-31 11:20:00', 0, 1, '2012-07-13 11:18:56', 1, '2012-07-13 11:18:56');
-- --------------------------------------------------------
--
-- Table structure for table `sys_parameters`
--
DROP TABLE IF EXISTS `sys_parameters`;
CREATE TABLE IF NOT EXISTS `sys_parameters` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parameter_code` varchar(80) NOT NULL,
`parameter_value` text,
`parameter_type` char(1) NOT NULL DEFAULT '',
`description` varchar(255) DEFAULT NULL,
`record_status` char(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `parameter_code` (`parameter_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `sys_parameters`
--
INSERT INTO `sys_parameters` (`parameter_code`, `parameter_value`, `parameter_type`, `description`, `record_status`, `creator_id`, `created`, `updater_id`, `modified`) VALUES
('system.super_admin', 'root', 'S', NULL, 'A', 0, NOW(), NULL, NOW()),
('system.admin_email', 'Please enter the iPeer administrator\\''s email address.', 'S', NULL, 'A', 0, NOW(), NULL, NOW()),
('display.date_format', 'D, M j, Y g:i a', 'S', 'date format preference', 'A', 0, NOW(), NULL, NOW()),
('system.version', '3.4.4', 'S', NULL, 'A', 0, NOW(), NULL, NOW()),
('database.version', '17', 'I', 'database version', 'A', 0, NOW(), NULL, NOW()),
('email.port', '25', 'S', 'port number for email smtp option', 'A', '0', NOW(), NULL , NOW()),
('email.host', 'localhost', 'S', 'host address for email smtp option', 'A', '0', NOW(), NULL , NOW()),
('email.username', '', 'S', 'username for email smtp option', 'A', '0', NOW(), NULL , NOW()),
('email.password', '', 'S', 'password for email smtp option', 'A', '0', NOW(), NULL , NOW()),
('display.contact_info', '<EMAIL>', 'S', 'Contact Info', 'A', 0, NOW(), 0, NOW()),
('display.login.header', '', 'S', 'Login Info Header', 'A', 0, NOW(), 0, NOW()),
('display.login.footer', '', 'S', 'Login Info Footer', 'A', 0, NOW(), 0, NOW()),
('system.absolute_url', '', 'S', 'base url to iPeer', 'A', 0, NOW(), 0, NOW()),
('google_analytics.tracking_id', '', 'S', 'tracking id for Google Analytics', 'A', 0, NOW(), 0, NOW()),
('google_analytics.domain', '', 'S', 'domain name for Google Analytics', 'A', 0, NOW(), 0, NOW()),
('banner.custom_logo', '', 'S', 'custom logo that appears on the left side of the banner', 'A', 0, NOW(), 0, NOW()),
('system.timezone', 'Etc/GMT+7', 'S', 'timezone', 'A', 0, NOW(), 0, NOW()),
('system.student_number', 'true', 'B', 'allow students to change their student number', 'A', 0, NOW(), 0, NOW()),
('course.creation.instructions', '', 'S', 'Display course creation instructions', 'A', 0, NOW(), 0, NOW()),
('email.reminder_enabled', 'true', 'B', 'Enable email reminder feature', 'A', 0, NOW(), NULL, NOW());
-- --------------------------------------------------------
--
-- Table structure for table `user_courses`
--
DROP TABLE IF EXISTS `user_courses`;
CREATE TABLE IF NOT EXISTS `user_courses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`course_id` int(11) NOT NULL DEFAULT '0',
`access_right` varchar(1) NOT NULL DEFAULT 'O',
`record_status` varchar(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE no_duplicates (`course_id`,`user_id`),
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user_courses`
--
INSERT INTO `user_courses` VALUES (1, 2, 1, 'A', 'A', 0, '2006-06-20 14:14:45', NULL, '2006-06-20 14:14:45');
INSERT INTO `user_courses` VALUES (2, 3, 2, 'A', 'A', 0, '2006-06-20 14:39:31', NULL, '2006-06-20 14:39:31');
INSERT INTO `user_courses` VALUES (3, 4, 2, 'A', 'A', 0, '2006-06-20 14:39:31', NULL, '2006-06-20 14:39:31');
INSERT INTO `user_courses` VALUES (4, 4, 3, 'A', 'A', 0, '2006-06-20 14:39:31', NULL, '2006-06-20 14:39:31');
INSERT INTO `user_courses` VALUES (5, 39, 4, 'A', 'A', 0, '2014-12-16 14:39:31', NULL, '2014-12-16 14:39:31');
INSERT INTO `user_courses` VALUES (6, 40, 2, 'A', 'A', 0, '2014-12-16 14:39:31', NULL, '2014-12-16 14:39:31');
-- --------------------------------------------------------
--
-- Table structure for table `user_enrols`
--
DROP TABLE IF EXISTS `user_enrols`;
CREATE TABLE IF NOT EXISTS `user_enrols` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`course_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`record_status` varchar(1) NOT NULL DEFAULT 'A',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE no_duplicates (`course_id`,`user_id`),
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user_enrols`
--
INSERT INTO `user_enrols` (`course_id`, `user_id`, `record_status`, `creator_id`, `created`, `updater_id`, `modified`) VALUES
(1, 5, 'A', 1, '2006-06-20 14:19:18', NULL, '2006-06-20 14:19:18'),
(1, 6, 'A', 1, '2006-06-20 14:26:59', NULL, '2006-06-20 14:26:59'),
(1, 7, 'A', 1, '2006-06-20 14:27:24', NULL, '2006-06-20 14:27:24'),
(2, 9, 'A', 1, '2006-06-20 14:28:08', NULL, '2006-06-20 14:28:08'),
(2, 10, 'A', 1, '2006-06-20 14:28:29', NULL, '2006-06-20 14:28:29'),
(2, 11, 'A', 1, '2006-06-20 14:28:49', NULL, '2006-06-20 14:28:49'),
(2, 12, 'A', 1, '2006-06-20 14:29:07', NULL, '2006-06-20 14:29:07'),
(1, 13, 'A', 1, '2006-06-20 14:31:17', NULL, '2006-06-20 14:31:17'),
(1, 15, 'A', 1, '2006-06-20 15:00:35', NULL, '2006-06-20 15:00:35'),
(2, 16, 'A', 1, '2006-06-20 15:01:09', NULL, '2006-06-20 15:01:09'),
(1, 17, 'A', 1, '2006-06-20 15:01:24', NULL, '2006-06-20 15:01:24'),
(2, 18, 'A', 1, '2006-06-20 15:01:52', NULL, '2006-06-20 15:01:52'),
(1, 19, 'A', 1, '2006-06-20 15:02:20', NULL, '2006-06-20 15:02:20'),
(2, 20, 'A', 1, '2006-06-20 15:03:27', NULL, '2006-06-20 15:03:27'),
(1, 21, 'A', 1, '2006-06-20 15:03:47', NULL, '2006-06-20 15:03:47'),
(2, 22, 'A', 1, '2006-06-20 15:04:22', NULL, '2006-06-20 15:04:22'),
(2, 23, 'A', 1, '2006-06-20 15:05:55', NULL, '2006-06-20 15:05:55'),
(2, 24, 'A', 1, '2006-06-20 15:06:20', NULL, '2006-06-20 15:06:20'),
(2, 25, 'A', 1, '2006-06-20 15:06:46', NULL, '2006-06-20 15:06:46'),
(1, 26, 'A', 1, '2006-06-20 15:07:01', NULL, '2006-06-20 15:07:01'),
(2, 27, 'A', 1, '2006-06-20 15:07:37', NULL, '2006-06-20 15:07:37'),
(1, 28, 'A', 1, '2006-06-20 15:08:04', NULL, '2006-06-20 15:08:04'),
(2, 29, 'A', 1, '2006-06-20 15:08:31', NULL, '2006-06-20 15:08:31'),
(2, 30, 'A', 1, '2006-06-20 15:08:47', NULL, '2006-06-20 15:08:47'),
(1, 31, 'A', 1, '2006-06-20 15:10:16', NULL, '2006-06-20 15:10:16'),
(1, 32, 'A', 1, '2006-06-20 15:10:32', NULL, '2006-06-20 15:10:32'),
(1, 33, 'A', 1, '2006-06-21 08:44:09', NULL, '2006-06-21 08:44:09'),
(2, 7, 'A', 1, '2006-06-21 08:44:09', NULL, '2006-06-21 08:44:09'),
(3, 33, 'A', 1, '2006-06-21 08:44:09', NULL, '2006-06-21 08:44:09'),
(3, 8, 'A', 1, '2006-06-21 08:44:09', NULL, '2006-06-21 08:44:09');
-- --------------------------------------------------------
--
-- Table structure for table `user_faculties`
--
DROP TABLE IF EXISTS `user_faculties`;
CREATE TABLE `user_faculties` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`faculty_id` int NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`faculty_id`) REFERENCES `faculties` (`id`) ON DELETE CASCADE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user_faculties`
--
INSERT INTO `user_faculties` (`id`, `user_id`, `faculty_id`) VALUES
(1, 2, 1),
(2, 3, 1),
(3, 3, 2),
(4, 4, 1),
(5, 34, 1),
(6, 38, 2),
(7, 39, 1),
(8, 40, 1);
-- --------------------------------------------------------
--
-- Table structure for table `user_tutors`
--
DROP TABLE IF EXISTS `user_tutors`;
CREATE TABLE IF NOT EXISTS `user_tutors` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`course_id` int(11) NOT NULL DEFAULT '0',
`creator_id` int(11) NOT NULL DEFAULT '0',
`created` datetime,
`updater_id` int(11) DEFAULT NULL,
`modified` datetime,
PRIMARY KEY (`id`),
UNIQUE no_duplicates (`course_id`,`user_id`),
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user_tutors`
--
INSERT INTO user_tutors (id, user_id, course_id, creator_id, created, updater_id, modified) VALUES
(1, 35, 1, 0, NOW(), NULL, NOW()),
(2, 36, 1, 0, NOW(), NULL, NOW()),
(3, 37, 2, 0, NOW(), NULL, NOW()),
(4, 37, 3, 0, NOW(), NULL, NOW());
SET foreign_key_checks = 1;
------------------------
--
-- Canvas integration
--
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_enabled', 'true', 'B',
'Enable Canvas integration', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_baseurl', 'http://docker-canvas_app_1:80', 'S',
'Base URL for Canvas API', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_baseurl_ext', 'http://docker-canvas_app_1', 'S',
'External Base URL for Canvas API (if not set, will default to canvas_baseurl)', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_user_key', 'integration_id', 'S',
'Key used to map a Canvas user to iPeer username', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`, `parameter_type`,
`description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_client_id', '', 'S',
'Canvas Oauth Client ID', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`, `parameter_type`,
`description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_client_secret', '', 'S',
'Canvas Oauth Client Secret', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_force_login', 'false', 'B',
'Force the user to enter their Canvas credentials when connecting for the first time', 'A', 0, NOW(), NULL, NOW()
);
-- add page permissions --
INSERT INTO `acos`
(`parent_id`, `model`, `foreign_key`, `alias`, `lft`, `rght`)
select id, NULL, NULL, 'syncCanvasEnrollment', NULL, NULL
from `acos`
where BINARY `alias`='Courses' LIMIT 1;
INSERT INTO `acos`
(`parent_id`, `model`, `foreign_key`, `alias`, `lft`, `rght`)
select id, NULL, NULL, 'syncCanvas', NULL, NULL
from `acos`
where BINARY `alias`='Groups' LIMIT 1;
-- store canvas course id
ALTER TABLE `courses` ADD COLUMN `canvas_id` VARCHAR(25) NULL DEFAULT NULL;
-- add table to store oauth access/refresh tokens and expiry timestamp of the access token
CREATE TABLE IF NOT EXISTS `user_oauths` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`provider` varchar(255) NOT NULL,
`access_token` varchar(255) DEFAULT NULL,
`refresh_token` varchar(255) DEFAULT NULL,
`expires` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `no_duplicates` (`user_id`, `provider`),
KEY `user_id` (`user_id`),
CONSTRAINT `user_oauths_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE )
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
AUTO_INCREMENT=1
COLLATE = utf8_general_ci;
-- new parameters to define the behaviour of Canvas API calls
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_api_timeout', '10', 'I',
'Canvas API call timeout in seconds', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_api_default_per_page', '500', 'I',
'Default number of items to retrieve per Canvas API call', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_api_max_retrieve_all', '10000', 'I',
'Max number of item to retrieve when auto-looping Canvas API pagination to retrieve all records', 'A', 0, NOW(), NULL, NOW()
);
INSERT INTO `sys_parameters` (
`parameter_code`, `parameter_value`,
`parameter_type`, `description`, `record_status`, `creator_id`, `created`,
`updater_id`, `modified`)
VALUES (
'system.canvas_api_max_call', '20', 'I',
'Max number of API calls when auto-looping Canvas API pagination to retrieve all records', 'A', 0, NOW(), NULL, NOW()
);
--- START: Added by DB upgrade to version 15
-- add page permissions --
INSERT INTO `acos`
(`parent_id`, `model`, `foreign_key`, `alias`, `lft`, `rght`)
select id, NULL, NULL, 'exportCanvas', NULL, NULL
from `acos`
where BINARY `alias`='Evaluations' LIMIT 1;
-- store canvas course id
ALTER TABLE `events` ADD COLUMN `canvas_assignment_id` VARCHAR(25) NULL DEFAULT NULL;
--- END: Added by DB upgrade to version 15
--- START: Added by DB upgrade to version 17
-- add table to store delayed jobs
CREATE TABLE IF NOT EXISTS `jobs` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`handler` TEXT NOT NULL,
`queue` VARCHAR(255) NOT NULL DEFAULT 'default',
`attempts` INT UNSIGNED NOT NULL DEFAULT 0,
`run_at` DATETIME NULL,
`locked_at` DATETIME NULL,
`locked_by` VARCHAR(255) NULL,
`failed_at` DATETIME NULL,
`error` TEXT NULL,
`created_at` DATETIME NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- store course term
ALTER TABLE `courses` ADD COLUMN `term` VARCHAR(50) NULL DEFAULT NULL;
--- END: Added by DB upgrade to version 17
|
<reponame>pazuzu-io/pazuzu-registry
INSERT INTO FEATURE (NAME, DESCRIPTION, CREATED_AT, UPDATED_AT, STATUS, AUTHOR, SNIPPET, TEST_SNIPPET) VALUES
('node', 'dummy node feature', now(), now(), 'APPROVED', 'Pazuzu team',
'RUN set -ex \
&& for key in \
9554F04D7259F04124DE6B476D5A82AC7E37093B \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
; do \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
done
ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 5.11.1
RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt',
'
@test "Check that Node.js is installed" {
command node --version
}');
|
<filename>_test/MySQL/6.sql
-- 测试CHAR 和 VARCHAR
CREATE TABLE test_str(
a CHAR(5),
b VARCHAR(5)
);
INSERT test_str (a,b) VALUES ('name', 'name2');
INSERT test_str (a,b) VALUES ('', '');
INSERT test_str (a,b) VALUES ('a', 'a');
INSERT test_str (a,b) VALUES ('ab', 'ab');
INSERT test_str (a,b) VALUES ('abc', 'abc');
INSERT test_str (a,b) VALUES ('abcdef', 'abcdef');
INSERT test_str (a,b) VALUES (' 123 ', ' 123 ');
-- 测试TEXT不能有默认值
CREATE TABLE test_str1 (
content TEXT DEFAULT 'THIS IS A TEXT'
);
-- 测试ENUM
CREATE TABLE test_ENUM(
sex ENUM('男','女','保密')
);
INSERT test_ENUM (sex) VALUES('男');
INSERT test_ENUM (sex) VALUES(NULL);
INSERT test_ENUM (sex) VALUES(1);
-- SET
CREATE TABLE test_set(
a SET('A','B','C')
);
INSERT test_set (a) VALUES('A');
INSERT test_set (a) VALUES('B');
INSERT test_set (a) VALUES('C');
INSERT test_set (a) VALUES('A,B,C');
|
<gh_stars>1-10
create database dashboard collate utf8_unicode_ci;
use dashboard;
create table tb_vendas(
id int not null primary key auto_increment,
data_venda datetime default current_timestamp,
total float(10,2) not null
);
create table tb_clientes(
id int not null primary key auto_increment,
cliente_ativo boolean default true
);
create table tb_contatos(
id int not null primary key auto_increment,
tipo_contato int not null
);
create table tb_despesas(
id int not null primary key auto_increment,
data_despesa datetime default current_timestamp,
total float(10,2) not null
);
insert into tb_vendas(data_venda, total)values('2018-08-15', 150.20);
insert into tb_vendas(data_venda, total)values('2018-08-16', 255.36);
insert into tb_vendas(data_venda, total)values('2018-08-18', 70.95);
insert into tb_vendas(data_venda, total)values('2018-09-01', 35.00);
insert into tb_vendas(data_venda, total)values('2018-09-11', 2047.12);
insert into tb_vendas(data_venda, total)values('2018-09-19', 122.85);
insert into tb_vendas(data_venda, total)values('2018-09-23', 957.14);
insert into tb_vendas(data_venda, total)values('2018-10-01', 333.55);
insert into tb_vendas(data_venda, total)values('2018-10-02', 100.33);
insert into tb_vendas(data_venda, total)values('2018-10-03', 1853.12);
insert into tb_vendas(data_venda, total)values('2018-10-04', 47.47);
-- true/1 = ativo | false/0 = inativo
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(false);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(false);
insert into tb_clientes(cliente_ativo)values(false);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(true);
insert into tb_clientes(cliente_ativo)values(false);
insert into tb_clientes(cliente_ativo)values(true);
-- 1 = crítica | 2 = sugestão | 3 = elogio
insert into tb_contatos(tipo_contato)values(1);
insert into tb_contatos(tipo_contato)values(1);
insert into tb_contatos(tipo_contato)values(2);
insert into tb_contatos(tipo_contato)values(1);
insert into tb_contatos(tipo_contato)values(3);
insert into tb_contatos(tipo_contato)values(2);
insert into tb_contatos(tipo_contato)values(1);
insert into tb_contatos(tipo_contato)values(1);
insert into tb_contatos(tipo_contato)values(3);
insert into tb_contatos(tipo_contato)values(3);
insert into tb_contatos(tipo_contato)values(3);
insert into tb_contatos(tipo_contato)values(1);
insert into tb_contatos(tipo_contato)values(2);
insert into tb_contatos(tipo_contato)values(2);
insert into tb_contatos(tipo_contato)values(1);
insert into tb_despesas(data_despesa, total)values('2018-08-20', 93.47);
insert into tb_despesas(data_despesa, total)values('2018-09-01', 350.27);
insert into tb_despesas(data_despesa, total)values('2018-09-04', 108.12);
insert into tb_despesas(data_despesa, total)values('2018-09-20', 15.66);
insert into tb_despesas(data_despesa, total)values('2018-10-03', 83.55);
|
select track.title, artist.name, genre.name
from track join genre join album join artist on
track.genre_id = genre.genre_id and track.album_id = album.album_id and album.artist_id = artist.artist_id
order by album.name;
|
<filename>Database Scripts/Views/Answer_Standards_InScope.view.sql
CREATE VIEW [dbo].[Answer_Standards_InScope]
AS
select distinct mode='Q', a.assessment_id, a.answer_id, is_requirement=0, a.question_or_requirement_id, a.mark_for_review,
a.comment, a.alternate_justification, a.question_number, a.answer_text,
a.component_guid, a.is_component, a.custom_question_guid,a.is_framework,a.old_answer_id, a.reviewed, a.FeedBack
,c.Simple_Question as Question_Text
FROM Answer_Questions_No_Components a
join NEW_QUESTION c on a.Question_Or_Requirement_Id = c.Question_Id
join (
select distinct s.Question_Id, v.Assessment_Id as std_assessment_id
from NEW_QUESTION_SETS s
join AVAILABLE_STANDARDS v on s.Set_Name = v.Set_Name
join NEW_QUESTION_LEVELS l on s.New_Question_Set_Id = l.new_question_set_id
where v.Selected = 1
and l.Universal_Sal_Level = (
select ul.Universal_Sal_Level from STANDARD_SELECTION ss join UNIVERSAL_SAL_LEVEL ul on ss.Selected_Sal_Level = ul.Full_Name_Sal
where Assessment_Id = v.Assessment_Id
)
) s on c.Question_Id = s.Question_Id and s.std_assessment_id = a.Assessment_Id
union
select distinct mode='R', a.assessment_id, a.answer_id, is_requirement=1, a.question_or_requirement_id,a.mark_for_review,
a.comment, a.alternate_justification, a.question_number, a.answer_text,
a.component_guid, a.is_component, a.custom_question_guid, a.is_framework, a.old_answer_id, a.reviewed, a.FeedBack
,req.Requirement_Text as Question_Text
from Answer_Requirements a
join REQUIREMENT_SETS rs on a.Question_Or_Requirement_Id = rs.Requirement_Id and a.is_requirement= 1
join STANDARD_SELECTION ss on a.Assessment_Id = ss.assessment_id
join [SETS] s on rs.Set_Name = s.Set_Name
join AVAILABLE_STANDARDS v on s.Set_Name = v.Set_Name and ss.assessment_id = v.assessment_id
join NEW_REQUIREMENT req on rs.Requirement_Id = req.Requirement_Id
join REQUIREMENT_LEVELS rl on rl.Requirement_Id = req.Requirement_Id and rl.Standard_Level=dbo.convert_sal(ss.Selected_Sal_Level)
where v.selected=1
|
<filename>surveys/surveys.postgres.sql<gh_stars>10-100
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email TEXT NOT NULL,
password_digest TEXT NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL
);
ALTER TABLE users ADD UNIQUE (email);
CREATE TABLE surveys (
id SERIAL PRIMARY KEY,
author_id INTEGER NOT NULL,
title TEXT NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
FOREIGN KEY (author_id) REFERENCES users(id)
);
CREATE INDEX ON surveys(author_id);
CREATE TABLE survey_choices (
id SERIAL PRIMARY KEY,
survey_id INTEGER NOT NULL,
description TEXT NOT NULL,
FOREIGN KEY (survey_id) REFERENCES surveys(id)
);
CREATE INDEX ON survey_choices(survey_id);
CREATE TABLE survey_responses (
id SERIAL PRIMARY KEY,
survey_id INTEGER NOT NULL,
respondent_id INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
FOREIGN KEY (survey_id) REFERENCES surveys(id),
FOREIGN KEY (respondent_id) REFERENCES users(id)
);
ALTER TABLE survey_responses ADD UNIQUE (survey_id, respondent_id);
CREATE INDEX ON survey_responses(respondent_id);
CREATE TABLE survey_response_choices (
id SERIAL PRIMARY KEY,
survey_choice_id iNTEGER NOT NULL,
survey_response_id INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
FOREIGN KEY (survey_choice_id) REFERENCES survey_choices(id),
FOREIGN KEY (survey_response_id) REFERENCES survey_responses(id)
);
ALTER TABLE survey_response_choices ADD UNIQUE (survey_choice_id, survey_response_id);
CREATE INDEX ON survey_response_choices(survey_response_id);
|
<reponame>LOLICOL1/CodeRepos<filename>samples/security-oauth-sample/security-5x/security-authorization-server/src/main/resources/data-mysql.sql<gh_stars>1-10
INSERT INTO `oauth_client_details`(`client_id`, `resource_ids`, `client_secret`, `scope`,
`authorized_grant_types`, `web_server_redirect_uri`,
`authorities`, `access_token_validity`,
`refresh_token_validity`, `additional_information`,
`autoapprove`)
VALUES ('gateway', '',
'{sha256}12425bfe64aff82ba9c2f7d1464fde5454bd8d309b9a41180468e0dcfd61aa352f4f0dd4aa3e8d22',
'all', 'authorization_code,password,refresh_token',
'http://localhost:8080/login/oauth2/code/auth-server', '', NULL, NULL, '{}',
'all');
INSERT INTO `oauth_client_details`(`client_id`, `resource_ids`, `client_secret`, `scope`,
`authorized_grant_types`, `web_server_redirect_uri`,
`authorities`, `access_token_validity`,
`refresh_token_validity`, `additional_information`,
`autoapprove`)
VALUES ('resource', '',
'{sha256}251db28971a7bfc6ee6815ea61c4baca176d5336c358d7d4281a324c9893eec8d018dcc46abc323c',
'', '', '', '', NULL, NULL, '{}', '');
INSERT INTO `oauth_client_details`(`client_id`, `resource_ids`, `client_secret`, `scope`,
`authorized_grant_types`, `web_server_redirect_uri`,
`authorities`, `access_token_validity`,
`refresh_token_validity`, `additional_information`,
`autoapprove`)
VALUES ('oauth-client', 'user_info',
'{sha256}10e50cec2f66758747a24eb9d48ac42f815c909482ca2f80b0ef5bf8d6917ef27e297f959665460a',
'user_info.read', 'authorization_code,refresh_token,client_credentials,password',
'http://localhost:8000/authorized', '', NULL, NULL, '{}', NULL);
|
<reponame>phong016688/TTCN_WEB<filename>ttcn/src/main/resources/dbschema/testdata/user_test.sql<gh_stars>0
INSERT INTO public.user (email, password, firstname, lastname)
VALUES ('<EMAIL>','$2a$10$8Cof0cOQrqgVy.Pa/dDRW.8ZTm9kltOS4kodL0qW9TFewHwe/AUcW','Gin','Do');
INSERT INTO public.user (email, password, firstname, lastname)
VALUES ('<EMAIL>','$2a$10$8Cof0cOQrqgVy.Pa/dDRW.8ZTm9kltOS4kodL0qW9TFewHwe/AUcW','nhi','nguyen');
INSERT INTO public.user (email, password, firstname, lastname)
VALUES ('<EMAIL>','$2a$10$8Cof0cOQrqgVy.Pa/dDRW.8ZTm9kltOS4kodL0qW9TFewHwe/AUcW','Kai','Do');
|
<filename>Computer_science/E01_MySQL/S1_Basic/S1_04_Filters.sql
/*
Filters
*/
USE classicmodels;
--T-- WHERE (field1 <> 'value1') OR (field2 > 30 AND field3 < 67) OR (field4 = "Keyword")
SELECT
lastName,
firstName,
jobTitle
FROM
employees
WHERE
jobTitle <> 'Sales Rep';
--T-- WHERE field1 = 'value1' AND field2 = 'value2'
SELECT
customerName,
country,
state,
creditlimit
FROM
customers
WHERE country = 'USA'
AND state = 'CA'
AND creditlimit > 100000;
--T-- OR (same logic as with AND)
SELECT
customerName,
country,
creditlimit
FROM
customers
WHERE(country = 'USA'
OR country = 'France')
AND creditlimit > 100000;
--T-- WHERE field [NOT] IN ('value1','value2')
SELECT
officeCode,
city,
phone,
country
FROM
offices
WHERE
country NOT IN ('USA', 'France');
--T-- WHERE field BETWEEN 'value1' AND 'value2'
SELECT
productCode,
productName,
buyPrice
FROM
products
WHERE
buyPrice BETWEEN 20 AND 100;
--T-- The falues for the BETWEEN clause can be strings too, in that case, the collation order is used
SELECT * FROM db1.table1;
+--------+--------+--------+
| field1 | field2 | field3 |
+--------+--------+--------+
| 12 | bcde | 54 |
| 17 | mno | 107 |
| 28 | vwxyz | 500 |
+--------+--------+--------+
SELECT * FROM db1.table1 WHERE field2 BETWEEN 'ghi' AND 'qrst';
+--------+--------+--------+
| field1 | field2 | field3 |
+--------+--------+--------+
| 17 | mno | 107 |
+--------+--------+--------+
--T-- WHERE field LIKE '%ending'; the percent % acts as a regex quantifier
SELECT
employeeNumber,
lastName,
firstName
FROM
employees
WHERE
lastName LIKE '%on';
--T-- LIMIT offsetN, countN, this limits the returned records to countN starting at offsetN
SELECT
productName,
buyPrice
FROM
products
ORDER BY
buyPrice DESC
LIMIT 1, 1;
--T-- WHERE field IS NULL, this returns the records where field has a null value
SELECT
customerName,
country,
salesrepemployeenumber
FROM
customers
WHERE
salesrepemployeenumber IS NULL
ORDER BY customerName;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.