blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 3 276 | src_encoding stringclasses 33
values | length_bytes int64 23 9.61M | score float64 2.52 5.28 | int_score int64 3 5 | detected_licenses listlengths 0 44 | license_type stringclasses 2
values | text stringlengths 23 9.43M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
50350e199a6c3b159a6c675824816698616bab29 | SQL | kpse/web-1 | /conf/evolutions/default/26.sql | UTF-8 | 741 | 3.046875 | 3 | [] | no_license | # --- !Ups
CREATE TABLE advertisement (
uid INT(11) NOT NULL AUTO_INCREMENT,
school_id VARCHAR(20) NOT NULL,
position_id INT(11) default 0,
link text NOT NULL,
image text NOT NULL,
name VARCHAR(20) NOT NULL default '',
status INT DEFAULT 1,
update_at BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (uid)
);
INSERT INTO advertisement (school_id, position_id, link, image, name, update_at) VALUES
('93740362', 1, 'https://www.cocobabys.com/', 'https://www.cocobabys.com/assets/images/hero-1.jpg', '库乐宝', 1401140055960),
('93740362', 2, 'https://stage2.cocobabys.com/', 'https://www.cocobabys.com/assets/images/hero-2.jpg', '库乐宝', 1401150055960);
# --- !Downs
DROP TABLE IF EXISTS advertisement; | true |
8263c4a34292a5775f7bd8806b5df6d1b0fc3dde | SQL | Kwamenas/SQL | /2gbabove.sql | UTF-8 | 4,668 | 3.78125 | 4 | [] | no_license | select sum((CHARGE1+CHARGE2)/(1024*1024)),ACCT_ID1,BILLING_NBR from event_usage_c_3037@link_rb where trunc(start_time)
between'02-JAN-2017' and '06-JAN-2017' and BILLING_NBR>'233001099' --AND sum((CHARGE1+CHARGE2)/(1024*1024))>='2.0'
GROUP BY ACCT_ID1,BILLING_NBR
--34014361
--113157
select distinct phone_number from
(select sum(CHARGE1+CHARGE2+CHARGE3+CHARGE4) total_usage,ACCT_ID1,BILLING_NBR, phone_number from event_usage_c_303@link_rb a, bal b, subs c, cust d where trunc(start_time)
between'02-JAN-2017' and '06-JAN-2017' and BILLING_NBR>'233001099'
and bal_id=bal_id1
and ACCT_ID1=b.acct_id
and acct_res_id in (1,2,3,9,10,11,12)
and b.acct_id=c.acct_id
and c.cust_id=d.cust_id
GROUP BY ACCT_ID1,BILLING_NBR) a where (total_usage/(1024*1024))>=2;
select a.* from
(select sum(CHARGE1+CHARGE2+CHARGE3+CHARGE4) total_usage,ACCT_ID1,BILLING_NBR from event_usage_c_3037@link_rb a, bal b where trunc(start_time)
between trunc(sysdate-2)and trunc(sysdate-1) and BILLING_NBR>'233001099'
and bal_id=bal_id1
and ACCT_ID1=b.acct_id
and acct_res_id in (1,2,3,9,10,11,12)
GROUP BY ACCT_ID1,BILLING_NBR) a where (total_usage/(1024*1024))>=2
select total_usage,ACCT_ID1,substr(BILLING_NBR,4) BILLING_NBR,case when first_name is null
then 'Customer'
else first_name
end first_name,phone_number,BONUS_TO_GIVE, BONUS_TO_GIVE/(1024*1024) BONUS_TO_GIVE_GB from
(select distinct round(total_usage/(1024*1024),2) total_usage,ACCT_ID1,BILLING_NBR,first_name,phone_number, case when /**total_usage/(1024*1024)>=2 and**/ total_usage/(1024*1024)>=5
then '5242880'
--when total_usage/(1024*1024)>=5 and total_usage/(1024*1024)<10
--then '5242880'
--when total_usage/(1024*1024)>=10 and total_usage/(1024*1024)<25
--then '10485760'
--when total_usage/(1024*1024)>=25
--then '26214400'
else '0'
END BONUS_TO_GIVE from
(select sum(CHARGE1+CHARGE2+CHARGE3+CHARGE4) total_usage,ACCT_ID1,BILLING_NBR from event_usage_c_3046@link_rb a, bal b where trunc(start_time)
between trunc(sysdate-7)and trunc(sysdate-3) and BILLING_NBR>'233001099'
and bal_id=bal_id1
and ACCT_ID1=b.acct_id
and acct_res_id in (1,3,9,10,11,12)
GROUP BY ACCT_ID1,BILLING_NBR) a, subs b, cust c, prod d, offer e, subs_upp_inst f where (total_usage/(1024*1024))>=5
and acct_id1=acct_id
and b.cust_id=c.cust_id
and b.subs_id=d.prod_id
and d.offer_id=526
and d.offer_id=e.offer_id
and e.offer_type=2
and b.subs_id=f.subs_id
--and c.phone_number IS NOT NULL
)
--and price_plan_id in (129,130,131,132,133,134,1910,1909,1908,1907))
select * from acct_res
select * from billing_cycle
select * from billing_cycle where billing_cycle_type_id=1;
select * from billing_cycle_type
select * from acct_res
select total_usage,ACCT_ID1,substr(BILLING_NBR,4) BILLING_NBR,case when first_name is null
then 'Customer'
else first_name
end first_name,phone_number,BONUS_TO_GIVE, BONUS_TO_GIVE/(1024*1024) BONUS_TO_GIVE_GB from
(select distinct round(total_usage/(1024*1024),2) total_usage,ACCT_ID1,BILLING_NBR,first_name,phone_number,
case when total_usage/(1024*1024)>=2
and total_usage/(1024*1024)<5 then '2097152'
when total_usage/(1024*1024)>=5 and total_usage/(1024*1024)<10
then '5242880'
when total_usage/(1024*1024)>=10 and total_usage/(1024*1024)<25
then '10485760'
when total_usage/(1024*1024)>=25
then '26214400'
else '0'
END BONUS_TO_GIVE from
(select sum(CHARGE1+CHARGE2+CHARGE3+CHARGE4) total_usage,ACCT_ID1,BILLING_NBR from event_usage_c_3043@link_rb a, bal b where trunc(start_time)
between trunc(sysdate-8)and trunc(sysdate-4) and BILLING_NBR>'233001099'
and bal_id=bal_id1
and ACCT_ID1=b.acct_id
and acct_res_id in (1,2,3,9,10,11,12)
GROUP BY ACCT_ID1,BILLING_NBR) a, subs b, cust c, prod d, offer e, subs_upp_inst f where (total_usage/(1024*1024))>=2
and acct_id1=acct_id
and b.cust_id=c.cust_id
and b.subs_id=d.prod_id
and d.offer_id=526
and d.offer_id=e.offer_id
and e.offer_type=2
and b.subs_id=f.subs_id
--and price_plan_id in (129,130,131,132,133,134,1910,1909,1908,1907))
and phone_number is not NULL
)
select * from billing_cycle where billing_cycle_type_id =1
select * from bal where acct_id='43019880' and bal_id='2375153';
update bal set exp_date='2017-05-01 06:57:06.000000'
select * from bal where gross_bal='-5242880' and acct_res_id=7 and eff_date like'%2017-04-29%' and exp_date like '%2017-05-02%'
select * from subs
select * from cust
select * from prod
select * from offer where offer_name like '%Corporate%'
SELECT ACCT_ID FROM BAL where EFF_DATE like'%2017-01-27%' AND ACCT_RES_ID=2 AND EXP_DATE like'%2017-01-31%'
AND ACCT_ID IN()
| true |
de5e0efdb90eb598b1ea2b37dc1e14c6e75dc5dc | SQL | liviamano/NRT-spatiotemporal-vis | /backend/src/main/java/master/data/download/queries.sql | UTF-8 | 12,632 | 4.03125 | 4 | [] | no_license | -- wsg 84
ALTER table no2data
ADD COLUMN polygon84 varchar(100000);
SELECT AddGeometryColumn('public', 'no2data', 'polygon84', 4326, 'POLYGON', 2);
UPDATE "no2data"
SET polygon84 = ST_Transform(ST_SetSRID(point, 4326), 4326);
-- Count number of points in polygon
SELECT city_merge.city, city_merge.date, count(no2data.point) AS totale
FROM city_merge
LEFT JOIN no2data
ON st_contains(ST_SetSRID(city_merge.polygon, 4326), ST_SetSRID(no2data.point, 4326))
GROUP BY city_merge.city, city_merge.date;
-- INDEXING
SELECT *
FROM pg_indexes
WHERE tablename = 'citypolygon';
CREATE INDEX city_geom ON citypolygon1
USING gist (polygon);
create index point_geom on no2data_new using gist (point);
-- SRID
select UpdateGeometrySRID('public', 'citypolygon1', 'polygon', 4326);
select UpdateGeometrySRID('public', 'no2data', 'point', 0);
-- Statistics
select r.city as city, max(s.value) as total_value
from regionstatistic as r
join regionstatistic_statistic rs on r.id = rs.regionstatistic_id
join statistic s on rs.statistics_id = s.id
join citypolygon c on r.city = c.city
where c.level = '6'
group by r.city
order by total_value desc
limit 5;
update regionstatistic as reg
set level = subQ.level
from (
select r.city as city, c.level as level
from regionstatistic r
join citypolygon c on c.city = r.city
) as subQ
where reg.city = subQ.city;
-- latest update
select date, count(*)
from city_merge
group by date
order by date desc;
-- heatmap
select CAST(json_agg(jsonb_build_object('lat', latitude, 'long', longitude, 'val', val)) as TEXT)
from (select latitude, longitude, avg(no2total) as val
from no2data
where quality > 50
and date::varchar = '2020-01-05'
group by latitude, longitude) t;
select CAST(json_agg(json_build_object('id', city, 'text', city)) as TEXT)
from (select city from citypolygon) citypolygon;
CREATE EXTENSION postgis;
SELECT PostGIS_version();
SELECT *
FROM information_schema.tables
WHERE table_schema = 'public';
select date
from statistic
group by date;
select *
from statistic
where id = 1028957;
select city
from citypolygon1;
-- DELETE statement
DELETE
FROM regionstatistic
WHERE id IN (SELECT regionstatistic.id
FROM regionstatistic
inner join regionstatistic_statistic rs on regionstatistic.id = rs.regionstatistic_id
inner join statistic s on rs.statistics_id = s.id
WHERE date = '2020-10-20'
);
create table so2data
(
id SERIAL,
date DATE,
latitude double precision,
longitude double precision,
so2total double precision,
quality double precision,
timeutc timestamp
);
select addgeometrycolumn('public', 'so2data', 'point', 4326, 'POINT', 2);
create table o3data
(
id SERIAL,
date DATE,
latitude double precision,
longitude double precision,
o3total double precision,
quality double precision,
timeutc timestamp
);
select addgeometrycolumn('public', 'o3data', 'point', 4326, 'POINT', 2);
create table city_merge_so2
(
city VARCHAR,
date DATE,
avg_value float,
avg_quality float,
count int,
level varchar(20),
product VARCHAR
);
create table city_merge_o3
(
city VARCHAR,
date DATE,
avg_value float,
avg_quality float,
count int,
level varchar(20),
product VARCHAR
);
ALTER TABLE no2data_new
ADD PRIMARY KEY (date, point);
ALTER TABLE so2data
ADD PRIMARY KEY (date, point);
ALTER TABLE o3data
ADD PRIMARY KEY (date, point);
ALTER TABLE city_merge
ADD PRIMARY KEY (city, date);
ALTER TABLE city_merge_so2
ADD PRIMARY KEY (city, date);
ALTER TABLE city_merge_o3
ADD PRIMARY KEY (city, date);
alter table no2data_new
rename to no2data_old;
create table no2data_new
(
id SERIAL,
date DATE,
latitude double precision,
longitude double precision,
no2total double precision,
quality double precision,
timeutc timestamp
);
select addgeometrycolumn('public', 'no2data_new', 'point', 4326, 'POINT', 2);
alter table city_merge
rename to city_merge_old;
create table city_merge
(
city VARCHAR,
date DATE,
avg_value float,
avg_quality float,
count int,
level varchar(20),
product VARCHAR
);
insert into city_merge(city, date)
values ('city', now())
ON CONFLICT (city, date) do nothing;
SELECT date,
level,
jsonb_build_object(
'type', 'FeatureCollection',
'features', jsonb_agg(features.feature)
) as collection
FROM (
SELECT date,
level,
jsonb_build_object(
'type', 'Feature',
'id', 1,
'geometry', ST_AsGeoJSON(CAST(polygon AS geometry))::jsonb,
'properties',
json_build_object('value', no2val * 1000000, 'name', city, 'date', date, 'level', level,
'count', no2count, 'no2quality', no2qa,
'so2value', so2val, 'so2quality', so2qa, 'so2count', so2count,
'o3value', o3val, 'o3quality', o32qa, 'o3count', o3count)
) AS feature
FROM (
select p.city,
date,
p.level,
no2val,
no2qa,
no2count,
so2val,
so2qa,
so2count,
o3val,
o32qa,
o3count,
p.polygon
from citypolygon1 p
join (
select n.city,
n.date,
n.avg_value as no2val,
n.avg_quality as no2qa,
n.count as no2count,
s.avg_value as so2val,
s.avg_quality as so2qa,
s.count as so2count,
o.avg_value as o3val,
o.avg_quality as o32qa,
o.count as o3count
from city_merge n
full outer join city_merge_so2 s on n.city = s.city and n.date = s.date
full outer join city_merge_o3 o on n.city = o.city and n.date = o.date
where n.date::varchar = '2020-11-17'
) merges
on p.city = merges.city
) inputs) features
GROUP BY date, level;
select p.city,
date,
p.level,
no2val,
no2qa,
no2count,
so2val,
so2qa,
so2count,
o3val,
o32qa,
o3count,
p.polygon
from citypolygon1 p
full outer join (
select n.city,
n.date,
n.avg_value as no2val,
n.avg_quality as no2qa,
n.count as no2count,
s.avg_value as so2val,
s.avg_quality as so2qa,
s.count as so2count,
o.avg_value as o3val,
o.avg_quality as o32qa,
o.count as o3count
from city_merge n
full outer join city_merge_so2 s on n.city = s.city and n.date = s.date
full outer join city_merge_o3 o on n.city = o.city and n.date = o.date
where n.date::varchar = '2020-11-17'
) merges
on p.city = merges.city;
delete
from city_merge_geojson_3
where date::varchar = '2020-11-17';
select date, level, geojson
from city_merge_geojson_3
where date::varchar = '2020-11-17';
select distinct city
from citypolygon1
where level::integer < 6;
select distinct to_char(date, 'yyyy-MM-dd') as date, avg_value * 1000000 as values
from city_merge
where city = 'Saxony'
order by date asc;
select distinct to_char(date, 'yyyy-MM-dd') as date, avg_value * 1000000 as values
from city_merge
where city = 'Saxony'
order by date asc;
select distinct to_char(date, 'yyyy-MM-dd') as date, avg_value * 1000000 as values
from city_merge_so2
where city = 'Saxony'
order by date asc;
select n.city,
n.date,
n.avg_value as no2val,
n.avg_quality as no2qa,
n.count as no2count,
s.avg_value as so2val,
s.avg_quality as so2qa,
s.count as so2count,
o.avg_value as o3val,
o.avg_quality as o32qa,
o.count as o3count
from city_merge n
full outer join city_merge_so2 s on n.city = s.city and n.date = s.date
full outer join city_merge_o3 o on n.city = o.city and n.date = o.date
where n.date::varchar = '2020-11-17';
SELECT c.city,
n.date,
avg(n.no2total) filter ( where n.quality > 50 ) as avg_value,
avg(n.no2total) as low_avg,
avg(n.quality) as avg_quality,
count(n.point) as count,
c.level
FROM no2data_new as n
inner join citypolygon1 as c
on ST_Intersects(n.point, c.polygon)
WHERE n.date::varchar = '2020-11-23' and level = '4' and n.quality!=0
GROUP BY c.city, n.date, c.level;
alter table city_merge
add column low_avg double precision;
alter table city_merge_so2
add column low_avg double precision;
alter table region_stats
add column o3lowValue double precision;
create table citypolygon_geojson(
level VARCHAR,
geojson VARCHAR);
insert into citypolygon_geojson(
SELECT level,
jsonb_build_object(
'type', 'FeatureCollection',
'features', jsonb_agg(features.feature)
) as collection
FROM (
SELECT
level,
jsonb_build_object(
'type', 'Feature',
'id', 1,
'geometry', ST_AsGeoJSON(CAST(polygon AS geometry))::jsonb,
'properties',
json_build_object('name', city, 'level', level)
) AS feature
FROM (
select p.city,
p.level,
p.polygon
from citypolygon1 p
where p.level::integer != '8'
) inputs) features
GROUP BY level
);
select city, avg(avg_value)* 1000000 as cleanedAvg,
min(avg_value) * 1000000 as min,
max(avg_value) * 1000000 as max,
avg(low_avg) * 1000000 as realAvg
from city_merge
where city = 'Berlin'
group by city;
select c.city,
avg(n.no2total) filter ( where n.quality > 50) * 1000000 as cleanVal,
avg(n.no2total) filter ( where n.quality < 50) * 1000000 as badVal,
min(n.no2total) filter ( where n.quality > 50) * 1000000 as min,
max(n.no2total) filter ( where n.quality > 50) * 1000000 as max,
avg(n.no2total) filter ( where n.quality > 50)* 1000000 as realAvg,
count(n.point) filter ( where n.quality < 50) as countBad,
count(n.point) filter ( where n.quality > 50) as countGood,
count(n.point) as countAll
from no2data_new n
inner join citypolygon1 c on st_intersects(n.point, c.polygon)
where c.city in ('Stuttgart', 'Berlin') and quality > 2
group by c.city;
select region_stats.date, region_stats.value, region_stats.so2value from region_stats
join regions r on region_stats.r_id = r.r_id
where r.city='Berlin';
select so2value
from region_stats;
select count(so2value)
from region_stats;
select count(so2value)
from region_stats
where ABS(so2value) > 0;
select r.city, rs.date, rs.value * 1000000 as value, rs.quality, ABS(rs.so2value) * 1000000 as so2value, rs.so2quality,
rs.o3value as o3value, rs.o3quality, r.mad, r.no_points, r.anomalies
from regions r
inner join region_stats rs on r.r_id = rs.r_id
where r.city = ? order by rs.date ASC;
select count(*) from citypolygon1;
alter table regions
add column population integer;
alter table regions
add column factories integer;
alter table regions
add column airports integer;
select count(*) from regions; | true |
08fe3c692fab54a4e7a727ac374a7fac1284bb9b | SQL | emeraldjava/bhaa-zend | /sql/Procs/RacePoints/addAllRacePoints.sql | UTF-8 | 428 | 2.984375 | 3 | [] | no_license | DELIMITER $$
CREATE PROCEDURE `addAllRacePoints` (_race int)
BEGIN
delete from racepoints where race = _race;
insert into racepoints(race, runner, pointsbystandard, pointsbyscoringset)
select
race,
runner,
10.1 - (positioninstandard * 0.1) as pointsbystandard,
10.1 - (positioninscoringset * 0.1) as pointsbyscoringset
from racepointsdata where race = _race;
END
| true |
9d889c5ab6a0bc7df27dbffe75dad8459d93fec5 | SQL | dwitiacahyani/UASLara-16090049 | /ujian123.sql | UTF-8 | 5,210 | 2.671875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 14 Jul 2019 pada 16.58
-- Versi server: 10.1.33-MariaDB
-- Versi PHP: 7.2.6
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: `ujian123`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `data_karyawans`
--
CREATE TABLE `data_karyawans` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `data_karyawans`
--
INSERT INTO `data_karyawans` (`id`, `title`, `description`, `image`, `created_at`, `updated_at`) VALUES
(1, 'widi', 'tegal', 'karyawan/wrTQOhemXgpTyLb28ukQF3O55TDAuYg4D4V2zkrX.png', '2019-07-14 06:43:34', '2019-07-14 06:43:34');
-- --------------------------------------------------------
--
-- Struktur dari tabel `data_obats`
--
CREATE TABLE `data_obats` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `data_obats`
--
INSERT INTO `data_obats` (`id`, `title`, `description`, `image`, `created_at`, `updated_at`) VALUES
(1, 'parasetamol', 'obat penurun panas, pusing', 'obat/OOq63xEBVeEHrQCoExZSBLmivrUzy9I0iD60lq3h.jpeg', '2019-07-10 12:27:58', '2019-07-10 13:18:41');
-- --------------------------------------------------------
--
-- Struktur dari tabel `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `migrations`
--
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, '2019_07_10_122410_create_data_obats_table', 1),
(4, '2019_07_10_181643_create_data_karyawans_table', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `data_karyawans`
--
ALTER TABLE `data_karyawans`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `data_obats`
--
ALTER TABLE `data_obats`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indeks untuk tabel `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `data_karyawans`
--
ALTER TABLE `data_karyawans`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `data_obats`
--
ALTER TABLE `data_obats`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
4082be772375978fb4e2e0ae2098174e46ca21d7 | SQL | vcrfxia/ksql | /ksqldb-functional-tests/src/test/resources/sql-tests/query-upgrades/alter.sql | UTF-8 | 3,548 | 3.796875 | 4 | [
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] | permissive | -- this file tests adding columns
----------------------------------------------------------------------------------------------------
--@test: add columns to DDL stream
-- this test uses a DML to test because of https://github.com/confluentinc/ksql/issues/6058
----------------------------------------------------------------------------------------------------
SET 'ksql.create.or.replace.enabled' = 'true';
CREATE STREAM a (id INT KEY, col1 INT) WITH (kafka_topic='a', value_format='JSON');
ALTER STREAM a ADD COLUMN col2 INT;
CREATE STREAM b AS SELECT * FROM a;
INSERT INTO a (id, col1, col2) VALUES (1, 1, 1);
ASSERT VALUES b (id, col1, col2) VALUES (1, 1, 1);
----------------------------------------------------------------------------------------------------
--@test: add columns to DDL table
-- this test uses a DML to test because of https://github.com/confluentinc/ksql/issues/6058
----------------------------------------------------------------------------------------------------
SET 'ksql.create.or.replace.enabled' = 'true';
CREATE TABLE a (id INT PRIMARY KEY, col1 INT) WITH (kafka_topic='a', value_format='JSON');
ALTER TABLE a ADD COLUMN col2 INT;
CREATE TABLE b AS SELECT * FROM a;
INSERT INTO a (id, col1, col2) VALUES (1, 1, 1);
ASSERT VALUES b (id, col1, col2) VALUES (1, 1, 1);
----------------------------------------------------------------------------------------------------
--@test: add columns to stream defined by CSAS
--@expected.error: io.confluent.ksql.util.KsqlException
--@expected.message: ALTER command is not supported for CREATE ... AS statements.
----------------------------------------------------------------------------------------------------
SET 'ksql.create.or.replace.enabled' = 'true';
CREATE STREAM a (id INT KEY, col1 INT, col2 INT) WITH (kafka_topic='a', value_format='JSON');
CREATE STREAM b AS SELECT id, col1 FROM a;
ALTER STREAM b ADD COLUMN col2 INT;
----------------------------------------------------------------------------------------------------
--@test: add columns to table defined by CTAS
--@expected.error: io.confluent.ksql.util.KsqlException
--@expected.message: ALTER command is not supported for CREATE ... AS statements.
----------------------------------------------------------------------------------------------------
SET 'ksql.create.or.replace.enabled' = 'true';
CREATE TABLE a (id INT PRIMARY KEY, col1 INT, col2 INT) WITH (kafka_topic='a', value_format='JSON');
CREATE TABLE b AS SELECT id, col1 FROM a;
ALTER TABLE b ADD COLUMN col2 INT;
----------------------------------------------------------------------------------------------------
--@test: add an already existing column to a stream
--@expected.error: io.confluent.ksql.util.KsqlException
--@expected.message: Cannot add column `COL1` to schema. A column with the same name already exists.
----------------------------------------------------------------------------------------------------
SET 'ksql.create.or.replace.enabled' = 'true';
CREATE STREAM a (id INT KEY, col1 INT, col2 INT) WITH (kafka_topic='a', value_format='JSON');
ALTER STREAM a ADD COLUMN col1 INT;
----------------------------------------------------------------------------------------------------
--@test: alter a nonexistent stream
--@expected.error: io.confluent.ksql.util.KsqlException
--@expected.message: Source A does not exist
----------------------------------------------------------------------------------------------------
SET 'ksql.create.or.replace.enabled' = 'true';
ALTER STREAM a ADD COLUMN col1 INT; | true |
fa240e07228fad161c24ff34783782115771a27f | SQL | mindok/CDArchiver | /CDArchiver/DBSetup.SQL | UTF-8 | 718 | 3.640625 | 4 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive |
--DROP TABLE FileDetails
--DROP TABLE CdDetails
CREATE TABLE CdDetails (
CdId NVARCHAR(50) NOT NULL,
ScannedBy NVARCHAR(50) NOT NULL,
ScannedDate DATETIME NOT NULL,
Notes NVARCHAR(2000) NULL,
CONSTRAINT PK_CdDetails PRIMARY KEY CLUSTERED (CdId)
)
CREATE TABLE FileDetails (
FileId INT NOT NULL IDENTITY (1,1),
CdId NVARCHAR(50) NOT NULL REFERENCES CdDetails(CdId),
[FileName] NVARCHAR(255) NOT NULL,
FullPath NVARCHAR(750) NOT NULL,
FileSize BIGINT NOT NULL,
CreateDate DATETIME NOT NULL,
CONSTRAINT PK_FileDetails PRIMARY KEY NONCLUSTERED (FileId),
CONSTRAINT UQ_FileDetails UNIQUE (CdId, FullPath),
)
CREATE CLUSTERED INDEX IX_FileDetails_CdId ON FileDetails(CdId, [FileName])
| true |
8765c58dc64acc7676f39583e45db0fa699d62c3 | SQL | openaire/iis | /iis-wf/iis-wf-referenceextraction/src/main/resources/eu/dnetlib/iis/wf/referenceextraction/community/sqlite_builder/oozie_app/lib/scripts/buildcummunitiesdb.sql | UTF-8 | 600 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | create temp table jsoninp as select * from stdinput();
drop table if exists grants;
create table grants as select conceptId,conceptLabel,suggestedAcknowledgement
from
(setschema 'conceptId,conceptLabel,suggestedAcknowledgement'
select c1 as conceptId,c2 as conceptLabel, c3 as suggestedAcknowledgement
from
(select * from (setschema 'c1,c2,c3,c4' select jsonpath(c1, '$.id','$.label','$.suggestedAcknowledgement','$.jsonextrainfo') from jsoninp)));
create index grants_index on grants (conceptId,conceptLabel,suggestedAcknowledgement); | true |
ba63c9d6d5c313e3dd206a8c661443dbb833aa6c | SQL | Lakshmi141105/country_club | /server/database/default_data.sql | UTF-8 | 11,923 | 3.078125 | 3 | [] | no_license | -- -------------------------------------------------------------
-- ---DEFAUTL DATA (If Admin side add these insertion, we can remove from here)--------------------
-- ----------------------------------------------------------------
-- venue type
INSERT INTO venue_type (venue_type) VALUES("private_party");
insert into venue_type (venue_type) values('sport');
insert into venue_type (venue_type) values('dining');
insert into venue_type (venue_type) values('workshop');
insert into venue_type (venue_type) values('indoor');
insert into venue_type (venue_type) values('outdoor');
-- user admin data for event to run.
insert into user values('1011', 'admin', 'test', 'admintest@test.com', 'test', 'test', '93424', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'1', 'Active');
-- venue data
INSERT INTO venue (venue_id, venue_name, venue_type) VALUES (1001,"Hall 01","private_party");
INSERT INTO venue (venue_id, venue_name, venue_type) VALUES (1002,"Hall 02","private_party");
INSERT INTO venue (venue_id, venue_name, venue_type) VALUES (1003,"Hall 03","private_party");
insert into venue (venue_id, venue_name,venue_type) values(1004,'Basket Ball Court', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1005,'Tennis Court', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1006,'Table Tennis Room', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1007,'Swimming Pool', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1008,'Kids Pool', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1009,'Billiard Room', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1010,'Archery Field', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1011,'Golf Course', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1012,'Yoga Room', 'sport');
insert into venue (venue_id, venue_name,venue_type) values(1013,'Dining-1', 'dining');
insert into venue (venue_id, venue_name,venue_type) values(1014,'Dining-2', 'dining');
insert into venue (venue_id, venue_name,venue_type) values(1015,'Dining-3', 'dining');
insert into venue (venue_id, venue_name,venue_type) values(1016,'Dining-4', 'dining');
insert into venue (venue_id, venue_name, venue_type) values (1017,'book reading','indoor');
insert into venue (venue_id, venue_name, venue_type) values (1018,'book reading','outdoor');
insert into venue (venue_id, venue_name, venue_type) values (1019,'book reading','workshop');
-- membership_type
INSERT INTO membership_type (type_id, name, description) VALUES (0, "Silver", "eligible to participate in all events");
INSERT INTO membership_type (type_id, name, description) VALUES (1, "Gold", "Silver user privileges + elgible to enroll 2 dependents");
INSERT INTO membership_type (type_id, name, description) VALUES (2, "Platinum", "Gold user privileges + access to organize own private events");
-- 1001: admin, 1002: silver, 1003: gold, 1004: platinum, 1005: expired, 1006: pending; password - admin
INSERT INTO user (user_id, f_name, l_name, email_id, street, city, zip_code, password, auth_id, status) VALUES ('1001', 'admin', '1', 'admin@gmail.com', 'admin', 'admin', '12345', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'1', 'Active');
INSERT INTO user (user_id, f_name, l_name, email_id, street, city, zip_code, password, auth_id, status) VALUES ('1002', 'silver', '1', 'silver@gmail.com', 'silver', 'silver', '12345', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'0', 'Active');
INSERT INTO member (user_id, membership_type, start_date, end_date) VALUES (1002, 0, "2021-05-01", "2021-11-03");
INSERT INTO user (user_id, f_name, l_name, email_id, street, city, zip_code, password, auth_id, status) VALUES ('1003', 'gold', '1', 'gold@gmail.com', 'gold', 'gold', '12345', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'0', 'Active');
INSERT INTO member (user_id, membership_type, start_date, end_date) VALUES (1003, 1, "2021-05-01", "2021-11-03");
INSERT INTO user (user_id, f_name, l_name, email_id, street, city, zip_code, password, auth_id, status) VALUES ('1004', 'platinum', '2', 'platinum@gmail.com', 'platinum', 'platinum', '12345', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'0', 'Active');
INSERT INTO member (user_id, membership_type, start_date, end_date) VALUES (1004, 2, "2021-05-01", "2021-11-03");
INSERT INTO user (user_id, f_name, l_name, email_id, street, city, zip_code, password, auth_id, status) VALUES ('1005', 'expired', '2', 'expired@gmail.com', 'expired', 'expired', '12345', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'0', 'Expired');
INSERT INTO member (user_id, membership_type, start_date, end_date) VALUES (1005, 2, "2021-05-01", "2021-05-01");
INSERT INTO user (user_id, f_name, l_name, email_id, street, city, zip_code, password, auth_id, status) VALUES ('1006', 'pending', '2', 'pending@gmail.com', 'pending', 'pending', '12345', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'0', 'Pending');
INSERT INTO member (user_id, membership_type, start_date, end_date) VALUES (1006, 2, "2021-05-01", "2021-11-01");
INSERT INTO user (user_id, f_name, l_name, email_id, street, city, zip_code, password, auth_id, status) VALUES ('10', 'pending', '2', 'pending@gmail.com', 'pending', 'pending', '12345', '$2b$10$9YqB7/S5KvMHr3yiu2PK.uzXBVgxIqhXJdiMNLubYg7QhsrFr37c6', b'0', 'Pending');
-- sports data
insert into sports (s_name, venue_id, start_time, end_time) values('Basket Ball', 1004, '08:00:00','20:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Tennis', 1005, '09:00:00','18:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Table Tennis', 1006, '08:00:00','20:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Swimming', 1007, '10:00:00','19:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Swimming-kid', 1008, '12:00:00','18:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Billiard', 1009, '08:00:00','20:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Archery', 1010, '11:00:00','16:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Golf', 1011, '08:00:00','16:00:00');
insert into sports (s_name, venue_id, start_time, end_time) values('Yoga', 1012, '08:00:00','11:00:00');
-- time_slot (start_time, end_time)
insert into time_slot (start_time, end_time) values('08:00:00','09:00:00');
insert into time_slot (start_time, end_time) values('09:00:00','10:00:00');
insert into time_slot (start_time, end_time) values('10:00:00','11:00:00');
insert into time_slot (start_time, end_time) values('11:00:00','12:00:00');
insert into time_slot (start_time, end_time) values('12:00:00','13:00:00');
insert into time_slot (start_time, end_time) values('13:00:00','14:00:00');
insert into time_slot (start_time, end_time) values('14:00:00','15:00:00');
insert into time_slot (start_time, end_time) values('15:00:00','16:00:00');
insert into time_slot (start_time, end_time) values('16:00:00','17:00:00');
insert into time_slot (start_time, end_time) values('17:00:00','18:00:00');
insert into time_slot (start_time, end_time) values('18:00:00','19:00:00');
insert into time_slot (start_time, end_time) values('19:00:00','20:00:00');
-- sport_time(ts_id,sport_id)
-- Basket Ball(08:00:00-20:00:00)
insert into sport_time values(1001,1001);
insert into sport_time values(1002,1001);
insert into sport_time values(1003,1001);
insert into sport_time values(1004,1001);
insert into sport_time values(1005,1001);
insert into sport_time values(1006,1001);
insert into sport_time values(1007,1001);
insert into sport_time values(1008,1001);
insert into sport_time values(1009,1001);
insert into sport_time values(1010,1001);
insert into sport_time values(1011,1001);
insert into sport_time values(1012,1001);
-- Tennis(09:00:00-18:00:00)
insert into sport_time values(1002,1002);
insert into sport_time values(1003,1002);
insert into sport_time values(1004,1002);
insert into sport_time values(1005,1002);
insert into sport_time values(1006,1002);
insert into sport_time values(1007,1002);
insert into sport_time values(1008,1002);
insert into sport_time values(1009,1002);
insert into sport_time values(1010,1002);
-- Basket Ball(08:00:00-20:00:00)
insert into sport_time values(1001,1003);
insert into sport_time values(1002,1003);
insert into sport_time values(1003,1003);
insert into sport_time values(1004,1003);
insert into sport_time values(1005,1003);
insert into sport_time values(1006,1003);
insert into sport_time values(1007,1003);
insert into sport_time values(1008,1003);
insert into sport_time values(1009,1003);
insert into sport_time values(1010,1003);
insert into sport_time values(1011,1003);
insert into sport_time values(1012,1003);
-- Swimming (10:00:00-19:00:00)
insert into sport_time values(1003,1004);
insert into sport_time values(1004,1004);
insert into sport_time values(1005,1004);
insert into sport_time values(1006,1004);
insert into sport_time values(1007,1004);
insert into sport_time values(1008,1004);
insert into sport_time values(1009,1004);
insert into sport_time values(1010,1004);
insert into sport_time values(1011,1004);
-- Swimming-kid(12:00:00-18:00:00)
insert into sport_time values(1005,1005);
insert into sport_time values(1006,1005);
insert into sport_time values(1007,1005);
insert into sport_time values(1008,1005);
insert into sport_time values(1009,1005);
insert into sport_time values(1010,1005);
-- Billiard (08:00:00-20:00:00)
insert into sport_time values(1001,1006);
insert into sport_time values(1002,1006);
insert into sport_time values(1003,1006);
insert into sport_time values(1004,1006);
insert into sport_time values(1005,1006);
insert into sport_time values(1006,1006);
insert into sport_time values(1007,1006);
insert into sport_time values(1008,1006);
insert into sport_time values(1009,1006);
insert into sport_time values(1010,1006);
insert into sport_time values(1011,1006);
insert into sport_time values(1012,1006);
-- Archery (11:00:00-16:00:00)
insert into sport_time values(1004,1007);
insert into sport_time values(1005,1007);
insert into sport_time values(1006,1007);
insert into sport_time values(1007,1007);
insert into sport_time values(1008,1007);
-- Golf (08:00:00-16:00:00)
insert into sport_time values(1001,1008);
insert into sport_time values(1002,1008);
insert into sport_time values(1003,1008);
insert into sport_time values(1004,1008);
insert into sport_time values(1005,1008);
insert into sport_time values(1006,1008);
insert into sport_time values(1007,1008);
insert into sport_time values(1008,1008);
-- Yoga (08:00:00-11:00:00)
insert into sport_time values(1001,1009);
insert into sport_time values(1002,1009);
insert into sport_time values(1003,1009);
-- Event test data
insert into event values('1010', 'Rise n shine', 'Seminar on holistic and mindful living', '2021-05-08', '2021-05-09', 'confirmed', 1017, '20', null, '1011');
insert into event values('1020', 'Part of Art', 'Art displays of local independent artists', '2021-05-01', '2021-05-02', 'confirmed', 1018, '50', null, '1011');
insert into event values('1021', 'World on my Plate', 'Food festival and fair where foods across cultures would be offered', '2021-05-08', '2021-05-09', 'confirmed', 1019, '50', null, '1011');
-- Dining
insert into dining (type,venue_id,capacity, start_time ,end_time) values ('Breakfast',1013,50,'07:00:00','10:00:00');
insert into dining (type,venue_id,capacity, start_time ,end_time) values ('Brunch',1014,100,'10:00:00','11:00:00');
insert into dining (type,venue_id,capacity, start_time ,end_time) values ('Lunch',1015,100,'12:00:00','15:00:00');
insert into dining (type,venue_id,capacity, start_time ,end_time) values ('Dinner',1016,80,'20:00:00','22:00:00');
| true |
d7c98dce8d6c9972a1b7e8f8224dd25464de70de | SQL | zubairwazir/code_problems | /leetcode/sql/rank-scores.sql | UTF-8 | 161 | 3.84375 | 4 | [
"MIT"
] | permissive | SELECT S.Score, COUNT(S2.Score) as `Rank`
FROM Scores S,
(SELECT DISTINCT Score FROM Scores) AS S2
WHERE S.Score <= S2.Score
GROUP BY S.id
ORDER BY S.Score DESC; | true |
006f8335ddabbd45bbae912465b692b8a70ff51f | SQL | LaibaBasit008/GAPP | /gapp.sql | UTF-8 | 2,409 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Aug 18, 2021 at 12:27 PM
-- Server version: 5.7.28-log
-- PHP Version: 7.2.18
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: `gapp`
--
-- --------------------------------------------------------
--
-- Table structure for table `department`
--
DROP TABLE IF EXISTS `department`;
CREATE TABLE IF NOT EXISTS `department` (
`department_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`teams` int(11) NOT NULL,
`inCharge` int(11) NOT NULL,
PRIMARY KEY (`department_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12011112 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `department`
--
INSERT INTO `department` (`department_id`, `name`, `teams`, `inCharge`) VALUES
(1, 'seecs', 333, 3),
(2, 'smme3', 23, 2),
(3, 'nbs12', 3, 3),
(4, 'nbss2', 3, 3),
(5, 'IESE', 4, 4),
(12011111, 'laiba ', 1, 12);
-- --------------------------------------------------------
--
-- Table structure for table `team`
--
DROP TABLE IF EXISTS `team`;
CREATE TABLE IF NOT EXISTS `team` (
`Team_id` int(11) NOT NULL AUTO_INCREMENT,
`people` int(11) NOT NULL,
`teamLead` int(11) NOT NULL,
PRIMARY KEY (`Team_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1223 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `team`
--
INSERT INTO `team` (`Team_id`, `people`, `teamLead`) VALUES
(1, 1, 2),
(2, 2, 1),
(3, 1, 2),
(12, 1, 12121),
(1222, 2, 21212);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `name`) VALUES
(1, 'xyz'),
(2, 'hxy'),
(2, 'opa'),
(2, 'opa'),
(1, '12'),
(3, 'were12');
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
3cfe4408d3d00ce048aaf7020e294eaf2903a350 | SQL | processtec/storeapi | /DB/structure/store_warehouse.sql | UTF-8 | 2,583 | 3.296875 | 3 | [
"MIT"
] | permissive | -- MySQL dump 10.13 Distrib 8.0.21, for macos10.15 (x86_64)
--
-- Host: localhost Database: store
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 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 `warehouse`
--
DROP TABLE IF EXISTS `warehouse`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `warehouse` (
`idwarehouse` int NOT NULL AUTO_INCREMENT,
`idsite` int NOT NULL,
`name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`isActive` int NOT NULL DEFAULT '1',
`address1` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`address2` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`city` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`zip` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`country` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'US',
`createdOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`lastModifiedOn` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`lastModifiedBy` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'some user',
`state` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'CA',
PRIMARY KEY (`idwarehouse`),
UNIQUE KEY `idwarehouse_UNIQUE` (`idwarehouse`),
KEY `idsite_idx` (`idsite`),
CONSTRAINT `fk_site_warehouse` FOREIGN KEY (`idsite`) REFERENCES `site` (`idsite`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-12-13 11:28:59
| true |
d3c4eb7a682ac93376424a3721d25c8df8a462e0 | SQL | t2m-git/LeetCode | /SQL/585.sql | UTF-8 | 956 | 3.953125 | 4 | [] | no_license | # Write your MySQL query statement below
WITH tmp_TIV_2015 AS (
SELECT
PID
FROM
insurance
WHERE
TIV_2015 IN (
SELECT
TIV_2015
FROM
insurance
GROUP BY TIV_2015
HAVING
COUNT(TIV_2015) > 1
)
),
loc AS (
SELECT
PID
FROM
insurance
GROUP BY LAT, LON
HAVING
COUNT(LAT & LON) = 1
)
SELECT
SUM(i.TIV_2016) AS `TIV_2016`
FROM
insurance AS i
WHERE
i.PID IN (SELECT * FROM tmp_TIV_2015) AND
i.PID IN (SELECT * FROM loc);
/*
SELECT
SUM(TIV_2016) as TIV_2016
FROM
insurance
WHERE
TIV_2015 IN (
SELECT
TIV_2015
FROM
insurance
GROUP BY TIV_2015
HAVING
COUNT(*) >= 2
)
AND (lat, lon) IN(
SELECT
lat,
lon
FROM
insurance
GROUP BY lat, lon
HAVING
COUNT(*) = 1
);
*/
| true |
b0863d9b31c8dfaf4d8449f05d71ff8f7a9af090 | SQL | SNEHA-MARTIN-ORG/codes | /FACT ATTRIBUTE QUERIES.sql | UTF-8 | 1,092 | 3.15625 | 3 | [] | no_license | select * from dbo.DimGeography
SELECT * FROM DBO.FactCrime ORDER BY StateKey
SELECT * FROM DBO.FactPropertyMedian ORDER BY StateKey
SELECT * FROM DBO.FactRentalMedian ORDER BY StateKey
----FACT CRIME ATTIBUTE QUERY----
SELECT distinct dbo.Crime.CrimeRate, dbo.Crime."Year", dbo.Suburb.Suburb, dbo.Suburb.StateCode
FROM dbo.Crime, dbo.Suburb
WHERE dbo.Crime.Suburb = dbo.Suburb.Suburb
------FACT RENTAL MEDIAN ATTRIBUTE QUERY---
SELECT DISTINCT dbo.Suburb.Suburb, dbo.RentalData.AvergeRent, dbo.State.StateCode
FROM dbo.RentalData, dbo.Suburb, dbo.State
WHERE dbo.RentalData.Suburb = dbo.Suburb.Suburb AND dbo.Suburb.StateCode = dbo.State.StateCode
----FACT PROPERTY MEDIAN ATTRIBUTE QUERY---
SELECT DISTINCT dbo.Suburb.Suburb, dbo.PropertyMedian.UpdatedYear, dbo.PropertyMedian.PropertyMedianValue, dbo.Suburb.StateCode, dbo.PropertyMedian.UpdatedMonth
FROM dbo.PropertyMedian, dbo.Suburb
WHERE dbo.PropertyMedian.Suburb = dbo.Suburb.Suburb
SELECT * FROM DBO.FactRentalMedian
| true |
0bea56a2f0e4b3dd7796cc1d9987975372bb9312 | SQL | hartmutmeyer/LK15 | /32_SQL_Einfuehrung/loesungen/haustier.sql | UTF-8 | 15,212 | 4.09375 | 4 | [] | no_license | DROP SCHEMA IF EXISTS haustier;
# Übung 1, Aufgabe 1
CREATE SCHEMA haustier DEFAULT CHARACTER SET utf8;
USE haustier;
CREATE TABLE tier
(
name VARCHAR(20) NOT NULL,
tierart VARCHAR(20) NOT NULL,
lebendig ENUM('ja','nein') DEFAULT 'ja',
geschlecht ENUM('weiblich','männlich') DEFAULT 'weiblich',
geburtstag DATE,
todestag DATE
);
#DESCRIBE tier;
# Übung 1, Aufgabe 2
# 2A
INSERT INTO tier VALUES
('Bello', 'Hund', 'ja', 'männlich', '2003-05-01', NULL),
('Daisy', 'Kanarienvogel', 'nein', 'weiblich', '1996-12-06', '2004-08-17'),
('Mausi', 'Katze', 'ja', 'weiblich', '2002-11-17', NULL);
# 2B
INSERT INTO tier (name, tierart) VALUES
('Daisy', 'Schildkröte'),
('Lassie', 'Hund'),
('Maja', 'Hund');
# 2C
INSERT INTO tier (name, tierart, geschlecht) VALUES
('Hasso', 'Hund', 'männlich'),
('Blacky', 'Katze', 'männlich'),
('Harald', 'Hamster', 'männlich');
# 2D
UPDATE tier
SET geburtstag = '2003-12-06'
WHERE tierart = 'Schildkröte';
UPDATE tier
SET geburtstag = '2004-04-23'
WHERE geburtstag IS NULL;
UPDATE tier
SET geburtstag = '2001-07-29', todestag = '2003-09-15', lebendig = 'nein'
WHERE name = 'Harald';
# Übung 1, Aufgabe 3
# 3A) Zeige die gesamte Tabelle tier an.
#SELECT *
#FROM tier;
# 3B) Zeige nur die Spalten name und tierart an.
#SELECT name, tierart
#FROM tier;
# 3C) Liste die Spalten name und tierart auf. Sortiere dabei in aufsteigender alphabetischer
# Reihenfolge nach dem Namen. An zweiter Stelle soll nach der Tierart sortiert werden
# (auch aufsteigend).
#SELECT name, tierart
#FROM tier
#ORDER BY name, tierart ASC;
# 3D) Zeige nur die Spalte geburtstag an. Sorge dafür, dass jeder Wert nur einmal angezeigt wird.
#SELECT geburtstag
#FROM tier
#GROUP BY geburtstag;
# 3E) Zeige die Spalten name und tierart für die Tiere an, die noch leben.
#SELECT name, tierart
#FROM tier
#WHERE lebendig = 'ja';
# 3F) Liste die Namen aller Tiere auf, die vor dem Jahr 2004 geboren wurden und noch nicht
# tot sind. Sortiere die Namen in absteigender alphabetischer Reihenfolge.
#SELECT name
#FROM tier
#WHERE geburtstag < '2004-01-01'
#AND todestag IS NULL
#ORDER BY name DESC;
# 3G) Liste die gesamten Spalten aller Tiere auf, die weder Hund noch Katze sind.
#SELECT *
#FROM tier
#WHERE tierart <> 'Hund'
#AND tierart <> 'Katze';
# 3H) Zeige die Namen und die Geburtstage aller Tiere an, für die kein Todestag angegeben wurde.
#SELECT name, geburtstag
#FROM tier
#WHERE todestag IS NULL;
# 3I) Zähle wie viele Tiere nach dem 01.01.2003 geboren wurden.
#SELECT COUNT(*)
#FROM tier
#WHERE geburtstag > '2003-01-01';
# 3J) Liste auf, wie viele Tiere es von jeder Tierart gibt. Das Ergebnis soll eine Tabelle
# mit einer Spalte tierart sein und einer Spalte, die zu jeder Tierart die Anzahl angibt.
#SELECT COUNT(*), tierart
#FROM tier
#GROUP BY tierart;
# 3K) Liste alle Tierarten auf, von denen es zwei oder mehr Tiere gibt.
#SELECT tierart
#FROM tier
#GROUP BY tierart
#HAVING COUNT(*)>1;
# 3L) Zähle die Anzahl der unterschiedlichen Tierarten, die es gibt.
#SELECT COUNT(DISTINCT tierart)
#FROM tier;
# Übung 2, Aufgabe 1
CREATE TABLE besitzer
(
besitzer_id INT AUTO_INCREMENT,
anrede ENUM('Herr', 'Frau', 'Firma') DEFAULT 'Herr',
vorname VARCHAR(20),
nachname VARCHAR(20) NOT NULL,
straße VARCHAR(30),
plz INT,
ort VARCHAR(30),
telefonnr VARCHAR(20),
PRIMARY KEY (besitzer_id)
);
ALTER TABLE tier
ADD COLUMN (tier_besitzer_id INT),
ADD FOREIGN KEY (tier_besitzer_id) REFERENCES besitzer (besitzer_id)
;
# Übung 3, Aufgabe 1
INSERT INTO besitzer VALUES
(NULL, 'Firma', NULL, 'Zoo Lilliput', 'Obernstraße 54', 20012, 'Hamburg', '0721/343412'),
(NULL, 'Frau', 'Sandra', 'Sandelmann', 'Kullerweg 12', 28205, 'Bremen', NULL),
(NULL, 'Herr', 'Mirco', 'Sandelmann', 'Unterstraße 17', 28232, 'Bremen', '0421/123456');
INSERT INTO besitzer (vorname, nachname) VALUES
('Tobias', 'Winkelmann');
INSERT INTO besitzer (anrede, vorname, nachname) VALUES
('Frau', 'Sandra', 'Anderson');
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname IS NULL
AND nachname = 'Zoo Lilliput'
)
WHERE name = 'Bello';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname IS NULL
AND nachname = 'Zoo Lilliput'
)
WHERE name = 'Lassie';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname = 'Sandra'
AND nachname = 'Sandelmann'
)
WHERE name = 'Daisy'
AND tierart = 'Kanarienvogel';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname = 'Mirco'
AND nachname = 'Sandelmann'
)
WHERE name = 'Mausi';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname = 'Mirco'
AND nachname = 'Sandelmann'
)
WHERE name = 'Blacky';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname = 'Mirco'
AND nachname = 'Sandelmann'
)
WHERE name = 'Harald';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname = 'Tobias'
AND nachname = 'Winkelmann'
)
WHERE name = 'Daisy'
AND tierart = 'Schildkröte';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname = 'Tobias'
AND nachname = 'Winkelmann'
)
WHERE name = 'Hasso';
UPDATE tier
SET tier_besitzer_id = (
SELECT besitzer_id FROM besitzer
WHERE vorname = 'Sandra'
AND nachname = 'Anderson'
)
WHERE name = 'Maja';
# Übung 3, Aufgabe 2
UPDATE besitzer
SET straße = 'Wilhelminenweg 42', plz = 28315, ort = 'Bremen'
WHERE nachname = 'Anderson';
# Übung 3, Aufgabe 3
# 3A) Zeige ohne Verwendung der WHERE-Klausel eine Tabelle mit allen Besitzern (Nachname
# und Vorname) und Tieren (Name und Tierart) an. Was für eine Tabelle wird erstellt?
#SELECT besitzer.nachname, besitzer.vorname, tier.name, tier.tierart
#FROM besitzer, tier;
# 3B) Zeige eine Liste mit allen Besitzern und den zu ihnen gehörenden Tieren an. Es sollen
# alle Spalten angezeigt werden.
#SELECT *
#FROM besitzer, tier
#WHERE besitzer_id = tier_besitzer_id;
# 3C) Zeige eine Tabelle mit allen Besitzern (Nachname und Vorname) und ihren Tieren
# (Name und Tierart) an. Sortiere die Liste in aufsteigender alphabetischer Reihenfolge
# zunächst nach dem Nachnamen und dann nach dem Vornamen.
#SELECT besitzer.nachname, besitzer.vorname, tier.name, tier.tierart
#FROM besitzer, tier
#WHERE besitzer_id = tier_besitzer_id
#ORDER BY besitzer.nachname, besitzer.vorname ASC;
# 3D) Zeige eine Tabelle mit allen Besitzern (Vor- und Nachname) und ihren lebendigen Tieren
# an (Name und Tierart). Sortiere die Liste nach der Tierart.
#SELECT besitzer.nachname, besitzer.vorname, tier.name, tier.tierart
#FROM besitzer, tier
#WHERE besitzer_id = tier_besitzer_id AND tier.lebendig = 'ja'
#ORDER BY tier.tierart ASC;
# 3E) Zeige alle Tiere von Mirco Sandelmann an (Name, Tierart und „lebendig“).
#SELECT name, tierart, lebendig
#FROM tier, besitzer
#WHERE tier_besitzer_id = besitzer_id
#AND besitzer.vorname = 'Mirco'
#AND besitzer.nachname = 'Sandelmann';
# 3F) Wähle alle Besitzer von Hunden aus. Zeige Vor- und Nachname der Besitzer sowie
# Name, Geburtstag und Todestag des Hundes an.
#SELECT besitzer.vorname, besitzer.nachname, tier.name, tier.geburtstag, tier.todestag
#FROM besitzer, tier
#WHERE tier.tierart = 'Hund';
# 3G) Zeige eine Liste der Besitzer (Vor- und Nachname) und der Anzahl der Tiere an, die
# sie besitzen. Sortiere die Liste in umgekehrter alphabetischer Reihenfolge nach
# Nachnamen.
#SELECT besitzer.vorname, besitzer.nachname, COUNT(*)
#FROM besitzer, tier
#WHERE tier_besitzer_id = besitzer_id
#GROUP BY besitzer_id
#ORDER BY besitzer.nachname DESC;
# 3H) Zeige alle Besitzer mit Vor- und Nachnamen an, die zwei oder mehr Tiere besitzen.
#SELECT besitzer.vorname, besitzer.nachname
#FROM besitzer, tier
#WHERE tier_besitzer_id = besitzer_id
#GROUP BY besitzer_id
#HAVING COUNT(*) >= 2;
# 3I) Zähle die Anzahl der Besitzer, die einen Hund oder eine Katze besitzen.
#SELECT COUNT(DISTINCT besitzer_id)
#FROM besitzer, tier
#WHERE tier_besitzer_id = besitzer_id
#AND (
# tier.tierart = 'Hund'
# OR tier.tierart = 'Katze'
#);
# Übung 4, Aufgabe 1
ALTER TABLE tier
ADD COLUMN (tier_id INT AUTO_INCREMENT),
DROP FOREIGN KEY tier_ibfk_1,
DROP COLUMN tier_besitzer_id,
ADD PRIMARY KEY (tier_id)
;
CREATE TABLE beziehung
(
beziehung_besitzer_id INT,
beziehung_tier_id INT,
PRIMARY KEY (beziehung_besitzer_id, beziehung_tier_id),
FOREIGN KEY (beziehung_besitzer_id) REFERENCES besitzer (besitzer_id) ON DELETE CASCADE,
FOREIGN KEY (beziehung_tier_id) REFERENCES tier (tier_id) ON DELETE CASCADE
);
UPDATE besitzer
SET straße='Unterstraße 17', plz=28232, ort='Bremen', telefonnr='0421/123456'
WHERE nachname = 'Sandelmann'
AND vorname = 'Sandra';
INSERT INTO besitzer VALUES
(NULL, 'Frau', 'Anka', 'Anderson', 'Wilhelminenweg 42', 28315, 'Bremen', NULL),
(NULL, 'Herr', 'Max', 'Anderson', 'Wilhelminenweg 42', 28315, 'Bremen', NULL),
(NULL, 'Herr', 'Kai', 'Anderson', 'Unsinnstraße 65', 28245, 'Bremen', NULL);
#SELECT * FROM besitzer;
#SELECT * FROM tier;
INSERT INTO beziehung VALUES
(
(SELECT besitzer_id FROM besitzer WHERE nachname = 'Zoo Lilliput'),
(SELECT tier_id FROM tier WHERE name = 'Bello')
),
(
(SELECT besitzer_id FROM besitzer WHERE nachname = 'Zoo Lilliput'),
(SELECT tier_id FROM tier WHERE name = 'Lassie')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Sandra' AND nachname = 'Sandelmann'),
(SELECT tier_id FROM tier WHERE name = 'Daisy' AND tierart = 'Kanarienvogel')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Sandra' AND nachname = 'Sandelmann'),
(SELECT tier_id FROM tier WHERE name = 'Mausi')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Sandra' AND nachname = 'Sandelmann'),
(SELECT tier_id FROM tier WHERE name = 'Blacky')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Mirco' AND nachname = 'Sandelmann'),
(SELECT tier_id FROM tier WHERE name = 'Mausi')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Mirco' AND nachname = 'Sandelmann'),
(SELECT tier_id FROM tier WHERE name = 'Blacky')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Mirco' AND nachname = 'Sandelmann'),
(SELECT tier_id FROM tier WHERE name = 'Harald')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Tobias' AND nachname = 'Winkelmann'),
(SELECT tier_id FROM tier WHERE name = 'Daisy' AND tierart = 'Schildkröte')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Tobias' AND nachname = 'Winkelmann'),
(SELECT tier_id FROM tier WHERE name = 'Hasso')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Sandra' AND nachname = 'Anderson'),
(SELECT tier_id FROM tier WHERE name = 'Maja')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Anka' AND nachname = 'Anderson'),
(SELECT tier_id FROM tier WHERE name = 'Maja')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Max' AND nachname = 'Anderson'),
(SELECT tier_id FROM tier WHERE name = 'Maja')
),
(
(SELECT besitzer_id FROM besitzer WHERE vorname = 'Kai' AND nachname = 'Anderson'),
(SELECT tier_id FROM tier WHERE name = 'Maja')
);
# Übung 4, Aufgabe 2
# 2A) Zeige eine Liste aller Besitzer (Vor- und Nachname) und ihrer Tiere (Name und Tierart)
# an. Sortiere die Liste absteigend nach dem Namen der Tiere.
#SELECT besitzer.vorname, besitzer.nachname, tier.name, tier.tierart
#FROM besitzer, tier, beziehung
#WHERE besitzer_id = beziehung_besitzer_id
#AND tier_id = beziehung_tier_id
#ORDER BY tier.name DESC;
# 2B) Liste alle Besitzer von Maja auf (Vor- und Nachname).
#SELECT besitzer.vorname, besitzer.nachname
#FROM besitzer, tier, beziehung
#WHERE besitzer_id = beziehung_besitzer_id
#AND tier_id = beziehung_tier_id
#AND tier.name = 'Maja';
# 2C) Zähle die Anzahl der Besitzer von Blacky.
#SELECT COUNT(*)
#FROM besitzer, tier, beziehung
#WHERE besitzer_id = beziehung_besitzer_id
#AND tier_id = beziehung_tier_id
#AND tier.name = 'Blacky';
# 2D) Erstelle eine Liste, die angibt, wie viele Tiere jede einzelne Person besitzt
# (Ausgabe: Anzahl, Vor- und Nachname).
#SELECT COUNT(*), besitzer.vorname, besitzer.nachname
#FROM besitzer, tier, beziehung
#WHERE besitzer_id = beziehung_besitzer_id
#AND tier_id = beziehung_tier_id
#GROUP BY besitzer_id;
# 2E) Liste die vollständigen Daten aller Besitzer auf, deren Telefonnummer nicht bekannt ist.
#SELECT *
#FROM besitzer
#WHERE telefonnr IS NULL;
# 2F) Liste Straße, PLZ und Ort aller Besitzer auf. Dabei soll jede Adresse nur einmal
# ausgegeben werden.
#SELECT straße, plz, ort
#FROM besitzer
#GROUP BY straße;
# oder alternativ:
#SELECT DISTINCT straße, plz, ort
#FROM besitzer;
# Übung 4, Aufgabe 3
# 3A
DELETE FROM beziehung
WHERE beziehung_tier_id = (
SELECT tier_id
FROM tier
WHERE name = 'Mausi'
);
# 3B
INSERT INTO besitzer VALUES
(NULL, 'Frau', 'Johanna', 'Sonntag', 'Glücksweg 13', '28333', 'Bremen', NULL);
#SELECT * FROM besitzer;
# Übung 4, Aufgabe 4
# 4A) Liste die Personen, die momentan kein Tier besitzen, mit Ihrem Vor- und Nachnamen auf.
SELECT besitzer.vorname, besitzer.nachname
FROM besitzer LEFT JOIN beziehung
ON beziehung_besitzer_id = besitzer_id
WHERE beziehung_tier_id IS NULL;
# 4B) Liste die Tiere mit Namen auf, die keinen Besitzer haben.
SELECT tier.name
FROM tier LEFT JOIN beziehung
ON beziehung_tier_id = tier_id
WHERE beziehung_besitzer_id IS NULL;
# 4C) Liste alle Personen, die mit Anka Anderson zusammen wohnen (d.h. alle, die dieselbe
# Strasse haben) mit ihren vollständigen Daten auf. Anka selbst darf auch in der
# Liste erscheinen.
SELECT mitwohner.*
FROM besitzer anka, besitzer mitwohner
WHERE anka.vorname = 'Anka'
AND anka.nachname = 'Anderson'
AND anka.straße = mitwohner.straße;
# 4D) Liste alle Tiere mit Namen auf, die am selben Tag geboren wurden wie Maja. Maja
# selbst soll nicht in der Liste erscheinen.
SELECT anderestier.name, anderestier.geburtstag
FROM tier maja, tier anderestier
WHERE maja.name = 'Maja'
AND maja.geburtstag = anderestier.geburtstag
AND anderestier.name != 'Maja';
# 4E) Liste die Namen der Tiere auf, die am selben Tag geboren wurden wie Maja, und den
# Vor- und Nachnamen ihrer Besitzer. Maja selbst soll nicht in der Liste erscheinen.
SELECT anderestier.name, besitzer.vorname, besitzer.nachname
FROM tier maja, tier anderestier, besitzer, beziehung
WHERE maja.name = 'Maja'
AND maja.geburtstag = anderestier.geburtstag
AND anderestier.name != 'Maja'
AND anderestier.tier_id = beziehung_tier_id
AND besitzer_id = beziehung_besitzer_id;
# 4F) Liste alle Tiere mit Namen auf, die denselben Besitzer haben wie Hasso. Hasso darf
# ebenfalls in der Liste erscheinen.
SELECT anderestier.name
FROM tier hasso, tier anderestier, beziehung hassobeziehung, beziehung anderebeziehung
WHERE hasso.name = 'Hasso'
AND hasso.tier_id = hassobeziehung.beziehung_tier_id
AND anderestier.tier_id = anderebeziehung.beziehung_tier_id
AND hassobeziehung.beziehung_besitzer_id = anderebeziehung.beziehung_besitzer_id;
| true |
2bd7e8433fec089cd5c3cfd62b954ee252af68cb | SQL | elinoza/m6-d7 | /data/all.sql | UTF-8 | 1,060 | 3.171875 | 3 | [] | no_license |
CREATE TABLE IF NOT EXISTS
categories (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name VARCHAR (50) NOT NULL,
img VARCHAR (50)
);
CREATE TABLE IF NOT EXISTS
authors (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name VARCHAR (50) NOT NULL,
img VARCHAR (50)
);
CREATE TABLE IF NOT EXISTS
articles (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
head_Line VARCHAR (50) NOT NULL,
subHead VARCHAR (50),
content VARCHAR (50) NOT NULL,
cover VARCHAR (50),
author_id INTEGER NOT NULL,
category_id INTEGER NOT NULL,
FOREIGN KEY (author_id) REFERENCES authors ,
FOREIGN KEY (category_id) REFERENCES categories
);
CREATE TABLE IF NOT EXISTS
reactions (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
text CHAR (50) NOT NULL,
is_clapped BOOLEAN,
author_id INTEGER NOT NULL,
article_id INTEGER NOT NULL,
FOREIGN KEY (author_id) REFERENCES authors ,
FOREIGN KEY (article_id) REFERENCES articles
); | true |
3f545eeba6983c3271ea5c39c0a7fa8ba7fe8ab5 | SQL | TimothyBreen/Library-Project | /question 6.sql | UTF-8 | 273 | 3.5625 | 4 | [] | no_license | SELECT tblBORROWER.Name, tblBORROWER.[Address], COUNT(tblBORROWER.CardNo)
FROM tblBOOK_LOANS FULL OUTER JOIN tblBORROWER
ON tblBOOK_LOANS.CardNo = tblBORROWER.CardNo
GROUP BY tblBORROWER.CardNo, tblBORROWER.Name, tblBORROWER.[Address]
HAVING COUNT(tblBORROWER.CardNo) >5
| true |
c167bff406f973c1ff12147e976157153f3a48ed | SQL | now-in-orbit/alien-gram | /sql/project.sql | UTF-8 | 3,581 | 4.15625 | 4 | [
"Apache-2.0"
] | permissive | -- this is a comment in SQL (yes, the space is needed!)
-- these statements will drop the tables and re-add them
-- this is akin to reformatting and reinstalling Windows (OS X never needs a reinstall...) ;)
-- never ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever
-- do this on live data!!!!
DROP TABLE IF EXISTS `like`;
DROP TABLE IF EXISTS image;
DROP TABLE IF EXISTS tweet;
DROP TABLE IF EXISTS sighting;
DROP TABLE IF EXISTS transmission;
DROP TABLE IF EXISTS post;
DROP TABLE IF EXISTS profile;
CREATE TABLE profile
(
-- this creates the attribute for the primary key
-- auto_increment tells mySQL to number them {1, 2, 3, ...}
-- not null means the attribute is required!
profileId BINARY(16) NOT NULL,
profileActivationToken CHAR(32),
profileAvatarUrl VARCHAR(255),
-- to make sure duplicate data cannot exist, create a unique index
profileEmail VARCHAR(128) NOT NULL,
profileFirstName VARCHAR(32),
-- to make something optional, exclude the not null
profileHash CHAR(97) NOT NULL,
profileLastName VARCHAR(32),
profileUsername VARCHAR(32),
UNIQUE (profileEmail),
UNIQUE (profileUsername),
-- this officiates the primary key for the entity
PRIMARY KEY (profileId)
);
-- create the post entity
CREATE TABLE post
(
-- this is for yet another primary key...
postId BINARY(16) NOT NULL,
-- this is for a foreign key; auto_incremented is omitted by design
postProfileId BINARY(16) NOT NULL,
postContent VARCHAR(500) NOT NULL,
-- notice dates don't need a size parameter
postDate DATETIME(6) NOT NULL,
postImageUrl VARCHAR(255),
-- this creates an index before making a foreign key
INDEX (postProfileId),
-- this creates the actual foreign key relation
FOREIGN KEY (postProfileId) REFERENCES profile (profileId),
-- and finally create the primary key
PRIMARY KEY (postId)
);
-- create the transmission entity
CREATE TABLE transmission
(
transmissionId BINARY(16) NOT NULL,
transmissionProfileId BINARY(16) NOT NULL,
transmissionPostId BINARY(16) NOT NULL,
transmissionContent VARCHAR(500) NOT NULL,
transmissionDateTime DATETIME(6) NOT NULL,
INDEX (transmissionId),
INDEX (transmissionProfileId),
INDEX (transmissionPostId),
FOREIGN KEY (transmissionProfileId) REFERENCES profile (profileId),
FOREIGN KEY (transmissionPostId) REFERENCES post (postId),
PRIMARY KEY (transmissionId)
);
-- create the like entity (a weak entity from an m-to-n for profile --> tweet)
CREATE TABLE `like`
(
-- these are not auto_increment because they're still foreign keys
likePostId BINARY(16) NOT NULL,
likeProfileId BINARY(16) NOT NULL,
likeDateTime DATETIME(6) NOT NULL, -- index the foreign keys
INDEX (likePostId),
INDEX (likeProfileId),
-- create the foreign key relations
FOREIGN KEY (likePostId) REFERENCES post (postId),
FOREIGN KEY (likeProfileId) REFERENCES profile (profileId),
-- finally, create a composite foreign key with the two foreign keys
PRIMARY KEY (likePostId, likeProfileId)
);
CREATE TABLE sighting
(
sightingId BINARY(16) NOT NULL,
sightingCity VARCHAR(64) NOT NULL,
sightingSummary VARCHAR(1000),
sightingLatitude VARCHAR(20),
sightingLongitude VARCHAR(20),
sightingDateTime DATETIME(6) NOT NULL, -- index the foreign keys...what foreign keys?
PRIMARY KEY (sightingId)
);
| true |
ed4746cd3756fb85b34244b00e0bf49acc410fcf | SQL | ArvindBalgo/pvt_maurirental | /maurirent.sql | UTF-8 | 9,709 | 3.21875 | 3 | [] | no_license | -- ****************** SqlDBM: MySQL ******************;
-- ***************************************************;
DROP TABLE `ExpensesDetails`;
DROP TABLE `BillingDetails`;
DROP TABLE `Pricing`;
DROP TABLE `AccomodationDetails`;
DROP TABLE `BookingDetails`;
DROP TABLE `Reviews`;
DROP TABLE `Logs`;
DROP TABLE `Expense`;
DROP TABLE `Billing`;
DROP TABLE `Accomodation`;
DROP TABLE `Booking`;
DROP TABLE `Sessions`;
DROP TABLE `Users`;
-- ************************************** `Users`
CREATE TABLE `Users`
(
`userID` INT NOT NULL ,
`surname` VARCHAR(55) NOT NULL ,
`name` VARCHAR(55) NOT NULL ,
`prefferedName` VARCHAR(55) ,
`registrationType` VARCHAR(30) NOT NULL ,
`age` INT NOT NULL ,
`address1` VARCHAR(55) NOT NULL ,
`address2` VARCHAR(55) ,
`town` VARCHAR(55) NOT NULL ,
`email` VARCHAR(55) NOT NULL ,
`password` VARCHAR(55) NOT NULL ,
`userType` VARCHAR(55) NOT NULL ,
`homePhone` VARCHAR(55) ,
`mobilePhone` VARCHAR(55) NOT NULL ,
`dateModified` DATE ,
`dateCreated` DATE NOT NULL ,
`nationality` VARCHAR(55) NOT NULL ,
`nic` VARCHAR(55) NOT NULL ,
PRIMARY KEY (`userID`)
);
-- ************************************** `Expense`
CREATE TABLE `Expense`
(
`expenseID` INT NOT NULL ,
`customer` VARCHAR(55) NOT NULL ,
`details_description` VARCHAR(75) NOT NULL ,
`brn_vatNumber` INT NOT NULL ,
`Status` VARCHAR(55) NOT NULL ,
`userID` INT NOT NULL ,
PRIMARY KEY (`expenseID`),
KEY `fkIdx_240` (`userID`),
CONSTRAINT `FK_240` FOREIGN KEY `fkIdx_240` (`userID`) REFERENCES `Users` (`userID`)
);
-- ************************************** `Billing`
CREATE TABLE `Billing`
(
`billingID` INT NOT NULL ,
`userID` INT NOT NULL ,
`bill_numID` INT NOT NULL ,
`totalVatExcl` FLOAT NOT NULL ,
`totalVatIncl` FLOAT NOT NULL ,
`discountAmount` FLOAT ,
`totalVat` FLOAT NOT NULL ,
`discountCode` INT ,
`amountPaid` FLOAT ,
`amountReturned` FLOAT NOT NULL ,
PRIMARY KEY (`billingID`),
KEY `fkIdx_201` (`userID`),
CONSTRAINT `FK_201` FOREIGN KEY `fkIdx_201` (`userID`) REFERENCES `Users` (`userID`)
);
-- ************************************** `Accomodation`
CREATE TABLE `Accomodation`
(
`accomodationID` INT NOT NULL ,
`userID` INT NOT NULL ,
`type` VARCHAR(55) NOT NULL ,
`shortDescription` VARCHAR(55) ,
`longDescription` VARCHAR(55) ,
`address1` VARCHAR(55) NOT NULL ,
`address2` VARCHAR(55) ,
`town` VARCHAR(55) NOT NULL ,
`lattitude` VARCHAR(55) ,
`longitude` VARCHAR(55) ,
`agreement_acceptation` VARCHAR(55) NOT NULL ,
`agreement_acceptation_date` DATE NOT NULL ,
`features` VARCHAR(55) NOT NULL ,
`capacity` VARCHAR(55) NOT NULL ,
`dateCreated` DATE NOT NULL ,
`dateModified` DATE ,
`createdBy` VARCHAR(55) NOT NULL ,
`modifiedBy` VARCHAR(55) ,
PRIMARY KEY (`accomodationID`),
KEY `fkIdx_152` (`userID`),
CONSTRAINT `FK_152` FOREIGN KEY `fkIdx_152` (`userID`) REFERENCES `Users` (`userID`)
);
-- ************************************** `Booking`
CREATE TABLE `Booking`
(
`bookingID` INT NOT NULL ,
`itemsCounts` INT NOT NULL ,
`status` VARCHAR(55) NOT NULL ,
`bookingNumID` INT NOT NULL ,
`userID` INT NOT NULL ,
PRIMARY KEY (`bookingID`),
KEY `fkIdx_79` (`userID`),
CONSTRAINT `FK_79` FOREIGN KEY `fkIdx_79` (`userID`) REFERENCES `Users` (`userID`)
);
-- ************************************** `Sessions`
CREATE TABLE `Sessions`
(
`sessionID` INT NOT NULL ,
`loginTimestamp` INT NOT NULL ,
`logoutTimestamp` INT NOT NULL ,
`dateCreated` DATE NOT NULL ,
`dateModified` DATE ,
`createdBy` VARCHAR(55) NOT NULL ,
`modifiedBy` VARCHAR(55) ,
`userID` INT NOT NULL ,
PRIMARY KEY (`sessionID`),
KEY `fkIdx_50` (`userID`),
CONSTRAINT `FK_50` FOREIGN KEY `fkIdx_50` (`userID`) REFERENCES `Users` (`userID`)
);
-- ************************************** `ExpensesDetails`
CREATE TABLE `ExpensesDetails`
(
`expenseDetailsID` INT NOT NULL ,
`expensesDetails_numId` INT NOT NULL ,
`amountVatExcl` FLOAT NOT NULL ,
`amountVatIncl` FLOAT NOT NULL ,
`description` VARCHAR(55) NOT NULL ,
`paymentMethod` VARCHAR(55) NOT NULL ,
`validatedBy` VARCHAR(55) NOT NULL ,
`dateValidated` DATE NOT NULL ,
`createdBy` VARCHAR(55) NOT NULL ,
`modifiedBy` VARCHAR(55) NOT NULL ,
`dateCreated` DATE NOT NULL ,
`dateModified` DATE ,
`expenseID` INT NOT NULL ,
PRIMARY KEY (`expenseDetailsID`),
KEY `fkIdx_257` (`expenseID`),
CONSTRAINT `FK_257` FOREIGN KEY `fkIdx_257` (`expenseID`) REFERENCES `Expense` (`expenseID`)
);
-- ************************************** `BillingDetails`
CREATE TABLE `BillingDetails`
(
`billingDetailsID` INT NOT NULL ,
`status` VARCHAR(55) NOT NULL ,
`billingDetails_numID` INT NOT NULL ,
`dateCreated` DATE NOT NULL ,
`dateModified` DATE ,
`createdBy` VARCHAR(55) NOT NULL ,
`modifiedBy` VARCHAR(55) ,
`billingID` INT NOT NULL ,
`bookingID` INT NOT NULL ,
PRIMARY KEY (`billingDetailsID`),
KEY `fkIdx_214` (`billingID`),
CONSTRAINT `FK_214` FOREIGN KEY `fkIdx_214` (`billingID`) REFERENCES `Billing` (`billingID`),
KEY `fkIdx_223` (`bookingID`),
CONSTRAINT `FK_223` FOREIGN KEY `fkIdx_223` (`bookingID`) REFERENCES `Booking` (`bookingID`)
);
-- ************************************** `Pricing`
CREATE TABLE `Pricing`
(
`pricingID` INT NOT NULL ,
`DateStarted` DATE NOT NULL ,
`dateEnd` DATE NOT NULL ,
`unitPrice` FLOAT NOT NULL ,
`minUnit` INT NOT NULL ,
`unit` INT NOT NULL ,
`status` VARCHAR(55) NOT NULL ,
`commision` FLOAT NOT NULL ,
`pricing_numID` INT NOT NULL ,
`dateCreated` DATE NOT NULL ,
`dateModified` DATE ,
`createdBy` VARCHAR(55) NOT NULL ,
`modifiedBy` VARCHAR(55) ,
`accomodationID` INT NOT NULL ,
PRIMARY KEY (`pricingID`),
KEY `fkIdx_172` (`accomodationID`),
CONSTRAINT `FK_172` FOREIGN KEY `fkIdx_172` (`accomodationID`) REFERENCES `Accomodation` (`accomodationID`)
);
-- ************************************** `AccomodationDetails`
CREATE TABLE `AccomodationDetails`
(
`accomodationDetailsID` INT NOT NULL ,
`url` VARCHAR(55) ,
`resourceType` VARCHAR(55) NOT NULL ,
`accomodationDetails_NumID` INT NOT NULL ,
`accomodationID` INT NOT NULL ,
PRIMARY KEY (`accomodationDetailsID`),
KEY `fkIdx_149` (`accomodationID`),
CONSTRAINT `FK_149` FOREIGN KEY `fkIdx_149` (`accomodationID`) REFERENCES `Accomodation` (`accomodationID`)
);
-- ************************************** `BookingDetails`
CREATE TABLE `BookingDetails`
(
`bookingDetailsID` INT NOT NULL ,
`bokingdDetails_NumID` INT NOT NULL ,
`startDate` DATE NOT NULL ,
`endDate` DATE NOT NULL ,
`startTime` DATETIME NOT NULL ,
`endTime` DATETIME NOT NULL ,
`peopleCount` INT NOT NULL ,
`status` VARCHAR(55) NOT NULL ,
`dateCreated` DATE NOT NULL ,
`dateModified` DATE ,
`datePending` DATE NOT NULL ,
`dateCancel` DATE ,
`dateConfirmed` DATE NOT NULL ,
`createdBy` VARCHAR(55) NOT NULL ,
`modifiedBy` VARCHAR(55) ,
`bookingID` INT NOT NULL ,
PRIMARY KEY (`bookingDetailsID`),
KEY `fkIdx_185` (`bookingID`),
CONSTRAINT `FK_185` FOREIGN KEY `fkIdx_185` (`bookingID`) REFERENCES `Booking` (`bookingID`)
);
-- ************************************** `Reviews`
CREATE TABLE `Reviews`
(
`reviewID` INT NOT NULL ,
`bookingID` INT NOT NULL ,
`userID` INT NOT NULL ,
`accomodationID` INT NOT NULL ,
`review_numID` INT NOT NULL ,
`rating` INT NOT NULL ,
`review_description` VARCHAR(55) ,
`dateCreated` DATE NOT NULL ,
`dateModified` DATE ,
`createdBy` VARCHAR(55) NOT NULL ,
`modifiedBy` VARCHAR(55) ,
PRIMARY KEY (`reviewID`, `bookingID`, `userID`, `accomodationID`),
KEY `fkIdx_91` (`bookingID`),
CONSTRAINT `FK_91` FOREIGN KEY `fkIdx_91` (`bookingID`) REFERENCES `Booking` (`bookingID`),
KEY `fkIdx_94` (`userID`),
CONSTRAINT `FK_94` FOREIGN KEY `fkIdx_94` (`userID`) REFERENCES `Users` (`userID`),
KEY `fkIdx_176` (`accomodationID`),
CONSTRAINT `FK_176` FOREIGN KEY `fkIdx_176` (`accomodationID`) REFERENCES `Accomodation` (`accomodationID`)
);
-- ************************************** `Logs`
CREATE TABLE `Logs`
(
`logID` NOT NULL ,
`description` VARCHAR(75) NOT NULL ,
`createdBy` VARCHAR(55) NOT NULL ,
`dateCreated` DATE NOT NULL ,
`sessionID` INT NOT NULL ,
PRIMARY KEY (`logID`),
KEY `fkIdx_53` (`sessionID`),
CONSTRAINT `FK_53` FOREIGN KEY `fkIdx_53` (`sessionID`) REFERENCES `Sessions` (`sessionID`)
);
| true |
e214e2debf634ffafc74916f2510b7d20d2cda61 | SQL | YarGU-Demidov/math-site | /db.sql | UTF-8 | 35,575 | 2.96875 | 3 | [
"MIT"
] | permissive | CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
"MigrationId" varchar(150) NOT NULL,
"ProductVersion" varchar(32) NOT NULL,
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "Category" (
"Id" uuid NOT NULL,
"Alias" text NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Description" text NULL,
"Name" text NOT NULL,
CONSTRAINT "PK_Category" PRIMARY KEY ("Id")
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "File" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"DateAdded" timestamp NOT NULL,
"Extension" text NULL,
"Name" text NOT NULL,
"Path" text NOT NULL,
CONSTRAINT "PK_File" PRIMARY KEY ("Id")
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "GroupType" (
"Id" uuid NOT NULL,
"Alias" text NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Description" text NULL,
"Name" text NOT NULL,
CONSTRAINT "PK_GroupType" PRIMARY KEY ("Id")
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "Keyword" (
"Id" uuid NOT NULL,
"Alias" text NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Name" text NOT NULL,
CONSTRAINT "PK_Keyword" PRIMARY KEY ("Id")
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostSeoSetting" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Description" text NULL,
"Title" text NULL,
"Url" text NULL,
CONSTRAINT "PK_PostSeoSetting" PRIMARY KEY ("Id")
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "Right" (
"Id" uuid NOT NULL,
"Alias" text NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Description" text NULL,
"Name" text NOT NULL,
CONSTRAINT "PK_Right" PRIMARY KEY ("Id")
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "SiteSetting" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Key" text NOT NULL,
"Value" bytea NOT NULL,
CONSTRAINT "PK_SiteSetting" PRIMARY KEY ("Id"),
CONSTRAINT "AK_SiteSetting_Key" UNIQUE ("Key")
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostSetting" (
"Id" uuid NOT NULL,
"CanBeRated" bool NOT NULL DEFAULT FALSE,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"IsCommentsAllowed" bool NOT NULL DEFAULT FALSE,
"Layout" text NOT NULL DEFAULT 'SecondaryLayout',
"PostOnStartPage" bool NOT NULL DEFAULT FALSE,
"PreviewImageId" uuid NULL,
CONSTRAINT "PK_PostSetting" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostSetting_File_PreviewImageId" FOREIGN KEY ("PreviewImageId") REFERENCES "File" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "Group" (
"Id" uuid NOT NULL,
"Alias" text NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Description" text NULL,
"GroupTypeId" uuid NOT NULL,
"IsAdmin" bool NOT NULL DEFAULT FALSE,
"Name" text NOT NULL,
"ParentGroupId" uuid NULL,
CONSTRAINT "PK_Group" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Group_GroupType_GroupTypeId" FOREIGN KEY ("GroupTypeId") REFERENCES "GroupType" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Group_Group_ParentGroupId" FOREIGN KEY ("ParentGroupId") REFERENCES "Group" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostKeyword" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"KeywordId" uuid NOT NULL,
"PostSeoSettingsId" uuid NOT NULL,
CONSTRAINT "PK_PostKeyword" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostKeyword_Keyword_KeywordId" FOREIGN KEY ("KeywordId") REFERENCES "Keyword" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_PostKeyword_PostSeoSetting_PostSeoSettingsId" FOREIGN KEY ("PostSeoSettingsId") REFERENCES "PostSeoSetting" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostType" (
"Id" uuid NOT NULL,
"Alias" text NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"DefaultPostsSettingsId" uuid NOT NULL,
"Name" text NOT NULL,
CONSTRAINT "PK_PostType" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostType_PostSetting_DefaultPostsSettingsId" FOREIGN KEY ("DefaultPostsSettingsId") REFERENCES "PostSetting" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "GroupsRight" (
"Id" uuid NOT NULL,
"Allowed" bool NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"GroupId" uuid NOT NULL,
"RightId" uuid NOT NULL,
CONSTRAINT "PK_GroupsRight" PRIMARY KEY ("Id"),
CONSTRAINT "FK_GroupsRight_Group_GroupId" FOREIGN KEY ("GroupId") REFERENCES "Group" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_GroupsRight_Right_RightId" FOREIGN KEY ("RightId") REFERENCES "Right" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "User" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"GroupId" uuid NOT NULL,
"Login" text NOT NULL,
"PasswordHash" bytea NOT NULL,
CONSTRAINT "PK_User" PRIMARY KEY ("Id"),
CONSTRAINT "FK_User_Group_GroupId" FOREIGN KEY ("GroupId") REFERENCES "Group" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "Person" (
"Id" uuid NOT NULL,
"AdditionalPhone" text NULL,
"Birthday" timestamp NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"MiddleName" text NULL,
"Name" text NOT NULL,
"Phone" text NULL,
"PhotoId" uuid NULL,
"Surname" text NOT NULL,
"UserId" uuid NULL,
CONSTRAINT "PK_Person" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Person_File_PhotoId" FOREIGN KEY ("PhotoId") REFERENCES "File" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Person_User_UserId" FOREIGN KEY ("UserId") REFERENCES "User" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "Post" (
"Id" uuid NOT NULL,
"AuthorId" uuid NOT NULL,
"Content" text NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Deleted" bool NOT NULL,
"Excerpt" text NOT NULL,
"PostSeoSettingsId" uuid NOT NULL,
"PostSettingsId" uuid NULL,
"PostTypeId" uuid NOT NULL,
"PublishDate" timestamp NOT NULL,
"Published" bool NOT NULL,
"Title" text NOT NULL,
CONSTRAINT "PK_Post" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Post_User_AuthorId" FOREIGN KEY ("AuthorId") REFERENCES "User" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Post_PostSeoSetting_PostSeoSettingsId" FOREIGN KEY ("PostSeoSettingsId") REFERENCES "PostSeoSetting" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Post_PostSetting_PostSettingsId" FOREIGN KEY ("PostSettingsId") REFERENCES "PostSetting" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Post_PostType_PostTypeId" FOREIGN KEY ("PostTypeId") REFERENCES "PostType" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "UserRights" (
"Id" uuid NOT NULL,
"Allowed" bool NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"RightId" uuid NOT NULL,
"UserId" uuid NOT NULL,
CONSTRAINT "PK_UserRights" PRIMARY KEY ("Id"),
CONSTRAINT "FK_UserRights_Right_RightId" FOREIGN KEY ("RightId") REFERENCES "Right" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_UserRights_User_UserId" FOREIGN KEY ("UserId") REFERENCES "User" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "UserSetting" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Key" text NOT NULL,
"Namespace" text NOT NULL,
"UserId" uuid NOT NULL,
"Value" text NOT NULL,
CONSTRAINT "PK_UserSetting" PRIMARY KEY ("Id"),
CONSTRAINT "FK_UserSetting_User_UserId" FOREIGN KEY ("UserId") REFERENCES "User" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "Comment" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Date" timestamp NOT NULL,
"Edited" bool NOT NULL,
"PostId" uuid NOT NULL,
"Text" text NOT NULL,
"UserId" uuid NOT NULL,
CONSTRAINT "PK_Comment" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Comment_Post_PostId" FOREIGN KEY ("PostId") REFERENCES "Post" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Comment_User_UserId" FOREIGN KEY ("UserId") REFERENCES "User" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostAttachment" (
"Id" uuid NOT NULL,
"Allowed" bool NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"FileId" uuid NOT NULL,
"PostId" uuid NOT NULL,
CONSTRAINT "PK_PostAttachment" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostAttachment_File_FileId" FOREIGN KEY ("FileId") REFERENCES "File" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_PostAttachment_Post_PostId" FOREIGN KEY ("PostId") REFERENCES "Post" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostCategory" (
"Id" uuid NOT NULL,
"CategoryId" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"PostId" uuid NOT NULL,
CONSTRAINT "PK_PostCategory" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostCategory_Category_CategoryId" FOREIGN KEY ("CategoryId") REFERENCES "Category" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_PostCategory_Post_PostId" FOREIGN KEY ("PostId") REFERENCES "Post" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostGroupsAllowed" (
"Id" uuid NOT NULL,
"Allowed" bool NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"GroupId" uuid NULL,
"PostId" uuid NULL,
CONSTRAINT "PK_PostGroupsAllowed" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostGroupsAllowed_Group_GroupId" FOREIGN KEY ("GroupId") REFERENCES "Group" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_PostGroupsAllowed_Post_PostId" FOREIGN KEY ("PostId") REFERENCES "Post" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostOwner" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"PostId" uuid NOT NULL,
"UserId" uuid NOT NULL,
CONSTRAINT "PK_PostOwner" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostOwner_Post_PostId" FOREIGN KEY ("PostId") REFERENCES "Post" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_PostOwner_User_UserId" FOREIGN KEY ("UserId") REFERENCES "User" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostRating" (
"Id" uuid NOT NULL,
"Allowed" bool NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"PostId" uuid NOT NULL,
"UserId" uuid NOT NULL,
"Value" bool NOT NULL,
CONSTRAINT "PK_PostRating" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostRating_Post_PostId" FOREIGN KEY ("PostId") REFERENCES "Post" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_PostRating_User_UserId" FOREIGN KEY ("UserId") REFERENCES "User" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE TABLE "PostUserAllowed" (
"Id" uuid NOT NULL,
"Allowed" bool NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"PostId" uuid NOT NULL,
"UserId" uuid NOT NULL,
CONSTRAINT "PK_PostUserAllowed" PRIMARY KEY ("Id"),
CONSTRAINT "FK_PostUserAllowed_Post_PostId" FOREIGN KEY ("PostId") REFERENCES "Post" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_PostUserAllowed_User_UserId" FOREIGN KEY ("UserId") REFERENCES "User" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Category_Alias" ON "Category" ("Alias");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_Comment_PostId" ON "Comment" ("PostId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_Comment_UserId" ON "Comment" ("UserId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Group_Alias" ON "Group" ("Alias");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_Group_GroupTypeId" ON "Group" ("GroupTypeId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_Group_ParentGroupId" ON "Group" ("ParentGroupId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_GroupsRight_GroupId" ON "GroupsRight" ("GroupId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_GroupsRight_RightId" ON "GroupsRight" ("RightId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_GroupType_Alias" ON "GroupType" ("Alias");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Keyword_Alias" ON "Keyword" ("Alias");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Person_PhotoId" ON "Person" ("PhotoId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Person_UserId" ON "Person" ("UserId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_Post_AuthorId" ON "Post" ("AuthorId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Post_PostSeoSettingsId" ON "Post" ("PostSeoSettingsId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Post_PostSettingsId" ON "Post" ("PostSettingsId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_Post_PostTypeId" ON "Post" ("PostTypeId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostAttachment_FileId" ON "PostAttachment" ("FileId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostAttachment_PostId" ON "PostAttachment" ("PostId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostCategory_CategoryId" ON "PostCategory" ("CategoryId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostCategory_PostId" ON "PostCategory" ("PostId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostGroupsAllowed_GroupId" ON "PostGroupsAllowed" ("GroupId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostGroupsAllowed_PostId" ON "PostGroupsAllowed" ("PostId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostKeyword_KeywordId" ON "PostKeyword" ("KeywordId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostKeyword_PostSeoSettingsId" ON "PostKeyword" ("PostSeoSettingsId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostOwner_PostId" ON "PostOwner" ("PostId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostOwner_UserId" ON "PostOwner" ("UserId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostRating_PostId" ON "PostRating" ("PostId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostRating_UserId" ON "PostRating" ("UserId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostSeoSetting_Url" ON "PostSeoSetting" ("Url");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostSetting_PreviewImageId" ON "PostSetting" ("PreviewImageId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_PostType_Alias" ON "PostType" ("Alias");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_PostType_DefaultPostsSettingsId" ON "PostType" ("DefaultPostsSettingsId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostUserAllowed_PostId" ON "PostUserAllowed" ("PostId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_PostUserAllowed_UserId" ON "PostUserAllowed" ("UserId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_Right_Alias" ON "Right" ("Alias");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE UNIQUE INDEX "IX_SiteSetting_Key" ON "SiteSetting" ("Key");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_User_GroupId" ON "User" ("GroupId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_UserRights_RightId" ON "UserRights" ("RightId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_UserRights_UserId" ON "UserRights" ("UserId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
CREATE INDEX "IX_UserSetting_UserId" ON "UserSetting" ("UserId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20170926004454_Initial') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20170926004454_Initial', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171118205629_AddDirectory') THEN
ALTER TABLE "File" ADD "DirectoryId" uuid NULL;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171118205629_AddDirectory') THEN
CREATE TABLE "Directory" (
"Id" uuid NOT NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Name" text NULL,
"RootDirectoryId" uuid NULL,
CONSTRAINT "PK_Directory" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Directory_Directory_RootDirectoryId" FOREIGN KEY ("RootDirectoryId") REFERENCES "Directory" ("Id") ON DELETE CASCADE
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171118205629_AddDirectory') THEN
CREATE INDEX "IX_File_DirectoryId" ON "File" ("DirectoryId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171118205629_AddDirectory') THEN
CREATE INDEX "IX_Directory_RootDirectoryId" ON "Directory" ("RootDirectoryId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171118205629_AddDirectory') THEN
ALTER TABLE "File" ADD CONSTRAINT "FK_File_Directory_DirectoryId" FOREIGN KEY ("DirectoryId") REFERENCES "Directory" ("Id") ON DELETE CASCADE;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171118205629_AddDirectory') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20171118205629_AddDirectory', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171125133126_AddHashToFiles') THEN
ALTER TABLE "File" ADD "Hash" text NOT NULL DEFAULT '';
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171125133126_AddHashToFiles') THEN
CREATE INDEX "IX_File_Hash" ON "File" ("Hash");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171125133126_AddHashToFiles') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20171125133126_AddHashToFiles', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171129011851_RemoveDeprecatedFieldFromFileEntity') THEN
ALTER TABLE "File" DROP COLUMN "DateAdded";
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171129011851_RemoveDeprecatedFieldFromFileEntity') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20171129011851_RemoveDeprecatedFieldFromFileEntity', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171225192144_AddEventTime_RemoveDefaultLayout') THEN
ALTER TABLE "PostSetting" ALTER COLUMN "Layout" TYPE text;
ALTER TABLE "PostSetting" ALTER COLUMN "Layout" SET NOT NULL;
ALTER TABLE "PostSetting" ALTER COLUMN "Layout" DROP DEFAULT;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171225192144_AddEventTime_RemoveDefaultLayout') THEN
ALTER TABLE "PostSetting" ADD "EventTime" timestamp NULL;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171225192144_AddEventTime_RemoveDefaultLayout') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20171225192144_AddEventTime_RemoveDefaultLayout', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171225204242_RemoveRequiredForLayoutSetting') THEN
ALTER TABLE "PostSetting" ALTER COLUMN "Layout" TYPE text;
ALTER TABLE "PostSetting" ALTER COLUMN "Layout" DROP NOT NULL;
ALTER TABLE "PostSetting" ALTER COLUMN "Layout" DROP DEFAULT;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171225204242_RemoveRequiredForLayoutSetting') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20171225204242_RemoveRequiredForLayoutSetting', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171225211729_AddEventLocation') THEN
ALTER TABLE "PostSetting" ADD "EventLocation" text NULL;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20171225211729_AddEventLocation') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20171225211729_AddEventLocation', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180221213004_Update-User-And-Person-Relations') THEN
ALTER TABLE "Person" DROP CONSTRAINT "FK_Person_User_UserId";
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180221213004_Update-User-And-Person-Relations') THEN
DROP INDEX "IX_Person_UserId";
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180221213004_Update-User-And-Person-Relations') THEN
ALTER TABLE "Person" DROP COLUMN "UserId";
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180221213004_Update-User-And-Person-Relations') THEN
ALTER TABLE "User" ADD "PersonId" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180221213004_Update-User-And-Person-Relations') THEN
CREATE UNIQUE INDEX "IX_User_PersonId" ON "User" ("PersonId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180221213004_Update-User-And-Person-Relations') THEN
ALTER TABLE "User" ADD CONSTRAINT "FK_User_Person_PersonId" FOREIGN KEY ("PersonId") REFERENCES "Person" ("Id") ON DELETE SET NULL;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180221213004_Update-User-And-Person-Relations') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20180221213004_Update-User-And-Person-Relations', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180301215907_RemoveDefaults') THEN
ALTER TABLE "PostSetting" ALTER COLUMN "PostOnStartPage" TYPE bool;
ALTER TABLE "PostSetting" ALTER COLUMN "PostOnStartPage" SET NOT NULL;
ALTER TABLE "PostSetting" ALTER COLUMN "PostOnStartPage" DROP DEFAULT;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180301215907_RemoveDefaults') THEN
ALTER TABLE "PostSetting" ALTER COLUMN "IsCommentsAllowed" TYPE bool;
ALTER TABLE "PostSetting" ALTER COLUMN "IsCommentsAllowed" SET NOT NULL;
ALTER TABLE "PostSetting" ALTER COLUMN "IsCommentsAllowed" DROP DEFAULT;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180301215907_RemoveDefaults') THEN
ALTER TABLE "PostSetting" ALTER COLUMN "CanBeRated" TYPE bool;
ALTER TABLE "PostSetting" ALTER COLUMN "CanBeRated" SET NOT NULL;
ALTER TABLE "PostSetting" ALTER COLUMN "CanBeRated" DROP DEFAULT;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180301215907_RemoveDefaults') THEN
ALTER TABLE "Group" ALTER COLUMN "IsAdmin" TYPE bool;
ALTER TABLE "Group" ALTER COLUMN "IsAdmin" SET NOT NULL;
ALTER TABLE "Group" ALTER COLUMN "IsAdmin" DROP DEFAULT;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180301215907_RemoveDefaults') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20180301215907_RemoveDefaults', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180420222556_AddBaseProfessorInfo') THEN
CREATE TABLE "Professor" (
"Id" uuid NOT NULL,
"BibliographicIndexOfWorks" text[] NULL,
"CreationDate" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"Description" text NOT NULL,
"Graduated" text[] NULL,
"MathNetLink" text NULL,
"PersonId" uuid NOT NULL,
"ScientificTitle" text NULL,
"Status" text NOT NULL,
"TermPapers" text[] NULL,
"Theses" text[] NULL,
CONSTRAINT "PK_Professor" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Professor_Person_PersonId" FOREIGN KEY ("PersonId") REFERENCES "Person" ("Id") ON DELETE SET NULL
);
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180420222556_AddBaseProfessorInfo') THEN
CREATE UNIQUE INDEX "IX_Professor_PersonId" ON "Professor" ("PersonId");
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180420222556_AddBaseProfessorInfo') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20180420222556_AddBaseProfessorInfo', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180422182800_ExtendProfessorsInfo') THEN
ALTER TABLE "Professor" ADD "Department" text NOT NULL DEFAULT '';
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180422182800_ExtendProfessorsInfo') THEN
ALTER TABLE "Professor" ADD "Faculty" text NOT NULL DEFAULT '';
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180422182800_ExtendProfessorsInfo') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20180422182800_ExtendProfessorsInfo', '2.0.2-rtm-10011');
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180601214220_RemoveRequiredFieldFromProfessor') THEN
ALTER TABLE "Professor" ALTER COLUMN "Status" TYPE text;
ALTER TABLE "Professor" ALTER COLUMN "Status" DROP NOT NULL;
ALTER TABLE "Professor" ALTER COLUMN "Status" DROP DEFAULT;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20180601214220_RemoveRequiredFieldFromProfessor') THEN
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20180601214220_RemoveRequiredFieldFromProfessor', '2.0.2-rtm-10011');
END IF;
END $$;
| true |
001d6dcb26633335293e273327b4317f9067099b | SQL | syuru04/TopProject_MD | /wordlist.sql | UTF-8 | 2,691 | 3.8125 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS wordlist;
USE wordlist;
DROP TABLE IF EXISTS texts;
DROP TABLE IF EXISTS words;
DROP TABLE IF EXISTS master;
DROP TABLE IF EXISTS asks;
DROP TABLE IF EXISTS etc;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
nick VARCHAR(60) NOT NULL UNIQUE, -- 아이디
pass BINARY(32) NOT NULL, -- 비밀번호 해시 값
name VARCHAR(60) NOT NULL, -- 이름
mail VARCHAR(100) NOT NULL, -- 이메일 주소
rank TINYINT NOT NULL DEFAULT 0, -- 등급
sure INT UNSIGNED NULL, -- 보증인
FOREIGN KEY(sure) REFERENCES users(id) ON UPDATE CASCADE
);
CREATE TABLE master (
user INT UNSIGNED NOT NULL,
FOREIGN KEY(user) REFERENCES users(id) ON UPDATE CASCADE
);
CREATE TABLE editor (
user INT UNSIGNED NOT NULL,
FOREIGN KEY(user) REFERENCES users(id) ON UPDATE CASCADE
);
CREATE TABLE asks (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
t DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
user INT UNSIGNED NOT NULL,
mail VARCHAR(100) NOT NULL, -- 이메일 주소
phone VARCHAR(20) NULL, -- 전화번호
askt VARCHAR(5000) NULL, -- 전화번호
FOREIGN KEY(user) REFERENCES users(id) ON UPDATE CASCADE
);
CREATE TABLE etc (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
user INT UNSIGNED NOT NULL,
data VARCHAR(5000) NOT NULL -- nick name mail sure
);
CREATE TABLE words (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
word VARCHAR(100) NOT NULL UNIQUE, -- 낱말
user INT UNSIGNED NOT NULL, -- 교열자
tell TINYINT NOT NULL DEFAULT 0, -- 0=더살핌 1=올림 2=버림
FOREIGN KEY(user) REFERENCES users(id) ON UPDATE CASCADE
);
CREATE TABLE texts (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
i TINYINT NOT NULL, -- 0=풀이 1=적바림
t DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
user INT UNSIGNED NOT NULL, -- 갈무리한 이
word INT UNSIGNED NOT NULL, -- 낱말
data VARCHAR(15000) NOT NULL, -- 풀이/적바림
FOREIGN KEY(word) REFERENCES words(id) ON UPDATE CASCADE,
FOREIGN KEY(user) REFERENCES users(id) ON UPDATE CASCADE
);
CREATE VIEW wt0 AS SELECT w.id wid, e.id FROM words w JOIN texts e ON w.id=e.word
WHERE w.word <> "?" AND e.i=0 AND w.tell < 2 AND (w.user=e.user OR w.tell=1 AND e.user IN (7,158));
CREATE VIEW wt AS SELECT l.wid, l.id FROM wt0 l LEFT JOIN wt0 r
ON l.wid=r.wid AND l.id < r.id WHERE r.id is NULL;
-- mysql -h localhost -u scott -p <..\..\htdocs\maal\wordlist.sql
-- mysqldump -h localhost -u scott -p --databases wordlist >wordlist_backup.sql
| true |
219263839c1f5676c83b3f7ef6dcfc70aa133ef0 | SQL | dino003/christian-parametrage | /database.sql | UTF-8 | 8,370 | 3.328125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Hôte : localhost
-- Version du serveur: 5.7.24 - MySQL Community Server (GPL)
-- SE du serveur: Win32
-- HeidiSQL Version: 9.5.0.5337
-- --------------------------------------------------------
/*!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' */;
-- Listage de la structure de la base pour param
CREATE DATABASE IF NOT EXISTS `param` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `param`;
-- Listage de la structure de la table param. coords
CREATE TABLE IF NOT EXISTS `coords` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`taux_horraire` smallint(4) unsigned NOT NULL,
`montant_heure_100` smallint(7) NOT NULL,
`montant_heure_115` smallint(7) NOT NULL,
`montant_heure_175` smallint(7) NOT NULL,
`montant_heure_200` smallint(7) NOT NULL,
`montant_heure_150` smallint(1) NOT NULL DEFAULT '0',
`avantage_acquis` smallint(5) NOT NULL DEFAULT '0',
`prime_precarite` smallint(5) NOT NULL DEFAULT '0',
`panier_salissure_mouille` smallint(5) NOT NULL DEFAULT '1038',
`indemnite_transport` smallint(5) NOT NULL DEFAULT '1100',
`brut_imposable` smallint(5) NOT NULL DEFAULT '0',
`tranche_id` smallint(2) unsigned NOT NULL,
`categorie` smallint(2) unsigned NOT NULL,
`brut_total` smallint(5) NOT NULL DEFAULT '0',
`provis_conge_gratis` smallint(5) NOT NULL DEFAULT '0',
`frais_bureau` smallint(5) NOT NULL DEFAULT '0',
`frais_centre_medical` smallint(5) NOT NULL DEFAULT '0',
`tva_frais_fonctionnement` smallint(5) NOT NULL DEFAULT '0',
`prestation_familliales` smallint(5) NOT NULL DEFAULT '186',
`accident_travail` smallint(5) NOT NULL DEFAULT '129',
`c_r_t_c_i` smallint(5) NOT NULL DEFAULT '0',
`impot_sal` smallint(5) NOT NULL DEFAULT '0',
`taxe_fpc` smallint(5) NOT NULL DEFAULT '0',
`taxe_apprenti` smallint(5) NOT NULL DEFAULT '0',
`total_montant_heure` smallint(5) NOT NULL DEFAULT '0',
`total_cout` smallint(5) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `tranche` (`tranche_id`),
CONSTRAINT `tranche` FOREIGN KEY (`tranche_id`) REFERENCES `tranches` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=latin1;
-- Listage des données de la table param.coords : ~30 rows (environ)
DELETE FROM `coords`;
/*!40000 ALTER TABLE `coords` DISABLE KEYS */;
INSERT INTO `coords` (`id`, `taux_horraire`, `montant_heure_100`, `montant_heure_115`, `montant_heure_175`, `montant_heure_200`, `montant_heure_150`, `avantage_acquis`, `prime_precarite`, `panier_salissure_mouille`, `indemnite_transport`, `brut_imposable`, `tranche_id`, `categorie`, `brut_total`, `provis_conge_gratis`, `frais_bureau`, `frais_centre_medical`, `tva_frais_fonctionnement`, `prestation_familliales`, `accident_travail`, `c_r_t_c_i`, `impot_sal`, `taxe_fpc`, `taxe_apprenti`, `total_montant_heure`, `total_cout`) VALUES
(1, 371, 2968, 1707, 0, 0, 0, 191, 142, 1038, 1100, 5008, 1, 2, 7146, 1489, 1295, 432, 311, 186, 129, 500, 78, 78, 26, 4675, 11669),
(2, 382, 3056, 1757, 0, 0, 0, 207, 146, 1038, 1100, 5166, 1, 3, 7304, 1522, 1324, 441, 318, 186, 129, 515, 80, 80, 27, 4813, 11926),
(3, 394, 3152, 1812, 0, 0, 0, 227, 151, 1038, 1100, 5342, 1, 4, 7480, 1558, 1356, 452, 325, 186, 129, 531, 83, 83, 28, 4964, 12211),
(4, 411, 3288, 1891, 0, 0, 0, 251, 157, 1038, 1100, 5587, 1, 5, 7725, 1609, 1400, 467, 336, 186, 129, 554, 86, 86, 29, 5179, 12608),
(5, 422, 3536, 2033, 0, 0, 0, 274, 169, 1038, 1100, 6012, 1, 6, 8150, 1698, 1477, 492, 355, 186, 129, 594, 93, 93, 31, 5569, 13297),
(6, 677, 5416, 3114, 0, 0, 0, 419, 259, 1038, 1100, 9208, 1, 7, 11346, 2364, 2056, 685, 494, 186, 129, 891, 139, 139, 46, 8530, 18476),
(7, 371, 2968, 0, 2597, 0, 0, 819, 142, 1038, 1100, 6526, 2, 2, 8664, 1805, 1570, 523, 377, 186, 129, 641, 100, 100, 33, 5565, 14129),
(8, 382, 3056, 0, 2674, 0, 0, 888, 146, 1038, 1100, 6764, 2, 3, 8902, 1855, 1614, 538, 387, 186, 129, 664, 103, 103, 34, 5730, 14515),
(9, 394, 3152, 0, 2758, 0, 0, 972, 151, 1038, 1100, 7033, 2, 4, 9171, 1911, 1662, 554, 399, 186, 129, 689, 107, 107, 36, 5910, 14951),
(10, 411, 3288, 0, 2877, 0, 0, 1077, 157, 1038, 1100, 7399, 2, 5, 9537, 1987, 1729, 576, 415, 186, 129, 723, 113, 113, 38, 6165, 15544),
(11, 442, 3536, 0, 3094, 0, 0, 1173, 169, 1038, 1100, 7972, 2, 6, 10110, 2106, 1832, 611, 440, 186, 129, 776, 121, 121, 40, 6630, 16473),
(12, 677, 5416, 0, 4739, 0, 0, 1797, 259, 1038, 1100, 12211, 2, 7, 14349, 2989, 2601, 867, 624, 186, 129, 1170, 182, 182, 61, 10155, 23341),
(13, 371, 2968, 0, 2597, 0, 0, 1570, 142, 1038, 1100, 7277, 3, 2, 9415, 1961, 1706, 569, 410, 186, 129, 711, 111, 111, 37, 5565, 15346),
(14, 382, 3056, 0, 2674, 0, 0, 1702, 146, 1038, 1100, 7578, 3, 3, 9716, 2024, 1761, 587, 423, 186, 129, 739, 115, 115, 38, 5730, 15834),
(15, 394, 3152, 0, 2758, 0, 0, 1863, 151, 1038, 1100, 7924, 3, 4, 10062, 2096, 1824, 608, 438, 186, 129, 772, 120, 120, 40, 5910, 16394),
(16, 411, 3288, 0, 2877, 0, 0, 2064, 157, 1038, 1100, 8386, 3, 5, 10524, 2193, 1908, 636, 458, 186, 129, 815, 127, 127, 42, 6165, 17144),
(17, 442, 3536, 0, 3094, 0, 0, 2248, 169, 1038, 1100, 9047, 3, 6, 11185, 2330, 2027, 676, 487, 186, 129, 876, 137, 137, 46, 6630, 18215),
(18, 677, 5416, 0, 4739, 0, 0, 3444, 259, 1038, 1100, 13858, 3, 7, 15996, 3332, 2899, 966, 696, 186, 129, 1324, 206, 206, 69, 10155, 26010),
(19, 371, 2968, 0, 0, 2968, 0, 1160, 142, 1038, 1100, 7238, 5, 2, 9376, 1953, 1699, 566, 408, 186, 129, 708, 110, 110, 37, 5936, 15283),
(20, 382, 3056, 0, 0, 3056, 0, 1258, 146, 1038, 1100, 7516, 5, 3, 9654, 2011, 1750, 583, 420, 186, 129, 734, 114, 114, 38, 6112, 15734),
(21, 394, 3152, 0, 0, 3152, 0, 1377, 151, 1038, 1100, 7832, 5, 4, 9970, 2077, 1807, 602, 434, 186, 129, 763, 119, 119, 40, 6304, 16245),
(22, 411, 3288, 0, 0, 3288, 0, 1526, 157, 1038, 1100, 8259, 5, 5, 10397, 2166, 1884, 628, 452, 186, 129, 803, 125, 125, 42, 6576, 16938),
(23, 442, 3536, 0, 0, 3536, 0, 1662, 169, 1038, 1100, 8903, 5, 6, 11041, 2300, 2001, 667, 480, 186, 129, 863, 134, 134, 45, 7072, 17981),
(24, 677, 5416, 0, 0, 5416, 0, 2546, 259, 1038, 1100, 13637, 5, 7, 15775, 3286, 2859, 953, 686, 186, 129, 1303, 203, 203, 68, 10932, 25652),
(25, 371, 2968, 0, 2597, 0, 0, 1638, 142, 1038, 1100, 7345, 4, 2, 9483, 1976, 1719, 573, 413, 186, 129, 718, 112, 112, 37, 5565, 15456),
(26, 382, 3056, 0, 2674, 0, 0, 1776, 146, 1038, 1100, 7652, 4, 3, 9790, 2040, 1774, 591, 426, 186, 129, 746, 116, 116, 39, 5730, 15954),
(27, 394, 3152, 0, 2758, 0, 0, 1944, 151, 1038, 1100, 8005, 4, 4, 10143, 2113, 1838, 613, 441, 186, 129, 779, 121, 121, 40, 5910, 16256),
(28, 411, 3288, 0, 2877, 0, 0, 2154, 157, 1038, 1100, 8476, 4, 5, 10614, 2211, 1924, 641, 462, 186, 129, 823, 128, 128, 43, 6165, 17290),
(29, 442, 3536, 0, 3094, 0, 0, 2346, 169, 1038, 1100, 9145, 4, 6, 11283, 2351, 2045, 682, 491, 186, 129, 885, 138, 138, 46, 6630, 18373),
(30, 677, 5416, 0, 4739, 0, 0, 3594, 259, 1038, 1100, 14008, 4, 7, 16146, 3364, 2926, 975, 702, 186, 129, 1338, 208, 208, 69, 10155, 26253);
/*!40000 ALTER TABLE `coords` ENABLE KEYS */;
-- Listage de la structure de la table param. tranches
CREATE TABLE IF NOT EXISTS `tranches` (
`id` smallint(2) unsigned NOT NULL AUTO_INCREMENT,
`type_tranche` varchar(100) NOT NULL,
`numero_tranche` smallint(1) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- Listage des données de la table param.tranches : ~5 rows (environ)
DELETE FROM `tranches`;
/*!40000 ALTER TABLE `tranches` DISABLE KEYS */;
INSERT INTO `tranches` (`id`, `type_tranche`, `numero_tranche`) VALUES
(1, '(7H30 - 19H30) Du LUNDI AU SAMEDI', 1),
(2, '(19H30 - 7H30) Du LUNDI AU VENDREDI', 2),
(3, '(19H30 - 7H30) SAMEDI', 3),
(4, '(7H30 - 19H30) DIMANCHE ET JOURS FERIES', 4),
(5, '(19H30 - 7H30) DIMANCHE ET JOURS FERIES', 5);
/*!40000 ALTER TABLE `tranches` 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 */;
| true |
8bdfc1594d42563a822247e39409b491e4bf5350 | SQL | DennyLe/CourseModel | /Courses_dump/courses_student.sql | UTF-8 | 2,590 | 3.09375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `courses` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `courses`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
--
-- Host: localhost Database: courses
-- ------------------------------------------------------
-- Server version 5.7.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `student`
--
DROP TABLE IF EXISTS `student`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student` (
`student_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`address` varchar(50) NOT NULL,
`telephone` varchar(12) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`zach_nom` int(11) NOT NULL,
`avg_acad_performance` float DEFAULT '0',
PRIMARY KEY (`student_id`),
UNIQUE KEY `id_UNIQUE` (`student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `student`
--
LOCK TABLES `student` WRITE;
/*!40000 ALTER TABLE `student` DISABLE KEYS */;
INSERT INTO `student` VALUES (1,'Гоголь НВ','Острякова 55, кв 11','79789099009','gogol@mail.ru',12345,2),(5,'Пушкин АС','Шевченко 33, кв 12','79789898989','pushkin@mail.ru',12344,3),(6,'Толстой ЛН','Бреста 44, кв 14','79786565663','tolstoy@mail.ru',12333,4),(7,'Лермонтов МЮ','Морская 12, кв 12','78985231454','lermontov@mail.ru',12222,3),(8,'Крылов ИА','Правды 32, кв 16','78983451663','krilov@mail.ru',14343,4);
/*!40000 ALTER TABLE `student` 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 2018-07-24 13:58:57
| true |
91bd06fbb3f29471601be3ab6f80edf55ffe805f | SQL | hello-nls/sql | /voidVoucher-setStatusToVOID-Update.sql | UTF-8 | 367 | 2.5625 | 3 | [] | no_license | /*
* from the community site
* https://community.nortridge.com/t/unable-to-reverse-a-duplicate-transaction-and-also-void-the-associated-voucher/2064
* Voucher_Status:
* 0 Pending
* 1 Paid
* 2 Voided
* 3 Hold
* 4 Queued
*/
-- Set Voucher Status to VOID
UPDATE Voucher SET voucher_status = 2 WHERE voucher_id in (123456)
| true |
6829513347b754c006645f2b7a5ece92ebddaf7e | SQL | VB6Hobbyst7/Tutorials | /Both_Libraries_part1/Libraries/UDP_routines.inc | UTF-8 | 3,185 | 3.453125 | 3 | [] | no_license | ' UDP_routines.inc
GLOBAL strThisServer AS STRING
GLOBAL ip AS LONG
GLOBAL hUDP AS LONG
%UPort = 16010
FUNCTION funOpenUDP() AS LONG
strThisServer = "OCTAL"
'
ERRCLEAR
HOST ADDR TO ip
hUDP = FREEFILE
UDP OPEN PORT %UPort AS hUDP TIMEOUT 60000
IF ERR THEN
CON.STDOUT "Error " & ERROR$
EXIT FUNCTION
ELSE
CON.STDOUT "UDP Open"
FUNCTION = %TRUE
END IF
'
END FUNCTION
'
FUNCTION funCloseUDP() AS LONG
CON.STDOUT "UDP Closed"
CLOSE #hUDP
FUNCTION = %TRUE
END FUNCTION
'
FUNCTION funListenForRequests() AS LONG
LOCAL strRequest AS STRING
'
CON.STDOUT "UDP Listening"
DO
strRequest = ""
funProcessRequests(strRequest)
IF strRequest = "EXIT" THEN
EXIT LOOP
END IF
SLEEP 100
LOOP
'
FUNCTION = %TRUE
'
END FUNCTION
'
FUNCTION funProcessRequests(strRequest AS STRING) AS STRING
' Start listening to the UDP/IP port
' where strRequest is the Request received
LOCAL Buffer AS STRING ' UDP data received
LOCAL strData AS STRING ' Data received
LOCAL ipAddr AS LONG ' IP address of sending machine
LOCAL ipPort AS LONG ' UDP Port of sending machine to reply to
LOCAL strTargetServer AS STRING ' target server name
'
ERRCLEAR
UDP RECV #hUdp, FROM ipAddr, ipPort, Buffer
'
CON.STDOUT "Got Buffer " & Buffer & " from " & DottedIP(ipAddr)
strTargetServer = UCASE$(PARSE$(Buffer,"|",1))
'
IF strTargetServer <> strThisServer THEN
UDP SEND #hUdp, AT ipAddr, ipPort, "### NOT ACCEPTED ###"
EXIT FUNCTION
END IF
'
strRequest = UCASE$(PARSE$(Buffer,"|",2))
strRequest = PARSE$(strRequest," ",1)
' "SUM 'Eye Colour'='BLUE'"
IF ERR THEN EXIT FUNCTION
'
SELECT CASE strRequest
CASE "SUM"
UDP SEND #hUdp, AT ipAddr, ipPort,funSum(Buffer)
CASE "COUNT"
' how many record are there
UDP SEND #hUdp, AT ipAddr, ipPort,"Records = " & _
FORMAT$(UBOUND(a_strWork))
'
CASE "LIST"
UDP SEND #hUdp, AT ipAddr, ipPort," ### ACCEPTED ###"
CASE "EXIT"
UDP SEND #hUdp, AT ipAddr, ipPort," ### EXITING ###"
CASE ELSE
UDP SEND #hUdp, AT ipAddr, ipPort,"### NOT ACCEPTED ###"
END SELECT
'
END FUNCTION
'
FUNCTION funSum(Buffer AS STRING) AS STRING
'Buffer = Octal|SUM 'Eye Colour'='BLUE'
LOCAL strRequest AS STRING
LOCAL strColumn AS STRING
LOCAL strType AS STRING
LOCAL strValue AS STRING
LOCAL lngColumn AS LONG
LOCAL lngR AS LONG
LOCAL lngCount AS LONG
'
strRequest = PARSE$(Buffer,"|",2)
' SUM 'Eye Colour'='BLUE'
strRequest = MID$(strRequest,5)
' 'Eye Colour'='BLUE'
strColumn = PARSE$(strRequest, "'",2)
strType = PARSE$(strRequest, "'",3)
strValue = PARSE$(strRequest, "'",4)
'
lngColumn = funParseFind(a_strWork(0),$TAB,strColumn)
'
lngCount = 0
FOR lngR = 1 TO UBOUND(a_strWork)
IF LCASE$(PARSE$(a_strWork(lngR),$TAB, lngColumn)) _
= LCASE$(strValue) THEN
INCR lngCount
END IF
'
NEXT lngR
'
FUNCTION = "Records = " & FORMAT$(lngCount)
'
END FUNCTION
'
MACRO FUNCTION DottedIP(ip)
MACROTEMP x
LOCAL x AS BYTE PTR
x = VARPTR(ip)
END MACRO = USING$("#_.#_.#_.#", @x, @x[1], @x[2], @x[3])
| true |
45a0a4f8a13597f0464d2b8309d81714c963fc01 | SQL | millenniumbrain/GradeMeUp | /GradeMeUp/scripts/assignments.sql | UTF-8 | 373 | 3.4375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS Assignments (
ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"Name" VARCHAR(255),
PointsPossible INT,
Grade INT,
StudentID INTEGER,
CourseID INTEGER,
AssignmentType INTEGER,
FOREIGN KEY(StudentID) REFERENCES students(ID),
FOREIGN KEY(CourseID) REFERENCES courses(ID)
--FOREIGN KEY(AssignmentTypeID) REFERENCES assignment_types(ID)
); | true |
02bee2cfa94b069fa6c984ed7fc03edb27ed6363 | SQL | Iudina/Berkley_DataScience_Bootcamp | /10_SQL/hw8_SQL.sql | UTF-8 | 7,884 | 4.4375 | 4 | [] | no_license | USE sakila;
-- 1a. Display the first and last names of all actors from the table actor.
SELECT first_name, last_name
FROM actor;
-- 1b. Display the first and last name of each actor in a single column in upper case letters. Name the column Actor Name.
SELECT CONCAT(first_name, ' ', last_name) AS Actor_Name
FROM actor;
-- 2a. You need to find the ID number, first name, and last name of an actor, of whom you know only the first name, "Joe."
SELECT actor_id, first_name, last_name
FROM actor
WHERE first_name="Joe";
-- 2b. Find all actors whose last name contain the letters GEN:
SELECT * FROM actor
WHERE last_name
LIKE '%GEN%';
-- 2c. Find all actors whose last names contain the letters LI. This time, order the rows by last name and first name, in that order:
SELECT * FROM actor
WHERE last_name
LIKE '%Li%'
ORDER BY last_name, first_name;
-- 2d. Using IN, display the country_id and country columns of the following countries: Afghanistan, Bangladesh, and China:
SELECT country_id, country
FROM country
WHERE country IN ("Afghanistan", "Bangladesh", "China");
-- 3a. You want to keep a description of each actor. You don't think you will be performing queries on a description, so create a column in the table actor named description and use the data type BLOB (Make sure to research the type BLOB, as the difference between it and VARCHAR are significant).
ALTER TABLE actor
ADD COLUMN description BLOB;
DESCRIBE actor;
-- 3b. Very quickly you realize that entering descriptions for each actor is too much effort. Delete the description column.
ALTER TABLE actor
DROP COLUMN description;
-- 4a. List the last names of actors, as well as how many actors have that last name.
SELECT last_name, COUNT(last_name)
FROM actor
GROUP BY last_name;
-- 4b. List last names of actors and the number of actors who have that last name, but only for names that are shared by at least two actors
SELECT last_name, COUNT(last_name)
FROM actor
GROUP BY last_name
HAVING COUNT(last_name)>1;
-- 4c. The actor HARPO WILLIAMS was accidentally entered in the actor table as GROUCHO WILLIAMS. Write a query to fix the record.
UPDATE actor SET first_name = "HARPO"
WHERE first_name ="GROUCHO" AND last_name = "WILLIAMS";
-- 4d. Perhaps we were too hasty in changing GROUCHO to HARPO. It turns out that GROUCHO was the correct name after all! In a single query, if the first name of the actor is currently HARPO, change it to GROUCHO.
UPDATE actor SET first_name = "GROUCHO"
WHERE first_name ="HARPO" AND last_name = "WILLIAMS";
-- 5a. You cannot locate the schema of the address table. Which query would you use to re-create it?
SHOW CREATE TABLE address;
-- 6a. Use JOIN to display the first and last names, as well as the address, of each staff member. Use the tables staff and address:
SELECT first_name, last_name, address.address
FROM staff
JOIN address
using (address_id);
-- 6b. Use JOIN to display the total amount rung up by each staff member in August of 2005. Use tables staff and payment.
SELECT staff.staff_id, first_name, last_name, SUM(payment.amount)
FROM staff
RIGHT JOIN payment
using (staff_id)
WHERE payment_date LIKE '2005-08%'
GROUP BY staff_id;
-- 6c. List each film and the number of actors who are listed for that film. Use tables film_actor and film. Use inner join.
SELECT film.film_id, title, COUNT(actor_id)
FROM film_actor
INNER JOIN film
using (film_id)
GROUP BY film_id;
-- 6d. How many copies of the film Hunchback Impossible exist in the inventory system?
SELECT COUNT(inventory_id)
AS 'Num of Copies "Hunchback Impossible"'
FROM inventory
WHERE inventory.film_id = (
SELECT film_id
FROM film
WHERE title = "Hunchback Impossible")
GROUP BY inventory.film_id;
-- 6e. Using the tables payment and customer and the JOIN command, list the total paid by each customer. List the customers alphabetically by last name:
SELECT customer.customer_id, first_name, last_name, SUM(amount)
FROM payment
LEFT JOIN customer
using (customer_id)
GROUP BY customer_id
ORDER BY last_name, first_name;
-- 7a. The music of Queen and Kris Kristofferson have seen an unlikely resurgence. As an unintended consequence, films starting with the letters K and Q have also soared in popularity. Use subqueries to display the titles of movies starting with the letters K and Q whose language is English.
SELECT title, film.language_id
FROM film
WHERE title LIKE 'K%' OR title LIKE 'Q%'
AND film.language_id = (
SELECT language.language_id
FROM language
WHERE name = "English");
-- 7b. Use subqueries to display all actors who appear in the film Alone Trip.
SELECT actor.actor_id, first_name, last_name, film_id
FROM actor
INNER JOIN film_actor
using (actor_id)
WHERE film_id = (
SELECT film.film_id
FROM film
WHERE title = "Alone Trip");
-- 7c. You want to run an email marketing campaign in Canada, for which you will need the names and email addresses of all Canadian customers. Use joins to retrieve this information.
SELECT first_name, last_name, address.city_id
FROM customer
INNER JOIN address
using (address_id)
WHERE city_id IN ( #Get customers from selection of cities
SELECT city.city_id #Get list cities in Canada
FROM city
WHERE city.country_id =(
SELECT country.country_id # Get id of Canada
FROM country
WHERE country = "Canada"));
-- 7d. Sales have been lagging among young families, and you wish to target all family movies for a promotion. Identify all movies categorized as family films.
SELECT title
FROM film
WHERE film.film_id IN (
SELECT film_category.film_id
FROM film_category
WHERE category_id = (
SELECT category.category_id
FROM category
WHERE category.name = "Family"));
-- 7e. Display the most frequently rented movies in descending order.
SELECT i.film_id, rental_date, title
FROM inventory i
INNER JOIN rental r
on i.inventory_id = r.inventory_id
INNER JOIN film f
on f.film_id = i.film_id
ORDER BY rental_date DESC limit 10;
-- 7f. Write a query to display how much business, in dollars, each store brought in.
SELECT store.store_id, SUM(amount)
FROM staff
INNER JOIN payment p
on staff.staff_id = p.staff_id
INNER JOIN store
on store.store_id = staff.store_id
GROUP BY store_id;
-- 7g. Write a query to display for each store its store ID, city, and country.
SELECT DISTINCT s.store_id, address, city, country
FROM store s
INNER JOIN address a
on a.address_id = s.address_id
INNER JOIN city c
on c.city_id = a.city_id
INNER JOIN country
on country.country_id = c.country_id;
-- 7h. List the top five genres in gross revenue in descending order. (Hint: you may need to use the following tables: category, film_category, inventory, payment, and rental.)
SELECT DISTINCT c.name, SUM(p.amount)
FROM category c
INNER JOIN film_category fc
on c.category_id = fc.category_id
INNER JOIN inventory i
on fc.film_id = i.film_id
INNER JOIN rental r
on i.inventory_id = r.inventory_id
INNER JOIN payment p
on p.rental_id = r.rental_id
GROUP BY c.name
ORDER BY SUM(p.amount) DESC limit 5;
-- 8a. In your new role as an executive, you would like to have an easy way of viewing the Top five genres by gross revenue. Use the solution from the problem above to create a view. If you haven't solved 7h, you can substitute another query to create a view.
CREATE VIEW Top_5_genres AS
SELECT DISTINCT c.name, SUM(p.amount)
FROM category c
INNER JOIN film_category fc
on c.category_id = fc.category_id
INNER JOIN inventory i
on fc.film_id = i.film_id
INNER JOIN rental r
on i.inventory_id = r.inventory_id
INNER JOIN payment p
on p.rental_id = r.rental_id
GROUP BY c.name
ORDER BY SUM(p.amount) DESC limit 5;
-- 8b. How would you display the view that you created in 8a?
SELECT * FROM Top_5_genres;
-- 8c. You find that you no longer need the view top_five_genres. Write a query to delete it.
DROP VIEW Top_5_genres;
| true |
a58b79c43233165a756a690d8729b1faa50aca59 | SQL | SDC-Whirlpool/AtelierApi | /db/schema.sql | UTF-8 | 463 | 2.8125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS sdc;
CREATE SCHEMA IF NOT EXISTS sdctables;
CREATE TABLE sdctables.reviews (
id INTEGER NOT NULL,
product_id INTEGER NOT NULL,
rating INTEGER NOT NULL,
date date NOT NULL,
summary text NOT NULL,
body text NOT NULL,
recommend BOOLEAN NOT NULL,
reported BOOLEAN NOT NULL,
reviewer_name text NOT NULL,
reviewer_email text NOT NULL,
response text,
helpfulness INTEGER NOT NULL,
PRIMARY KEY (id, product_id)
); | true |
b6083064e307e9ffa31f42e9eef0d3690f5cefbc | SQL | ilkou/soap | /Ecole.sql | UTF-8 | 2,491 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 27, 2021 at 11:30 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
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: `Ecole`
--
-- --------------------------------------------------------
--
-- Table structure for table `enseignant`
--
CREATE TABLE `enseignant` (
`cni` varchar(20) NOT NULL,
`nom` varchar(100) NOT NULL,
`prenom` varchar(100) NOT NULL,
`age` int(11) NOT NULL,
`adresse` varchar(100) NOT NULL,
`ville` varchar(100) NOT NULL,
`sexe` varchar(10) NOT NULL,
`photo` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `enseignant`
--
INSERT INTO `enseignant` (`cni`, `nom`, `prenom`, `age`, `adresse`, `ville`, `sexe`, `photo`) VALUES
('V343434', 'Saadi', 'Mostafa', 40, 'Hay mabchour', 'Khouribga', 'M', 'https://vignette.wikia.nocookie.net/fan-fiction-library/images/1/15/Admin.png');
-- --------------------------------------------------------
--
-- Table structure for table `module`
--
CREATE TABLE `module` (
`id_module` int(11) NOT NULL,
`nom` varchar(250) NOT NULL,
`description` varchar(250) NOT NULL,
`cni` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `module`
--
INSERT INTO `module` (`id_module`, `nom`, `description`, `cni`) VALUES
(1, 'Syst?me distribué ', 'Syst?me distribué Syst?me distribué Syst?me distribué ', 'V343434'),
(2, 'Unix', 'Unix Unix Unix Unix', 'V343434');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `enseignant`
--
ALTER TABLE `enseignant`
ADD PRIMARY KEY (`cni`);
--
-- Indexes for table `module`
--
ALTER TABLE `module`
ADD PRIMARY KEY (`id_module`),
ADD KEY `fk_cni` (`cni`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `module`
--
ALTER TABLE `module`
ADD CONSTRAINT `fk_cni` FOREIGN KEY (`cni`) REFERENCES `enseignant` (`cni`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
eff90c6be73b96938bcf381e7307c2e055d0c98e | SQL | rajeshghourvani/assessor | /assessorportal/AMPSQL/AMP/Views/PP_REL_SEC_PROP_VW.sql | UTF-8 | 7,066 | 3.3125 | 3 | [] | no_license | /********************************************************************************************************
NAME: PP_REL_SEC_PROP_VW
PURPOSE: DDL for View PP_REL_SEC_PROP_VW
REVISIONS:
Ver Date Author Description
--------- ---------- --------------- ---------------------------------------------------------------
1.0 06/13/2016 CADIMULAM Initial Version
1.1 07/28/2016 CADIMULAM Defect 4956: Modified to map AIN_Type_Ctgy as Air/Marine/Personal/Real
based on AIN Type.
1.2 08/02/2016 CADIMULAM Fix for defect 6776:
- As per the data model changes on 08/01/2016,
ADDR_ID column will store Primary/Vicinity Address ID
and new column MAIL_ADDR_ID will be used for storing Mailing Address ID
- Updated OWNR_HIST_LU sub-query to select Address ID from current owner record.
1.3 08/16/2016 VSINGARA - Added a legacy_namekey '2', in the Owners Query.
1.4 08/27/2016 CADIMULAM Defect 14096: Added code to append SITUS_LOC_CODE to CLUSTER_ROUTE
to display as INDEX_NUM
1.5 09/07/2016 CADIMULAM Defect 15716: Removed State, Zip, and Country from Concatenated Situs Address
1.6 09/29/2016 CADIMULAM Defect 5437: Added filter condition bf.RECORD_DELETE_DATE IS NULL to SITUS_LU sub-query
*********************************************************************************************************/
CREATE OR REPLACE FORCE EDITIONABLE VIEW AMP.PP_REL_SEC_PROP_VW (AOID, AIN, AIN_TYPE_CTGY, MAPBOOK_PAGE_PARCEL, CLUSTER_ROUTE, SITUS_LOC_CODE, INDEX_NUM, ASSESSEE_NAME, SITUS_ADDRESS, ACCT_STATUS, ACCT_TYPE, ESTB_COUNT)
AS
WITH
-- sub-query for latest Owner History record
OWNR_HIST_LU AS
(SELECT OWNR_HIST_ID, ASMT_OBJ_ID, ADDR_ID, DBA
FROM (SELECT ID OWNR_HIST_ID, ASMT_OBJ_ID, ADDR_ID, RECORDING_DATE, DBA
, RANK() OVER (PARTITION BY ASMT_OBJ_ID ORDER BY RECORDING_DATE_ORIG DESC NULLS LAST, EFFECTIVE_START_DATE DESC NULLS LAST) RNK
FROM OWNERSHIP_HISTORY
WHERE EFFECTIVE_END_DATE IS NULL)
WHERE RNK=1)
-- sub-query for Owner record with names concatenated
, OWNR_LU AS
(SELECT OWNR_HIST_ID, LISTAGG(NAME, '; ') WITHIN GROUP (ORDER BY NVL(LEGACY_NAMEKEY,1)) name
FROM OWNERS
WHERE NVL(LEGACY_NAMEKEY,'1') IN ('1','2','3')
GROUP BY OWNR_HIST_ID)
-- sub-query for Situs code from BPP_FIXTURES (select first record)
, SITUS_LU AS
(SELECT ASMT_OBJ_ID, SITUS_LOC_CODE
FROM (SELECT ca.ASMT_OBJ_ID, bf.ID, bf.SITUS_LOC_CODE, RANK() OVER (PARTITION BY ca.ASMT_OBJ_ID ORDER BY bf.ID) RNK
FROM BPP_FIXTURES bf
, COMP_ASMTS ca
WHERE bf.SITUS_LOC_CODE IS NOT NULL
-- defect 5437 - select records with record delete date as null
AND bf.RECORD_DELETE_DATE IS NULL
AND ca.BPP_FIX_ID=bf.ID)
WHERE RNK=1)
SELECT ao.ID AS AOID
, ao.AIN AS AIN
, 'REAL' AS AIN_Type_Ctgy
, ao.MAPBOOK_PAGE_PARCEL AS Mapbook_Page_Parcel
, cr.CLUSTER_ROUTE AS CLUSTER_ROUTE
, situs_lu.SITUS_LOC_CODE AS SITUS_LOC_CODE
, (cr.CLUSTER_ROUTE || situs_lu.SITUS_LOC_CODE) AS Index_Num
, upper(ownr_lu.NAME) AS Assessee_Name
--Defect 15716: Removed State, Zip, and Country from Concatenated Situs Address
/* , upper(decode(addr.STREET_NUMBER, '0', NULL, addr.STREET_NUMBER) || decode(addr.STREET_NUMBER, '0', '', ' ')
|| NVL2(addr.FRACTION, addr.FRACTION || ' ', '')
|| NVL2(addr.DIRECTION, addr.DIRECTION || ' ', '')
|| NVL2(addr.STREET, addr.STREET || decode(addr.STREET_TYPE, NULL, ', ', ' '), '' )
|| NVL2(addr.STREET_TYPE, addr.STREET_TYPE || ', ', '')
|| NVL2(addr.UNIT_NUMBER, addr.UNIT_NUMBER || ', ', '')
|| NVL2(addr.CITY, addr.CITY || ', ', '')
|| NVL2(addr.STATE, addr.STATE || ' ', '')
|| NVL2(addr.ZIP, addr.ZIP || ' ', '')
|| addr.COUNTRY) AS Situs_Address */
, upper(decode(addr.STREET_NUMBER, '0', NULL, addr.STREET_NUMBER) || decode(addr.STREET_NUMBER, '0', '', ' ')
|| NVL2(addr.FRACTION, addr.FRACTION || ' ', '')
|| NVL2(addr.DIRECTION, addr.DIRECTION || ' ', '')
|| NVL2(addr.STREET, addr.STREET || decode(addr.STREET_TYPE, NULL, ', ', ' '), '' )
|| NVL2(addr.STREET_TYPE, addr.STREET_TYPE || ', ', '')
|| NVL2(addr.UNIT_NUMBER, addr.UNIT_NUMBER || ', ', '')
|| addr.CITY) AS Situs_Address
, NULL AS Acct_Status --*** no mapping ***
, ao.AIN_TYPE AS Acct_Type
, COUNT(DISTINCT ao.AIN) AS Estb_Count
FROM ASMT_OBJECTS ao
, CLUSTER_ROUTE cr
, OWNR_HIST_LU
, OWNR_LU
, ADDRESSES addr
, SITUS_LU
WHERE ao.MAPBOOK_PAGE_PARCEL = ao.AIN
AND ao.AIN_TYPE NOT IN ('Company', 'Aircraft', 'Marine')
AND ao.CLUSTER_ROUTE_REF = cr.ID (+)
AND ao.ID = ownr_hist_lu.ASMT_OBJ_ID (+)
AND ownr_hist_lu.OWNR_HIST_ID = ownr_lu.OWNR_HIST_ID (+)
AND ownr_hist_lu.ADDR_ID = ADDR.ID (+)
AND ao.ID = situs_lu.ASMT_OBJ_ID (+)
GROUP BY ao.ID
, ao.AIN
, ao.MAPBOOK_PAGE_PARCEL
, cr.CLUSTER_ROUTE
, situs_lu.SITUS_LOC_CODE
, (cr.CLUSTER_ROUTE || situs_lu.SITUS_LOC_CODE)
, upper(ownr_lu.NAME)
--Defect 15716: Removed State, Zip, and Country from Concatenated Situs Address
/* , upper(decode(addr.STREET_NUMBER, '0', NULL, addr.STREET_NUMBER) || decode(addr.STREET_NUMBER, '0', '', ' ')
|| NVL2(addr.FRACTION, addr.FRACTION || ' ', '')
|| NVL2(addr.DIRECTION, addr.DIRECTION || ' ', '')
|| NVL2(addr.STREET, addr.STREET || decode(addr.STREET_TYPE, NULL, ', ', ' '), '' )
|| NVL2(addr.STREET_TYPE, addr.STREET_TYPE || ', ', '')
|| NVL2(addr.UNIT_NUMBER, addr.UNIT_NUMBER || ', ', '')
|| NVL2(addr.CITY, addr.CITY || ', ', '')
|| NVL2(addr.STATE, addr.STATE || ' ', '')
|| NVL2(addr.ZIP, addr.ZIP || ' ', '')
|| addr.COUNTRY) */
, upper(decode(addr.STREET_NUMBER, '0', NULL, addr.STREET_NUMBER) || decode(addr.STREET_NUMBER, '0', '', ' ')
|| NVL2(addr.FRACTION, addr.FRACTION || ' ', '')
|| NVL2(addr.DIRECTION, addr.DIRECTION || ' ', '')
|| NVL2(addr.STREET, addr.STREET || decode(addr.STREET_TYPE, NULL, ', ', ' '), '' )
|| NVL2(addr.STREET_TYPE, addr.STREET_TYPE || ', ', '')
|| NVL2(addr.UNIT_NUMBER, addr.UNIT_NUMBER || ', ', '')
|| addr.CITY)
, ao.AIN_TYPE;
| true |
747a4c15f74ab25aabb7a208d6fd902ac6aab520 | SQL | ychang21/Bamazon | /schema.sql | UTF-8 | 1,441 | 3.0625 | 3 | [] | no_license | CREATE DATABASE bamazon_DB;
USE bamazon_DB;
CREATE TABLE Products(
itemId INT NOT NULL AUTO_INCREMENT,
productName VARCHAR(45) NOT NULL,
departmentName VARCHAR(45) NOT NULL,
price DECIMAL(10, 4) NOT NULL,
stockQuantity INT(10) NOT NULL,
PRIMARY KEY (itemId));
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('Light bulbs','Home Improvement',9.99,50);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('Computer Speakers','Electronics',99.99,20);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('Air Jordan 1','Shoes',349.99,70);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('Coca-Cola 12 pack','Grocery',4.50,200);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('iPad','Electronics',799.00,15);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('Candy','Grocery',0.99,100);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('White T-Shirt','Apparel',4.99,300);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('Socks 3 pack','Apparel',9.99,65);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('Cards Against Humanity','Games',25.00,10);
INSERT INTO Products (productName,departmentName,price,stockQuantity) VALUES ('The Girl on the Train','Books',9.99,1000);
| true |
500012630360d5435603d3f30164143dea1278e9 | SQL | 1cg2cg3cg/AI_Concentration | /db재정의.sql | UTF-8 | 2,394 | 3.578125 | 4 | [] | no_license | show databases;
use aiconcd;
create user 'ai'@'%' identified by '1234';
grant all privileges on aiconcd.* to 'ai'@'%';
flush privileges;
use mysql;
select user, host from user;
show variables like 'PORT';
drop database aiconcd;
create database aiconcd;
use aiconcd;
-- 컬럼 타입 변경--
alter table user modify user_sex boolean;
drop table user;
CREATE TABLE IF NOT EXISTS `Frame` (
`user_id` varchar(20) NOT NULL,
`filename` CHAR(25) NOT NULL,
`emotion` TINYINT NOT NULL,
`emotion_prob` FLOAT NOT NULL,
`is_eyeopen` TINYINT NOT NULL,
`is_seat` TINYINT NOT NULL,
PRIMARY KEY (user_id, filename)
);
CREATE TABLE IF NOT EXISTS `User` (
`user_id` varchar(20) PRIMARY KEY NOT NULL,
`user_name` VARCHAR(50) NOT NULL,
`user_age` TINYINT NOT NULL,
`user_sex` boolean NOT NULL,
`user_class` INT NOT NULL,
`grade` TINYINT NOT NULL,
`parents_id` varchar(100) NOT NULL
);
drop table timetable;
CREATE TABLE IF NOT EXISTS `Timetable` (
`subject` VARCHAR(100) NOT NULL,
`subject_start` DATETIME NOT NULL,
`subject_finish` DATETIME NOT NULL,
`user_id` varchar(20) NOT NULL,
foreign key(`user_id`) references `user` (`user_id`)
);
alter table user_conc modify day_conc date;
drop table user_conc;
-- 컬럼명 변경 --
alter table user_conc change totla_conc_time total_conc_time INT;
CREATE TABLE IF NOT EXISTS `User_Conc` (
`user_id` varchar(20) NOT NULL,
`day_conc` DATE NOT NULL,
`subject` VARCHAR(100) NOT NULL,
`total_subject_time_conc` INT NOT NULL,
`eye_close_time` INT NOT NULL,
`not_seat_time` INT NOT NULL,
`total_conc_time` INT NOT NULL,
PRIMARY KEY (user_id, day_conc, subject)
);
drop table user_emotion;
CREATE TABLE IF NOT EXISTS `User_Emotion` (
`user_id` varchar(20) NOT NULL,
`day_emo` DATE NOT NULL,
`subject` VARCHAR(100) NOT NULL,
`total_subject_time_emo` INT NOT NULL,
`sub_emotion` INT NOT NULL,
`sub_emotion_time` INT NOT NULL,
PRIMARY KEY (user_id, day_emo, subject, sub_emotion)
);
CREATE TABLE IF NOT EXISTS `Parents` (
`parents_id` VARCHAR(100) PRIMARY KEY,
`parents_pw` VARCHAR(100)
); | true |
3139e5b06a9428e5bc01e1060a643827604b5db4 | SQL | sees-yamazaki/plc | /gijiroku/sql/make.sql | UTF-8 | 1,936 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 08, 2019 at 11:53 AM
-- Server version: 5.7.25
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `gijiroku`
--
-- --------------------------------------------------------
--
-- Table structure for table `giji`
--
CREATE TABLE `giji` (
`giji_seq` int(11) NOT NULL,
`giji_id` varchar(20) NOT NULL,
`giji_date` date NOT NULL,
`giji_title` varchar(30) NOT NULL,
`giji_note` text NOT NULL,
`giji_file1` text NOT NULL,
`giji_file2` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `giji`
--
INSERT INTO `giji` (`giji_seq`, `giji_id`, `giji_date`, `giji_title`, `giji_note`, `giji_file1`, `giji_file2`) VALUES
(14, '123456789', '2019-11-08', '議事録テスト1', '参加者12人', '第12回議事録.doc', '');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`users_seq` int(11) NOT NULL,
`users_id` int(11) NOT NULL,
`users_pw` int(11) NOT NULL,
`users_name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`users_seq`, `users_id`, `users_pw`, `users_name`) VALUES
(1, 123, 456, 'あどみん'),
(2, 1234, 1234, 'aaa');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `giji`
--
ALTER TABLE `giji`
ADD PRIMARY KEY (`giji_seq`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`users_seq`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `giji`
--
ALTER TABLE `giji`
MODIFY `giji_seq` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `users_seq` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
| true |
7e3270f9b93da03162b286e42ba7d7c355d76f96 | SQL | bartekus/reactuate-app | /packages/server/db/migrations/20181102_201027.app_public.tables.user_authentications-up.sql | UTF-8 | 1,801 | 3.75 | 4 | [
"Apache-2.0"
] | permissive | create table app_public.user_authentications (
id serial primary key,
user_id int not null references app_public.users on delete cascade,
service text not null,
identifier text not null,
details jsonb not null default '{}'::jsonb,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now(),
constraint uniq_user_authentications unique(service, identifier)
);
create index on app_public.user_authentications (user_id);
alter table app_public.user_authentications enable row level security;
create trigger _100_timestamps
before insert or update on app_public.user_authentications
for each row
execute procedure app_private.tg__timestamps();
comment on table app_public.user_authentications is
E'@omit all\nContains information about the login providers this user has used, so that they may disconnect them should they wish.';
comment on column app_public.user_authentications.user_id is
E'@omit';
comment on column app_public.user_authentications.service is
E'The login service used, e.g. `twitter` or `github`.';
comment on column app_public.user_authentications.identifier is
E'A unique identifier for the user within the login service.';
comment on column app_public.user_authentications.details is
E'@omit\nAdditional profile details extracted from this login method';
create policy select_own on app_public.user_authentications for select using (user_id = app_public.current_user_id());
create policy delete_own on app_public.user_authentications for delete using (user_id = app_public.current_user_id()); -- TODO check this isn't the last one, or that they have a verified email address
grant select on app_public.user_authentications to :DATABASE_VISITOR;
grant delete on app_public.user_authentications to :DATABASE_VISITOR;
| true |
7c46ab4e10272fe112b46d220ef677c9ee655a24 | SQL | conero/lang | /mind/gsdm/gsdm_base-init-data.sql | UTF-8 | 1,061 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | /*==============================================================*/
/* DBMS name: MySQL 5.7 初始化数据 */
/* Created on: 2019/8/15 16:05:34 */
/*==============================================================*/
-- /-------------------- 【系统常量】
-- 基本状态
INSERT INTO config
(`key`, descrip, value, text_value, sub_mk)
VALUES ('status', '通用状态描述', '', '', '1')
;
set @pid := @@identity;
INSERT INTO config_subset
(pid, subval, subdesc)
VALUES
(@pid, '90', '有效')
,(@pid, '40', '已禁数据无效')
,(@pid, '10', '待处理,初始化状态')
;
-- /-------------------- 【系统管理员账户】
INSERT INTO `user` (id, account, password, status) values
(0, 'dev', '12345', '90')
;
set @user_dev := @@identity;
-- /-------------------- 【角色】
INSERT INTO `role` (name, code, status)
VALUES
('开发', 'dev', '90')
;
set @role_dev := @@identity;
INSERT INTO userole (uid, roleid)
VALUES
(@user_dev, @role_dev)
;
| true |
2288ed7cf93e4f8661313b66a138f60e3e633bdf | SQL | eanderton/minibar | /resources/test.sql | UTF-8 | 778 | 2.890625 | 3 | [] | no_license | drop table if exists users;
create table users (
username varchar(255) primary key not null,
role varchar(255) not null,
password varchar(255) not null
);
insert into users (username,role,password) values ('admin','admin','password');
insert into users (username,role,password) values ('user','user','password');
insert into users (username,role,password) values ('guest','guest','password');
drop table if exists testdata;
create table testdata (
id bigint primary key,
data text default '',
modified datetime default null
);
insert into testdata (data,modified) values ('foo',datetime('NOW'));
insert into testdata (data,modified) values ('bar',datetime('NOW'));
insert into testdata (data,modified) values ('baz',datetime('NOW'));
| true |
9a74d9753f85ca6e334459577ffe0255364213f7 | SQL | flexagon9/flextest | /APEX/CustomerTracker/application/shared_components/user_interface/templates/list/button_control_group.sql | UTF-8 | 1,364 | 2.640625 | 3 | [] | no_license | --application/shared_components/user_interface/templates/list/button_control_group
prompt ......list template 1024082145644455931
begin
declare
t varchar2(32767) := null;
t2 varchar2(32767) := null;
t3 varchar2(32767) := null;
t4 varchar2(32767) := null;
t5 varchar2(32767) := null;
t6 varchar2(32767) := null;
t7 varchar2(32767) := null;
t8 varchar2(32767) := null;
l_clob clob;
l_clob2 clob;
l_clob3 clob;
l_clob4 clob;
l_clob5 clob;
l_clob6 clob;
l_clob7 clob;
l_clob8 clob;
l_length number := 1;
begin
t:=t||'<a href="#LINK#" rel="external" data-role="button" data-icon="#A01#">#TEXT_ESC_SC#</a>';
t2:=t2||'<a href="#LINK#" rel="external" data-role="button" data-icon="#A01#">#TEXT_ESC_SC#</a>';
t3 := null;
t4 := null;
t5 := null;
t6 := null;
t7 := null;
t8 := null;
wwv_flow_api.create_list_template (
p_id=>1024082145644455931 + wwv_flow_api.g_id_offset,
p_flow_id=>wwv_flow.g_flow_id,
p_list_template_current=>t,
p_list_template_noncurrent=> t2,
p_list_template_name=>'Button Control Group',
p_theme_id => 50,
p_theme_class_id => 9,
p_list_template_before_rows=>'<div id="navgroup">'||unistr('\000a')||
' <div data-role="controlgroup" data-type="horizontal">',
p_list_template_after_rows=>'</div></div>',
p_translate_this_template => 'N',
p_list_template_comment=>'');
end;
null;
end;
/
| true |
a9d32938aac5ea4d5ae6965505ee3e93a8b15bfb | SQL | collab-uniba/emotions-online-qa | /build_dataset/sql/dump.sql | UTF-8 | 3,621 | 3.515625 | 4 | [
"MIT"
] | permissive | # Copyright (c) 2013 Georgios Gousios
# MIT-licensed
# ERRORE RISCONTRATO: quando si esegue in mysql 'source dump.sql'
# ERROR 13 (HY000): Can't get stat of '/mnt/workingdir/stackoverflow_dump/Badges.xml' (Errcode: 13)
#
# SOLUZIONE
# sudo chown mysql:mysql /mnt/workingdir/stackoverflow_dump/ -R
drop database stackoverflow;
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use stackoverflow;
create table Badges (
Id INT NOT NULL PRIMARY KEY,
UserId INT,
Name VARCHAR(50),
Date DATETIME
);
CREATE TABLE Comments (
Id INT NOT NULL PRIMARY KEY,
PostId INT NOT NULL,
Score INT NOT NULL DEFAULT 0,
Text TEXT,
CreationDate DATETIME,
UserId INT NOT NULL,
UserDisplayName TEXT
);
CREATE TABLE PostHistory (
Id INT NOT NULL PRIMARY KEY,
PostHistoryTypeId SMALLINT NOT NULL,
PostId INT NOT NULL,
RevisionGUID VARCHAR(36),
CreationDate DATETIME,
UserId INT NOT NULL,
CommentT TEXT,
Text TEXT,
CloseReasonId TEXT
);
CREATE TABLE Posts (
Id INT NOT NULL PRIMARY KEY,
PostTypeId SMALLINT,
AcceptedAnswerId INT,
ParentId INT,
Score INT,
ViewCount INT,
Body TEXT,
OwnerUserId INT NOT NULL,
OwnerDisplayName TEXT,
LastEditorUserId INT,
LastEditorDisplayName TEXT,
LastEditDate DATETIME,
LastActivityDate DATETIME,
CommunityOwnedDate DATETIME,
Title TEXT,
Tags TEXT,
AnswerCount INT,
CommentCount INT,
FavoriteCount INT,
CreationDate DATETIME,
ClosedDate DATETIME
);
CREATE TABLE Users (
Id INT NOT NULL PRIMARY KEY,
Reputation INT,
CreationDate DATETIME,
DisplayName VARCHAR(50),
LastAccessDate DATETIME,
Views INT DEFAULT 0,
WebsiteUrl VARCHAR(256),
Location VARCHAR(256),
AboutMe TEXT,
Age INT,
UpVotes INT,
DownVotes INT,
EmailHash VARCHAR(32),
AccountId INT,
ProfileImageUrl TEXT
);
CREATE TABLE Votes (
Id INT NOT NULL PRIMARY KEY,
PostId INT NOT NULL,
VoteTypeId SMALLINT,
CreationDate DATETIME,
UserId INT NOT NULL,
BountyAmount INT DEFAULT 0
);
CREATE TABLE PostLinks(
Id INT NOT NULL PRIMARY KEY,
CreationDate DATETIME,
PostId INT,
RelatedPostId INT,
LinkTypeId INT
);
load xml infile '/mnt/workingdir/stackoverflow_dump/Badges.xml'
into table Badges
rows identified by '<row>';
load xml infile '/mnt/workingdir/stackoverflow_dump/Comments.xml'
into table Comments
rows identified by '<row>';
load xml infile '/mnt/workingdir/stackoverflow_dump/PostHistory.xml'
into table PostHistory
rows identified by '<row>';
load xml infile '/mnt/workingdir/stackoverflow_dump/Posts.xml'
into table Posts
rows identified by '<row>';
load xml infile '/mnt/workingdir/stackoverflow_dump/Users.xml'
into table Users
rows identified by '<row>';
load xml infile '/mnt/workingdir/stackoverflow_dump/Votes.xml'
into table Votes
rows identified by '<row>';
load xml infile '/mnt/workingdir/stackoverflow_dump/PostLinks.xml'
into table PostLinks
rows identified by '<row>';
create index badges_idx_1 on Badges(UserId);
create index badges_idx_2 on Badges(Date);
create index badges_idx_3 on Badges(Id);
create index comments_idx_1 on Comments(PostId);
create index comments_idx_2 on Comments(UserId);
create index post_history_idx_1 on PostHistory(PostId);
create index post_history_idx_2 on PostHistory(UserId);
create index posts_idx_1 on Posts(AcceptedAnswerId);
create index posts_idx_2 on Posts(ParentId);
create index posts_idx_3 on Posts(OwnerUserId);
create index posts_idx_4 on Posts(LastEditorUserId);
create index posts_idx_5 on Posts(PostTypeId);
create index posts_idx_6 on Posts(Id);
create index votes_idx_1 on Votes(PostId);
create index votes_idx_2 on Votes(VoteTypeId);
create index votes_idx_3 on Votes(Id);
create index votes_idx_4 on Votes(CreationDate);
| true |
a7b5d96ff60111bc15a6e0e2bfeb37930f080218 | SQL | Akashv1507/wrldc_soFar_highest | /sql/soFarHighest.sql | UTF-8 | 368 | 3.015625 | 3 | [] | no_license | create table SoFar_Highest
(
id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
datasource varchar2(50),
metric_name varchar2(50),
sofar_highest number(10,2),
sofar_highest_timestamp date,
prev_sofar_highest number(10,2),
prev_sofar_highest_timestamp date,
constraints unique_soFarHighest unique(datasource, metric_name),
constraints pk_soFarHighest primary key(id)
) | true |
d1eff8f6855d3ef0870962a666a3aa36d9259cd0 | SQL | GerritLuimstra/DistributedNeuralNetwork | /projectdnn.sql | UTF-8 | 4,172 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 10 jun 2018 om 15:39
-- Serverversie: 10.1.26-MariaDB
-- PHP-versie: 7.0.22
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: `projectdnn`
--
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `datapool`
--
CREATE TABLE `datapool` (
`id` int(10) NOT NULL,
`name` varchar(100) NOT NULL,
`size` float NOT NULL,
`status` int(2) NOT NULL DEFAULT '0',
`project_id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Gegevens worden geëxporteerd voor tabel `datapool`
--
INSERT INTO `datapool` (`id`, `name`, `size`, `status`, `project_id`) VALUES
(1, 'dataset0.csv', 33, 0, 11),
(2, 'dataset1.csv', 33, 1, 11),
(3, 'dataset2.csv', 33, 2, 11),
(4, 'dataset0.csv', 50, 0, 12);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `projects`
--
CREATE TABLE `projects` (
`id` int(10) NOT NULL,
`token` varchar(64) NOT NULL,
`name` varchar(100) NOT NULL,
`desc` varchar(500) NOT NULL,
`picture` varchar(100) NOT NULL DEFAULT 'projects/default.png',
`user_id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Gegevens worden geëxporteerd voor tabel `projects`
--
INSERT INTO `projects` (`id`, `token`, `name`, `desc`, `picture`, `user_id`) VALUES
(10, 'DSFG-80563d77c06527e2bf3c45948186b12e310c1c4b', 'dsfg', 'sdfg', 'projects/default.png', 1),
(11, 'MNIST20-7c304963cec03b5831792669c79756f6bdd73d2c', 'MNIST20', 'This is a sample project\r\n', 'projects/default.png', 1),
(12, 'STENDENS-ab7a0512b383591b0c137d6ed1953c48634431c7', 'stendensomethign', 'kjashklajsdf\r\n', 'projects/default.png', 1),
(13, 'APPLE IN-dd1bb3fe9373691c1b4a6a203629ccaa3e01d327', 'Apple INC', 'this is something', 'projects/default.png', 1);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `users`
--
CREATE TABLE `users` (
`id` int(10) NOT NULL,
`username` varchar(32) NOT NULL,
`name` text NOT NULL,
`email` varchar(200) NOT NULL,
`password` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Gegevens worden geëxporteerd voor tabel `users`
--
INSERT INTO `users` (`id`, `username`, `name`, `email`, `password`) VALUES
(1, 'gerritman123', 'Gerrit Luimstra', 'gerrit.luimstra@ziggo.nl', '$2y$10$y7erBXNjc6ltUq.KJyruruvgZ19IZZvlW8brN7bvA4nlAS5az2gsu');
--
-- Indexen voor geëxporteerde tabellen
--
--
-- Indexen voor tabel `datapool`
--
ALTER TABLE `datapool`
ADD PRIMARY KEY (`id`),
ADD KEY `datapool_projects` (`project_id`);
--
-- Indexen voor tabel `projects`
--
ALTER TABLE `projects`
ADD PRIMARY KEY (`id`),
ADD KEY `project_user` (`user_id`);
--
-- Indexen voor tabel `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT voor geëxporteerde tabellen
--
--
-- AUTO_INCREMENT voor een tabel `datapool`
--
ALTER TABLE `datapool`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT voor een tabel `projects`
--
ALTER TABLE `projects`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT voor een tabel `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Beperkingen voor geëxporteerde tabellen
--
--
-- Beperkingen voor tabel `datapool`
--
ALTER TABLE `datapool`
ADD CONSTRAINT `datapool_projects` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Beperkingen voor tabel `projects`
--
ALTER TABLE `projects`
ADD CONSTRAINT `project_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE 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 */;
| true |
4a9e1ae66a05c0c672e11dcbd9b826e9c76e7782 | SQL | funfunsin/SQL | /SQL Server 指令碼1/SQL Server 指令碼1/22DDL-Alter.sql | BIG5 | 609 | 3.390625 | 3 | [] | no_license | --ƪsW
alter table q
add ƶq int not null default 1,
q datetime not null default getdate()
--ƪק
alter table q
alter column ƶq bigint
--ƪR
alter table q
drop constraint DF__q__ƶq__52593CB8
alter table q
drop column ƶq
--ƪק
alter table q
drop constraint qjs_check
alter table q
add constraint qjs_check
check(`>0)
--קforeign key
alter table б
add foreign key(Ҧr) references u(Ҧr)
| true |
3a95e24f076994257b2f4e3e3b5d9e387c7f7730 | SQL | moneymanagerex/general-reports | /packages/Transaction/FollowUpTransactions/sqlcontent.sql | UTF-8 | 1,085 | 3.125 | 3 | [
"MIT"
] | permissive | SELECT IFNULL(CH.CURRVALUE, m.BASECONVRATE) AS CURRRATE,
t.TRANSID,
t.TRANSDATE,
a.ACCOUNTNAME,
p.PAYEENAME,
t.NOTES,
((CASE t.TRANSCODE WHEN 'Deposit' THEN t.TRANSAMOUNT ELSE -t.TRANSAMOUNT END) * (IFNULL(CH.CURRVALUE, m.BASECONVRATE))) AS TRANSAMOUNT,
m.PFX_SYMBOL,
m.SFX_SYMBOL,
m.GROUP_SEPARATOR,
m.DECIMAL_POINT
FROM CHECKINGACCOUNT_V1 AS t
JOIN
PAYEE_V1 AS p ON p.PAYEEID = t.PAYEEID
JOIN
ACCOUNTLIST_V1 AS a ON a.ACCOUNTID = t.ACCOUNTID
JOIN
CURRENCYFORMATS_V1 AS m ON m.CURRENCYID = a.CURRENCYID
LEFT JOIN
CURRENCYHISTORY_V1 AS CH ON CH.CURRENCYID = m.CURRENCYID AND
CH.CURRDATE = (
SELECT MAX(CRHST.CURRDATE)
FROM CURRENCYHISTORY_V1 AS CRHST
WHERE CRHST.CURRENCYID = m.CURRENCYID
)
WHERE t.STATUS="F";
| true |
a474107a865065421c4551669d722637977693c3 | SQL | thangduong3010/PL-SQL | /Script/rdbms_admin/cattrans.sql | UTF-8 | 8,175 | 3.015625 | 3 | [] | no_license | Rem
Rem $Header: rdbms/admin/cattrans.sql /st_rdbms_11.2.0/1 2012/01/13 23:08:59 yberezin Exp $
Rem
Rem cattrans.sql
Rem
Rem Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Rem All rights reserved.
Rem
Rem NAME
Rem cattrans.sql - <one-line expansion of the name>
Rem
Rem DESCRIPTION
Rem <short description of component this file declares/defines>
Rem
Rem NOTES
Rem <other useful comments, qualifications, etc.>
Rem
Rem MODIFIED (MM/DD/YY)
Rem apfwkr 01/08/12 - Backport yberezin_bug-12926385 from main
Rem swshekha 01/15/09 - add view all_transformations
Rem wesmith 10/03/03 - register DBMS_TRANSFORM_EXIMP for instance-level
Rem export procedural action
Rem gviswana 01/29/02 - CREATE OR REPLACE SYNONYM
Rem nbhatt 01/23/02 - add the type names to dictionary
Rem rburns 10/28/01 - remove constraint error
Rem nbhatt 11/29/00 - add the DBMS_TRANSFORM_EXIMP package to exppkgobj
Rem nbhatt 09/26/00 - add views, comments
Rem nbhatt 09/19/00 - replace colon with slash
Rem nbhatt 08/28/00 - add version information in dictionary
Rem nbhatt 07/31/00 - transformation dictionary tables
Rem nbhatt 07/31/00 - Created
Rem
--
-- Table that stores the transformations
create table transformations$(
transformation_id number not null primary key,
owner varchar2(30) not null,
name varchar2(30) not null,
from_schema varchar2(30),
from_type varchar2(30),
from_toid raw(16) not null,
from_version number not null,
to_schema varchar2(30),
to_type varchar2(60),
to_toid raw(16) not null,
to_version number not null);
--
-- Table that stores the attribute mappings
create table attribute_transformations$(
transformation_id number,
constraint attribute_transformations_fk
foreign key (transformation_id)
references transformations$ on delete cascade,
attribute_number number,
constraint attribute_transformations_pk
primary key(transformation_id, attribute_number),
sql_expression varchar2(4000),
xsl_transformation CLOB);
--
-- Sequence for transformation id
--
CREATE SEQUENCE sys.aq$_trans_sequence START WITH 1;
--
-- User_transformations
--
create or replace view USER_TRANSFORMATIONS
(transformation_id, name, from_type, to_type)
as
SELECT t.transformation_id, t.name,
t.from_schema||'.'||t.from_type, t.to_schema||'.'||t.to_type
FROM transformations$ t, sys.user$ u
WHERE u.user# = USERENV('SCHEMAID')
and u.name = t.owner
/
--
-- User transformation attributes
--
Create or replace view USER_ATTRIBUTE_TRANSFORMATIONS
(transformation_id, name, from_type, to_type,
attribute, attribute_transformation)
as
SELECT t.transformation_id, t.name,
t.from_schema||'.'||t.from_type, t.to_schema||'.'||t.to_type,
at.attribute_number,
at.sql_expression
FROM transformations$ t, attribute_transformations$ at, sys.user$ u
WHERE u.user# = USERENV('SCHEMAID')
and u.name = t.owner and t.transformation_id = at.transformation_id
/
--
-- DBA_transformations
create or replace view DBA_TRANSFORMATIONS
(transformation_id, owner, name, from_type, to_type)
as
SELECT t.transformation_id, u.name, t.name,
t.from_schema||'.'||t.from_type, t.to_schema||'.'||t.to_type
FROM transformations$ t, sys.user$ u
WHERE u.name = t.owner
/
--
-- DBA transformation attributes
--
Create or replace view DBA_ATTRIBUTE_TRANSFORMATIONS
(transformation_id, owner, name, from_type, to_type, attribute, attribute_transformation)
as
SELECT t.transformation_id, u.name, t.name,
t.from_schema||'.'||t.from_type, t.to_schema||'.'||t.to_type,
at.attribute_number,
at.sql_expression
FROM transformations$ t, attribute_transformations$ at, sys.user$ u
WHERE u.name = t.owner and t.transformation_id = at.transformation_id
/
--
-- ALL transformations
--
CREATE OR REPLACE VIEW ALL_TRANSFORMATIONS
(transformation_id, owner, name, from_type, to_type)
AS
select t.transformation_id, t.owner, t.name, t.from_type,
t.to_type from transformations$ t, sys.user$ u
where
u.user# = USERENV('SCHEMAID')
and (u.name = t.owner /* user is the owner */
or (exists (select null from v$enabledprivs /* user has system privelege */
where priv_number in (-184 /* EXECUTE ANY TYPE */)))
or
(t.from_type in /* user has execute on from type */
(
select t.from_type from transformations$ t, obj$ o, objauth$ oa
where
o.obj# = oa.obj# and
t.from_type = o.name and
(oa.grantor# = userenv('SCHEMAID') OR
oa.obj# in
(select ro.obj#
from sys.objauth$ ro
where grantee# in (select kzsrorol from x$kzsro))
)
and t.to_type in /* user has execute on to type */
(
select t.to_type from transformations$ t, obj$ o, objauth$ oa
where
o.obj# = oa.obj# and
t.to_type = o.name and
(oa.grantor# = userenv('SCHEMAID') OR
oa.obj# in
(select ro.obj#
from sys.objauth$ ro
where grantee# in (select kzsrorol from x$kzsro))))))
)
/
--
-- ALL transformation attributes
--
Create or replace view ALL_ATTRIBUTE_TRANSFORMATIONS
(transformation_id, owner, name, from_type, to_type, attribute, attribute_transformation)
as
SELECT t.transformation_id, t.owner, t.name,
t.from_schema||'.'||t.from_type, t.to_schema||'.'||t.to_type,
at.attribute_number,
at.sql_expression
FROM transformations$ t, attribute_transformations$ at, sys.user$ u
WHERE
t.transformation_id = at.transformation_id and
u.user# = USERENV('SCHEMAID')
and (u.name = t.owner /* user is the owner */
or (exists (select null from v$enabledprivs /* user has system privelege */
where priv_number in (-184 /* EXECUTE ANY TYPE */)))
or
(t.from_type in /* user has execute on from type */
(
select t.from_type from transformations$ t, obj$ o, objauth$ oa
where
o.obj# = oa.obj# and
t.from_type = o.name and
(oa.grantor# = userenv('SCHEMAID') OR oa.obj# in
(select ro.obj#
from sys.objauth$ ro
where grantee# in (select kzsrorol from x$kzsro))
)
and t.to_type in /* user has execute on to type */
(
select t.to_type from transformations$ t, obj$ o, objauth$ oa
where
o.obj# = oa.obj# and
t.to_type = o.name and
(oa.grantor# = userenv('SCHEMAID') OR
oa.obj# in
(select ro.obj#
from sys.objauth$ ro
where grantee# in (select kzsrorol from x$kzsro))))))
)
/
create or replace public synonym dba_transformations for dba_transformations
/
create or replace public synonym user_transformations for user_transformations
/
create or replace public synonym all_transformations for all_transformations
/
grant select on user_transformations to PUBLIC with grant option
/
create or replace public synonym dba_attribute_transformations
for dba_attribute_transformations
/
create or replace public synonym user_attribute_transformations
for user_attribute_transformations
/
create or replace public synonym all_attribute_transformations
for all_attribute_transformations
/
grant select on user_attribute_transformations to PUBLIC with grant option
/
grant select on dba_attribute_transformations to select_catalog_role
/
grant select on dba_transformations to select_catalog_role
/
grant select on all_attribute_transformations to PUBLIC
/
grant select on all_transformations to PUBLIC
/
delete from sys.exppkgact$
where package = 'DBMS_TRANSFORM_EXIMP' and schema='SYS';
insert into sys.exppkgact$(package, schema, class, level#)
values('DBMS_TRANSFORM_EXIMP', 'SYS', 2, 1000)
/
insert into sys.exppkgact$(package, schema, class, level#)
values('DBMS_TRANSFORM_EXIMP', 'SYS', 3, 1000)
/
| true |
dcdfc62200b15c4e6c63141875b8767058b2b010 | SQL | DmitrySadchikov/JavaItis | /DB/queries.sql | UTF-8 | 511 | 3.875 | 4 | [] | no_license | SELECT C.CAR_MAKE AS CAR
FROM CARS C, CAR_USERS U, ID_CAR_USERS_ID_CARS I
WHERE C.ID = I.ID_CAR AND I.ID_CAR_USER = U.ID
AND U.CITY = 'Казань'
SELECT U.U_NAME AS USERNAME
FROM CAR_USERS U, ID_CAR_USERS_ID_CARS I
WHERE EXISTS (SELECT *
FROM CARS C
WHERE C.ID = I.ID_CAR AND I.ID_CAR_USER = U.ID
AND C.MILEAGE > 100);
SELECT U.U_NAME AS USERNAME, C.CAR_MAKE AS CAR
FROM CAR_USERS U, CARS C, ID_CAR_USERS_ID_CARS I
WHERE U.ID = I.ID_CAR_USER AND I.ID_CAR = C.ID
AND C.MILEAGE > 50 AND U.AGE > 20
| true |
183b640c801ed9a9771fab4aef7819568a00efe6 | SQL | andsmi97/OnlineCinema-backend | /postgres/tables/OnlineCinema.sql | UTF-8 | 20,824 | 3.78125 | 4 | [] | no_license | /*==============================================================*/
/* DBMS name: PostgreSQL 9.x */
/* Created on: 01.04.2019 16:12:55 */
/*==============================================================*/
/*==============================================================*/
/* Table: CopyrightOwners */
/*==============================================================*/
create table CopyrightOwners
(
CopyrightOwnerID SERIAL not null,
CopyrightOwnerName VARCHAR(255) null,
CopyrightOwnerAccount VARCHAR(30) null,
constraint PK_COPYRIGHTOWNERS primary key (CopyrightOwnerID),
constraint AK_KEY_2_COPYRIGH unique (CopyrightOwnerName)
);
/*==============================================================*/
/* Table: Films */
/*==============================================================*/
create table Films
(
FilmID SERIAL not null,
FilmName VARCHAR(255) not null,
FilmReleaseDate DATE null,
FilmAgeRestriction INT2 null,
FilmLength INT4 null,
FilmLink TEXT null default 'Films/NoFilmYet.avi',
FilmPrice FLOAT8 null default 99
constraint CKC_FILMPRICE_FILMS check (FilmPrice is null or (FilmPrice between 0 and 2000)),
FilmPosterLink TEXT null default 'img/NoPosterYet.jpg',
FilmDescription TEXT null,
FilmBudget FLOAT8 null,
FilmViews INT8 null default 0
constraint CKC_FILMVIEWS_FILMS check (FilmViews is null or (FilmViews >= 0)),
CopyrightOwnerID INT4 null,
FilmMonltyViews INT4 null,
constraint PK_FILMS primary key (FilmID),
constraint FK_FILMS_FILMSCOPY_COPYRIGH foreign key (CopyrightOwnerID)
references CopyrightOwners (CopyrightOwnerID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Table: Countries */
/*==============================================================*/
create table Countries
(
CountryID SERIAL not null,
CountryName VARCHAR(60) not null,
constraint PK_COUNTRIES primary key (CountryID)
);
/*==============================================================*/
/* Table: Cities */
/*==============================================================*/
create table Cities
(
CityID SERIAL not null,
CountryID INT4 not null,
CityName VARCHAR(255) not null,
constraint PK_CITIES primary key (CityID),
constraint FK_CITIES_RELATIONS_COUNTRIE foreign key (CountryID)
references Countries (CountryID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Table: People */
/*==============================================================*/
create table People
(
PersonID SERIAL not null,
CityID INT4 null,
PersonName VARCHAR(255) not null,
PersonBirthday DATE null,
PersonAvatar TEXT null default 'img/NoAvatarYet.jpg',
PersonFacts TEXT null,
constraint PK_PEOPLE primary key (PersonID),
constraint FK_PEOPLE_RELATIONS_CITIES foreign key (CityID)
references Cities (CityID)
on delete set null on update cascade
);
/*==============================================================*/
/* Table: Awards */
/*==============================================================*/
create table Awards
(
AwardID SERIAL not null,
AwardName VARCHAR(255) not null,
AwardCategory VARCHAR(255) not null,
AwardYear DATE not null,
FilmID INT4 null,
PersonID INT4 null,
constraint PK_AWARDS primary key (AwardID),
constraint FK_AWARDS_REFERENCE_FILMS foreign key (FilmID)
references Films (FilmID),
constraint FK_AWARDS_REFERENCE_PEOPLE foreign key (PersonID)
references People (PersonID)
);
/*==============================================================*/
/* Index: Relationship_21_FK */
/*==============================================================*/
create index Relationship_21_FK on Cities (
CountryID
);
/*==============================================================*/
/* Index: Films_Name */
/*==============================================================*/
create index Films_Name on Films (
FilmName
);
/*==============================================================*/
/* Index: Films_Length */
/*==============================================================*/
create index Films_Length on Films (
FilmLength
);
/*==============================================================*/
/* Index: Films_Price */
/*==============================================================*/
create index Films_Price on Films (
FilmPrice
);
/*==============================================================*/
/* Table: FilmsActors */
/*==============================================================*/
create table FilmsActors
(
FilmID INT4 not null,
PersonID INT4 not null,
Role VARCHAR(255) null,
constraint PK_FILMSACTORS primary key (FilmID, PersonID),
constraint FK_FILMSACT_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSACT_RELATIONS_PEOPLE foreign key (PersonID)
references People (PersonID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_1_FK */
/*==============================================================*/
create index Relationship_1_FK on FilmsActors (
FilmID
);
/*==============================================================*/
/* Index: Relationship_7_FK */
/*==============================================================*/
create index Relationship_7_FK on FilmsActors (
PersonID
);
/*==============================================================*/
/* Table: FilmsComposers */
/*==============================================================*/
create table FilmsComposers
(
FilmID INT4 not null,
PersonID INT4 not null,
constraint PK_FILMSCOMPOSERS primary key (FilmID, PersonID),
constraint FK_FILMSCOM_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSCOM_RELATIONS_PEOPLE foreign key (PersonID)
references People (PersonID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_5_FK */
/*==============================================================*/
create index Relationship_5_FK on FilmsComposers (
FilmID
);
/*==============================================================*/
/* Index: Relationship_11_FK */
/*==============================================================*/
create index Relationship_11_FK on FilmsComposers (
PersonID
);
/*==============================================================*/
/* Table: FilmsCountries */
/*==============================================================*/
create table FilmsCountries
(
FilmID INT4 not null,
CountryID INT4 not null,
constraint PK_FILMSCOUNTRIES primary key (FilmID, CountryID),
constraint FK_FILMSCOU_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSCOU_RELATIONS_COUNTRIE foreign key (CountryID)
references Countries (CountryID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_13_FK */
/*==============================================================*/
create index Relationship_13_FK on FilmsCountries (
FilmID
);
/*==============================================================*/
/* Index: Relationship_14_FK */
/*==============================================================*/
create index Relationship_14_FK on FilmsCountries (
CountryID
);
/*==============================================================*/
/* Table: FilmsDesigners */
/*==============================================================*/
create table FilmsDesigners
(
FilmID INT4 not null,
PersonID INT4 not null,
constraint PK_FILMSDESIGNERS primary key (FilmID, PersonID),
constraint FK_FILMSDES_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSDES_RELATIONS_PEOPLE foreign key (PersonID)
references People (PersonID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_6_FK */
/*==============================================================*/
create index Relationship_6_FK on FilmsDesigners (
FilmID
);
/*==============================================================*/
/* Index: Relationship_12_FK */
/*==============================================================*/
create index Relationship_12_FK on FilmsDesigners (
PersonID
);
/*==============================================================*/
/* Table: FilmsDirectors */
/*==============================================================*/
create table FilmsDirectors
(
FilmID INT4 not null,
PersonID INT4 not null,
constraint PK_FILMSDIRECTORS primary key (FilmID, PersonID),
constraint FK_FILMSDIR_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSDIR_RELATIONS_PEOPLE foreign key (PersonID)
references People (PersonID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_2_FK */
/*==============================================================*/
create index Relationship_2_FK on FilmsDirectors (
FilmID
);
/*==============================================================*/
/* Index: Relationship_8_FK */
/*==============================================================*/
create index Relationship_8_FK on FilmsDirectors (
PersonID
);
/*==============================================================*/
/* Table: Genres */
/*==============================================================*/
create table Genres
(
GenreID SERIAL not null,
GenreName VARCHAR(255) not null,
constraint PK_GENRES primary key (GenreID)
);
/*==============================================================*/
/* Table: FilmsGenres */
/*==============================================================*/
create table FilmsGenres
(
FilmID INT4 not null,
GenreID INT4 not null,
constraint PK_FILMSGENRES primary key (FilmID, GenreID),
constraint FK_FILMSGEN_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSGEN_RELATIONS_GENRES foreign key (GenreID)
references Genres (GenreID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_15_FK */
/*==============================================================*/
create index Relationship_15_FK on FilmsGenres (
FilmID
);
/*==============================================================*/
/* Index: Relationship_16_FK */
/*==============================================================*/
create index Relationship_16_FK on FilmsGenres (
GenreID
);
/*==============================================================*/
/* Table: FilmsProducers */
/*==============================================================*/
create table FilmsProducers
(
FilmID INT4 not null,
PersonID INT4 not null,
constraint PK_FILMSPRODUCERS primary key (FilmID, PersonID),
constraint FK_FILMSPRO_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSPRO_RELATIONS_PEOPLE foreign key (PersonID)
references People (PersonID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_4_FK */
/*==============================================================*/
create index Relationship_4_FK on FilmsProducers (
FilmID
);
/*==============================================================*/
/* Index: Relationship_10_FK */
/*==============================================================*/
create index Relationship_10_FK on FilmsProducers (
PersonID
);
/*==============================================================*/
/* Table: FilmsScriptwriters */
/*==============================================================*/
create table FilmsScriptwriters
(
FilmID INT4 not null,
PersonID INT4 not null,
constraint PK_FILMSSCRIPTWRITERS primary key (FilmID, PersonID),
constraint FK_FILMSSCR_RELATIONS_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_FILMSSCR_RELATIONS_PEOPLE foreign key (PersonID)
references People (PersonID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_3_FK */
/*==============================================================*/
create index Relationship_3_FK on FilmsScriptwriters (
FilmID
);
/*==============================================================*/
/* Index: Relationship_9_FK */
/*==============================================================*/
create index Relationship_9_FK on FilmsScriptwriters (
PersonID
);
/*==============================================================*/
/* Index: Relationship_22_FK */
/*==============================================================*/
create index Relationship_22_FK on People (
CityID
);
/*==============================================================*/
/* Table: Settlements */
/*==============================================================*/
create table Settlements
(
SettlementID SERIAL not null,
SettlementDate DATE null,
constraint PK_SETTLEMENTS primary key (SettlementID)
);
/*==============================================================*/
/* Table: SettlementsCopyrightowners */
/*==============================================================*/
create table SettlementsCopyrightowners
(
SettlementID INT4 not null,
CopyrightOwnerID INT4 not null,
Amount FLOAT8 not null,
constraint PK_SETTLEMENTSCOPYRIGHTOWNERS primary key (SettlementID, CopyrightOwnerID),
constraint FK_SETTLEME_REFERENCE_SETTLEME foreign key (SettlementID)
references Settlements (SettlementID),
constraint FK_SETTLEME_REFERENCE_COPYRIGH foreign key (CopyrightOwnerID)
references CopyrightOwners (CopyrightOwnerID)
);
/*==============================================================*/
/* Table: Users */
/*==============================================================*/
create table Users
(
UserID SERIAL not null,
UserName VARCHAR(255) not null,
UserStatus VARCHAR(30) not null default 'Inactive'
constraint CKC_USERSTATUS_USERS check (UserStatus in ('Inactive','Basic','Standard','Premium')),
UserMoney FLOAT8 not null default 0,
UserStatusDueDate DATE null,
UserEmail VARCHAR(255) not null,
UserPassword VARCHAR(255) not null,
UserSpent FLOAT8 null default 0,
constraint PK_USERS primary key (UserID)
);
/*==============================================================*/
/* Table: UserPayments */
/*==============================================================*/
create table UserPayments (
UserPaymentID SERIAL not null,
UserID INT4 null,
Amount FLOAT8 null,
PaymentDate DATE null,
constraint PK_USERPAYMENTS primary key (UserPaymentID),
constraint FK_USERPAYM_REFERENCE_USERS foreign key (UserID)
references Users (UserID)
on delete restrict on
update restrict
);
/*==============================================================*/
/* Index: Users_Email */
/*==============================================================*/
create unique index Users_Email on Users (
UserEmail
);
/*==============================================================*/
/* Table: UsersBenchmarks */
/*==============================================================*/
create table UsersBenchmarks
(
UserBenchmarkID SERIAL not null,
UserID INT4 null,
UserBenchmarkName VARCHAR(100) null,
UserBenchmarkDate DATE null,
constraint PK_USERSBENCHMARKS primary key (UserBenchmarkID),
constraint FK_USERSBEN_REFERENCE_USERS foreign key (UserID)
references Users (UserID)
);
/*==============================================================*/
/* Table: UsersFilmsLibrary */
/*==============================================================*/
create table UsersFilmsLibrary
(
FilmID INT4 not null,
UserID INT4 not null,
DateAdd DATE not null,
DateRemove DATE null,
constraint PK_USERSFILMSLIBRARY primary key (FilmID, UserID),
constraint FK_USERSFIL_USERSFILM_FILMS_1 foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade,
constraint FK_USERSFIL_USERSFILM_USERS_1 foreign key (UserID)
references Users (UserID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_18_FK */
/*==============================================================*/
create index Relationship_18_FK on UsersFilmsLibrary (
FilmID
);
/*==============================================================*/
/* Index: Relationship_20_FK */
/*==============================================================*/
create index Relationship_20_FK on UsersFilmsLibrary (
UserID
);
/*==============================================================*/
/* Table: UsersFilmsRatings */
/*==============================================================*/
create table UsersFilmsRatings
(
UserID INT4 not null,
FilmID INT4 not null,
Rating INT2 not null,
constraint PK_USERSFILMSRATINGS primary key (UserID, FilmID),
constraint FK_USERSFIL_USERSFILM_USERS foreign key (UserID)
references Users (UserID)
on delete cascade on update cascade,
constraint FK_USERSFIL_USERSFILM_FILMS foreign key (FilmID)
references Films (FilmID)
on delete cascade on update cascade
);
/*==============================================================*/
/* Index: Relationship_17_FK */
/*==============================================================*/
create index Relationship_17_FK on UsersFilmsRatings (
UserID
);
/*==============================================================*/
/* Index: Relationship_19_FK */
/*==============================================================*/
create index Relationship_19_FK on UsersFilmsRatings (
FilmID
);
| true |
57022e25bd84c52f4d8f77bfe648b24f8dd0ccf2 | SQL | alexpinheiropf/college-project-e-commerce-database-PL-SQL- | /e-commerce/Functions.sql | UTF-8 | 2,450 | 4.34375 | 4 | [] | no_license | --Functions
--a. Retornar o estoque atual de determinado produto (código do produto) e disparar uma exceção caso este produto esteja descontinuado;
CREATE OR REPLACE FUNCTION estoque_produto (in_cod_produto IN Number)
return integer
AS
-- Declaracao de variavel
v_status Number;
v_estoque integer;
BEGIN
-- Codigo PL/SQL
-- Setando os valores para dentro das variáveis
Select status Into v_status from produto
where cod_produto = in_cod_produto;
--Primeira verificação
if v_status = 0 THEN
raise_application_error(-20000,'Produto Descontinuado');
end if;
--Select do que o relatorio esta pedindo incluindo nas variaveis
select e.quantidade into v_estoque
from estoque e, produto p
where p.cod_produto = e.cod_produto
AND p.cod_produto = in_cod_produto;
return v_estoque;
END;
--Chamar a function estoque_produto
select estoque_produto(2) from dual;
-- b. Retornar a soma de todos os estoques de produtos de determinada categoria (código da categoria);
CREATE OR REPLACE FUNCTION soma_estoque_produto (in_cod_categoria IN Number)
return number
AS
-- Declaracao de variavel
v_quantidade number;
BEGIN
-- Codigo PL/SQL
--Select do que o relatorio esta pedindo incluindo nas variaveis
select sum(e.quantidade) into v_quantidade
from estoque e, produto p, categoria c
where p.cod_produto = e.cod_produto
AND c.cod_categoria = p.cod_categoria
AND c.cod_categoria = in_cod_categoria;
return v_quantidade;
END;
--Chamar a function soma_estoque_produto
select soma_estoque_produto(3) from dual;
-- c. Retornar o total de produtos enviados, mas ainda não entregues para determinado período de envio. Caso o período de envio seja maior que a data atual (SYSDATE), disparar uma exceção.
CREATE OR REPLACE FUNCTION total_produtos_enviados(in_cod_pedido IN NUMBER)
RETURN NUMBER
AS
v_data_atual DATE DEFAULT SYSDATE;
v_data_envio DATE;
v_quantidade NUMBER;
BEGIN
select data_envio into v_data_envio from pedido
where cod_pedido = in_cod_pedido;
if v_data_envio > v_data_atual THEN
raise_application_error(-20000,'Data do Envio Maior que data atual');
end if;
select pp.quantidade into v_quantidade
from produto_pedido pp, produto pr, pedido p
where pp.cod_produto = pr.cod_produto
AND pp.cod_pedido = p.cod_pedido
AND p.cod_pedido = in_cod_pedido;
return v_quantidade;
END;
--Chamar a function total_produtos_enviados
SELECT total_produtos_enviados(27) FROM DUAL; | true |
10db03380b46eeedbfa9e60da9c571dda23c51f8 | SQL | syedmeesamali/Python | /4_Misc/2_SQL/createnewdb.sql | UTF-8 | 557 | 2.78125 | 3 | [] | no_license |
CREATE TABLE passengers(
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
flight_id INTEGER REFERENCES flights2
);
INSERT INTO passengers (name, flight_id) VALUES ('Alice', 1);
INSERT INTO passengers (name, flight_id) VALUES ('Bob', 1);
INSERT INTO passengers (name, flight_id) VALUES ('Maria', 2);
INSERT INTO passengers (name, flight_id) VALUES ('Charlie', 2);
INSERT INTO passengers (name, flight_id) VALUES ('Dave', 4);
INSERT INTO passengers (name, flight_id) VALUES ('Jen', 6);
INSERT INTO passengers (name, flight_id) VALUES ('Ali', 4); | true |
6a2d0c520def6327ed04c8463490501755e4aa1c | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day09/select0239.sql | UTF-8 | 191 | 2.6875 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-08T02:39:00Z' AND timestamp<'2017-11-09T02:39:00Z' AND SENSOR_ID='990c19e0_2c27_4af3_bada_a8a7ecaf3584'
| true |
f08e4dac97363b4b32ae9a91da3efafd75eb35cb | SQL | Casorey/tp-cuatri-pasado | /gdd-factura2-main/TP2C2020 K3522 FACTURA2/data/script_creacion_inicial.sql | UTF-8 | 23,757 | 2.96875 | 3 | [] | no_license |
--Borrar todo si existe, para volver a crearlo.
IF EXISTS (SELECT SCHEMA_ID FROM sys.schemas WHERE [name] = 'GDD2020')
BEGIN
PRINT('ESQUEMA EXISTENTE, eliminando...');
PRINT('ELIMINANDO CONSTRAINTS');
-- 28 CONSTRAINTS
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_COMPRA_NRO_ITEM') )
ALTER TABLE [GDD2020].ITEM_COMPRA DROP CONSTRAINT FK_COMPRA_NRO_ITEM
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_CLIENTE_CODIGO_ITEM_FACTURA') )
ALTER TABLE [GDD2020].ITEM_FACTURA DROP CONSTRAINT FK_CLIENTE_CODIGO_ITEM_FACTURA
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FACTURA_NRO_ITEM') )
ALTER TABLE [GDD2020].ITEM_FACTURA DROP CONSTRAINT FK_FACTURA_NRO_ITEM
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_SUCURSAL_CODIGO_COMPRA') )
ALTER TABLE [GDD2020].COMPRA DROP CONSTRAINT FK_SUCURSAL_CODIGO_COMPRA
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_CLIENTE_CODIGO_COMPRA') )
ALTER TABLE [GDD2020].COMPRA DROP CONSTRAINT FK_CLIENTE_CODIGO_COMPRA
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_SUCURSAL_CODIGO_FACTURACION') )
ALTER TABLE [GDD2020].FACTURACION DROP CONSTRAINT FK_SUCURSAL_CODIGO_FACTURACION
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_MODELO_CODIGO_COMPRA_AUTOPARTE') )
ALTER TABLE [GDD2020].COMPRA_AUTOPARTE DROP CONSTRAINT FK_MODELO_CODIGO_COMPRA_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FABRICANTE_CODIGO_COMPRA_AUTOPARTE') )
ALTER TABLE [GDD2020].COMPRA_AUTOPARTE DROP CONSTRAINT FK_FABRICANTE_CODIGO_COMPRA_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_SUCURSAL_CODIGO_COMPRA_AUTOPARTE') )
ALTER TABLE [GDD2020].COMPRA_AUTOPARTE DROP CONSTRAINT FK_SUCURSAL_CODIGO_COMPRA_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_COMPRA_NRO_COMRPA_AUTOPARTE') )
ALTER TABLE [GDD2020].COMPRA_AUTOPARTE DROP CONSTRAINT FK_COMPRA_NRO_COMRPA_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_SUCURSAL_CODIGO_FAC_AUTOPARTE') )
ALTER TABLE [GDD2020].FACTURA_AUTOPARTE DROP CONSTRAINT FK_SUCURSAL_CODIGO_FAC_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FACTURA_NRO_AUTOPARTE') )
ALTER TABLE [GDD2020].FACTURA_AUTOPARTE DROP CONSTRAINT FK_FACTURA_NRO_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_CODIGO_COMPRA_AUTOPARTE') )
ALTER TABLE [GDD2020].AUTOPARTE DROP CONSTRAINT FK_CODIGO_COMPRA_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FAC_AUTOPARTE_CODIGO') )
ALTER TABLE [GDD2020].AUTOPARTE DROP CONSTRAINT FK_FAC_AUTOPARTE_CODIGO
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_MODELO_CODIGO_AUTOPARTE') )
ALTER TABLE [GDD2020].AUTOPARTE DROP CONSTRAINT FK_MODELO_CODIGO_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FABRICANTE_CODIGO_AUTOPARTE') )
ALTER TABLE [GDD2020].AUTOPARTE DROP CONSTRAINT FK_FABRICANTE_CODIGO_AUTOPARTE
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_AUTO_PARTE_CODIGO_CAJA') )
ALTER TABLE [GDD2020].CAJA DROP CONSTRAINT FK_AUTO_PARTE_CODIGO_CAJA
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_AUTO_PARTE_CODIGO_MOTOR') )
ALTER TABLE [GDD2020].MOTOR DROP CONSTRAINT FK_AUTO_PARTE_CODIGO_MOTOR
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_AUTO_PARTE_CODIGO_TRANSMISION') )
ALTER TABLE [GDD2020].TRANSMISION DROP CONSTRAINT FK_AUTO_PARTE_CODIGO_TRANSMISION
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_MODELO_CODIGO_AUTOMOVIL') )
ALTER TABLE [GDD2020].AUTOMOVIL DROP CONSTRAINT FK_MODELO_CODIGO_AUTOMOVIL
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FABRICANTE_CODIGO_AUTOMOVIL') )
ALTER TABLE [GDD2020].AUTOMOVIL DROP CONSTRAINT FK_FABRICANTE_CODIGO_AUTOMOVIL
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_TIPO_AUTO_CODIGO') )
ALTER TABLE [GDD2020].AUTOMOVIL DROP CONSTRAINT FK_TIPO_AUTO_CODIGO
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_AUTO_PATENTE_COMPRA_AUTO') )
ALTER TABLE [GDD2020].COMPRA_AUTOMOVIL DROP CONSTRAINT FK_AUTO_PATENTE_COMPRA_AUTO
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_SUCURSAL_CODIGO_COMPRA_AUTOMOVIL') )
ALTER TABLE [GDD2020].COMPRA_AUTOMOVIL DROP CONSTRAINT FK_SUCURSAL_CODIGO_COMPRA_AUTOMOVIL
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_COMPRA_NRO_COMPRA_AUTOMOVIL') )
ALTER TABLE [GDD2020].COMPRA_AUTOMOVIL DROP CONSTRAINT FK_COMPRA_NRO_COMPRA_AUTOMOVIL
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_AUTO_PATENTE_FACTURA_AUTO') )
ALTER TABLE [GDD2020].FACTURA_AUTO DROP CONSTRAINT FK_AUTO_PATENTE_FACTURA_AUTO
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FACTURA_NRO_AUTO') )
ALTER TABLE [GDD2020].FACTURA_AUTO DROP CONSTRAINT FK_FACTURA_NRO_AUTO
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FAC_AUTOPARTE_CODIGO_FXA') )
ALTER TABLE [GDD2020].FACTURA_AUTOPARTE_X_AUTOPARTE DROP CONSTRAINT FK_FAC_AUTOPARTE_CODIGO_FXA
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_FAC_AUTOPARTE_CODIGO_FXA') )
ALTER TABLE [GDD2020].FACTURA_AUTOPARTE_X_AUTOPARTE DROP CONSTRAINT FK_FAC_AUTOPARTE_CODIGO_FXA
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_AUTO_PARTE_CODIGO_CXA') )
ALTER TABLE [GDD2020].COMPRA_AUTOPARTE_X_AUTOPARTE DROP CONSTRAINT FK_AUTO_PARTE_CODIGO_CXA
IF EXISTS ( SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[GDD2020].FK_CODIGO_COMPRA_AUTOPARTE_CXA') )
ALTER TABLE [GDD2020].COMPRA_AUTOPARTE_X_AUTOPARTE DROP CONSTRAINT FK_CODIGO_COMPRA_AUTOPARTE_CXA
-- 17 TABLAS
IF OBJECT_ID('[GDD2020].[CLIENTE]', 'U') IS NOT NULL
DROP TABLE [GDD2020].[CLIENTE]
IF OBJECT_ID('[GDD2020].[TIPOAUTO]', 'U') IS NOT NULL
DROP TABLE [GDD2020].[TIPOAUTO]
IF OBJECT_ID('[GDD2020].[SUCURSAL]', 'U') IS NOT NULL
DROP TABLE [GDD2020].[SUCURSAL]
IF OBJECT_ID('[GDD2020].[COMPRA]', 'U') IS NOT NULL
DROP TABLE [GDD2020].COMPRA
IF OBJECT_ID('[GDD2020].[ITEM_COMPRA]', 'U') IS NOT NULL
DROP TABLE [GDD2020].ITEM_COMPRA
IF OBJECT_ID('[GDD2020].[FACTURACION]', 'U') IS NOT NULL
DROP TABLE [GDD2020].FACTURACION
IF OBJECT_ID('[GDD2020].[ITEM_FACTURA]', 'U') IS NOT NULL
DROP TABLE [GDD2020].ITEM_FACTURA
IF OBJECT_ID('[GDD2020].[MODELO]', 'U') IS NOT NULL
DROP TABLE [GDD2020].[MODELO]
IF OBJECT_ID('[GDD2020].[FABRICANTE]', 'U') IS NOT NULL
DROP TABLE [GDD2020].[FABRICANTE]
IF OBJECT_ID('[GDD2020].[COMPRA_AUTOPARTE]', 'U') IS NOT NULL
DROP TABLE [GDD2020].COMPRA_AUTOPARTE
IF OBJECT_ID('[GDD2020].[FACTURA_AUTOPARTE]', 'U') IS NOT NULL
DROP TABLE [GDD2020].FACTURA_AUTOPARTE
IF OBJECT_ID('[GDD2020].[FACTURA_AUTOPARTE_X_AUTOPARTE]','U') IS NOT NULL
DROP TABLE [GDD2020].FACTURA_AUTOPARTE_X_AUTOPARTE
IF OBJECT_ID('[GDD2020].[COMPRA_AUTOPARTE_X_AUTOPARTE]','U') IS NOT NULL
DROP TABLE [GDD2020].COMPRA_AUTOPARTE_X_AUTOPARTE
IF OBJECT_ID('[GDD2020].[AUTOPARTE]', 'U') IS NOT NULL
DROP TABLE [GDD2020].AUTOPARTE
IF OBJECT_ID('[GDD2020].[CAJA]', 'U') IS NOT NULL
DROP TABLE [GDD2020].CAJA
IF OBJECT_ID('[GDD2020].[MOTOR]', 'U') IS NOT NULL
DROP TABLE [GDD2020].MOTOR
IF OBJECT_ID('[GDD2020].[TRANSMISION]', 'U') IS NOT NULL
DROP TABLE [GDD2020].TRANSMISION
IF OBJECT_ID('[GDD2020].[AUTOMOVIL]', 'U') IS NOT NULL
DROP TABLE [GDD2020].AUTOMOVIL
IF OBJECT_ID('[GDD2020].[COMPRA_AUTOMOVIL]', 'U') IS NOT NULL
DROP TABLE [GDD2020].COMPRA_AUTOMOVIL
IF OBJECT_ID('[GDD2020].[FACTURA_AUTO]', 'U') IS NOT NULL
DROP TABLE [GDD2020].FACTURA_AUTO
IF OBJECT_ID('[GDD2020].[USUARIO]', 'U') IS NOT NULL
DROP TABLE [GDD2020].USUARIO
DROP SCHEMA GDD2020
END
--Crear el esquema
EXEC('CREATE SCHEMA GDD2020 AUTHORIZATION dbo');
--Crear tablas
CREATE TABLE [GDD2020].[CLIENTE](
[CLIENTE_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[CLIENTE_DNI] [decimal](18, 0),
[CLIENTE_APELLIDO] [nvarchar](255),
[CLIENTE_NOMBRE] [nvarchar](255),
[CLIENTE_DIRECCION] [nvarchar](255) NULL,
[CLIENTE_FECHA_NAC] [datetime2](3) NULL,
[CLIENTE_MAIL] [nvarchar](255) NULL
) ON [PRIMARY] -- insertado
CREATE TABLE [GDD2020].[TIPOAUTO](
[TIPO_AUTO_CODIGO] [decimal](18, 0) PRIMARY KEY,
[TIPO_AUTO_DESC] [nvarchar](255) NULL
) ON [PRIMARY] -- insertado
CREATE TABLE [GDD2020].[SUCURSAL](
[SUCURSAL_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[SUCURSAL_DIRECCION] [nvarchar](255) NULL, --TODO VER LOS NULL
[SUCURSAL_MAIL] [nvarchar](255) NULL,
[SUCURSAL_TELEFONO] [decimal](18, 0) NULL,
[SUCURSAL_CIUDAD] [nvarchar](255) NULL
) ON [PRIMARY] -- insertado
CREATE TABLE [GDD2020].[COMPRA](
[COMPRA_NRO] [decimal](18, 0) PRIMARY KEY,
[SUCURSAL_CODIGO] BIGINT,
[COMPRA_FECHA] [datetime2](3) NULL,
[CLIENTE_CODIGO] BIGINT,
CONSTRAINT FK_SUCURSAL_CODIGO_COMPRA FOREIGN KEY (SUCURSAL_CODIGO) REFERENCES [GDD2020].[SUCURSAL](SUCURSAL_CODIGO),
CONSTRAINT FK_CLIENTE_CODIGO_COMPRA FOREIGN KEY (CLIENTE_CODIGO) REFERENCES [GDD2020].[CLIENTE](CLIENTE_CODIGO)
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[ITEM_COMPRA](
[ITEM_COMPRA_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[COMPRA_PRECIO] [decimal](18, 2) NULL,
[COMPRA_CANT] [decimal](18, 0) NULL,
[COMPRA_NRO] [decimal](18, 0) NOT NULL,
CONSTRAINT FK_COMPRA_NRO_ITEM FOREIGN KEY (COMPRA_NRO) REFERENCES [GDD2020].[COMPRA](COMPRA_NRO)
) ON [PRIMARY] --todo agregar esto al script inicial para elminar. e insertar
CREATE TABLE [GDD2020].[FACTURACION](
[FACTURA_NRO] [decimal](18, 0) PRIMARY KEY,
[SUCURSAL_CODIGO] BIGINT,
[PRECIO_FACTURADO] [decimal](18, 2) NULL,
[FACTURA_FECHA] [datetime2](3) NULL,
CONSTRAINT FK_SUCURSAL_CODIGO_FACTURACION FOREIGN KEY (SUCURSAL_CODIGO) REFERENCES [GDD2020].[SUCURSAL](SUCURSAL_CODIGO)
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[ITEM_FACTURA](
[FACTURA_ITEM_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[CLIENTE_CODIGO] BIGINT,
[FACTURA_NRO] [decimal](18, 0),
CONSTRAINT FK_CLIENTE_CODIGO_ITEM_FACTURA FOREIGN KEY (CLIENTE_CODIGO) REFERENCES [GDD2020].[CLIENTE](CLIENTE_CODIGO),
CONSTRAINT FK_FACTURA_NRO_ITEM FOREIGN KEY (FACTURA_NRO) REFERENCES [GDD2020].[FACTURACION](FACTURA_NRO)
) ON [PRIMARY] --todo agregar esto al script inicial para elminar. e insertar
CREATE TABLE [GDD2020].[MODELO](
[MODELO_CODIGO] [decimal](18, 0) PRIMARY KEY,
[MODELO_NOMBRE] [nvarchar](255) ,
[MODELO_POTENCIA] [decimal](18, 0)
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[FABRICANTE](
[FABRICANTE_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[FABRICANTE_NOMBRE] [nvarchar](255)
) ON [PRIMARY] -- insertado
CREATE TABLE [GDD2020].[COMPRA_AUTOPARTE](
[CODIGO_COMPRA_AUTOPARTE] BIGINT IDENTITY(1,1) PRIMARY KEY,
[COMPRA_NRO] [decimal](18, 0),
CONSTRAINT FK_COMPRA_NRO_COMRPA_AUTOPARTE FOREIGN KEY (COMPRA_NRO) REFERENCES [GDD2020].[COMPRA](COMPRA_NRO)
) ON [PRIMARY] --insert
CREATE TABLE [GDD2020].[FACTURA_AUTOPARTE](
[FAC_AUTOPARTE_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[SUCURSAL_CODIGO] BIGINT,
[CANT_FACTURADA] [decimal](18, 0) NULL,
[FACTURA_NRO] [decimal](18, 0),
CONSTRAINT FK_SUCURSAL_CODIGO_FAC_AUTOPARTE FOREIGN KEY (SUCURSAL_CODIGO) REFERENCES [GDD2020].[SUCURSAL](SUCURSAL_CODIGO),
CONSTRAINT FK_FACTURA_NRO_AUTOPARTE FOREIGN KEY (FACTURA_NRO) REFERENCES [GDD2020].[FACTURACION](FACTURA_NRO)
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[AUTOPARTE](
[AUTO_PARTE_CODIGO] [decimal](18, 0) PRIMARY KEY,
[AUTO_PARTE_DESCRIPCION] [nvarchar](255) NULL,
[MODELO_CODIGO] [decimal](18, 0),
[FABRICANTE_CODIGO] BIGINT,
CONSTRAINT FK_MODELO_CODIGO_AUTOPARTE FOREIGN KEY (MODELO_CODIGO) REFERENCES [GDD2020].[MODELO](MODELO_CODIGO),
CONSTRAINT FK_FABRICANTE_CODIGO_AUTOPARTE FOREIGN KEY (FABRICANTE_CODIGO) REFERENCES [GDD2020].[FABRICANTE](FABRICANTE_CODIGO)
) ON [PRIMARY]
CREATE TABLE [GDD2020].[FACTURA_AUTOPARTE_X_AUTOPARTE](
[AUTO_PARTE_CODIGO] [decimal](18, 0) NOT NULL,
[FAC_AUTOPARTE_CODIGO] BIGINT IDENTITY(1,1) NOT NULL,
CONSTRAINT FK_AUTO_PARTE_CODIGO_FXA FOREIGN KEY (AUTO_PARTE_CODIGO) REFERENCES [GDD2020].[AUTOPARTE](AUTO_PARTE_CODIGO),
CONSTRAINT FK_FAC_AUTOPARTE_CODIGO_FXA FOREIGN KEY (FAC_AUTOPARTE_CODIGO) REFERENCES [GDD2020].[FACTURA_AUTOPARTE](FAC_AUTOPARTE_CODIGO),
PRIMARY KEY (AUTO_PARTE_CODIGO,FAC_AUTOPARTE_CODIGO)
) ON [PRIMARY]
CREATE TABLE [GDD2020].[COMPRA_AUTOPARTE_X_AUTOPARTE](
[AUTO_PARTE_CODIGO] [decimal](18, 0) NOT NULL,
[CODIGO_COMPRA_AUTOPARTE] BIGINT NOT NULL,
CONSTRAINT FK_AUTO_PARTE_CODIGO_CXA FOREIGN KEY (AUTO_PARTE_CODIGO) REFERENCES [GDD2020].[AUTOPARTE](AUTO_PARTE_CODIGO),
CONSTRAINT FK_CODIGO_COMPRA_AUTOPARTE_CXA FOREIGN KEY (CODIGO_COMPRA_AUTOPARTE) REFERENCES [GDD2020].[COMPRA_AUTOPARTE](CODIGO_COMPRA_AUTOPARTE),
PRIMARY KEY (AUTO_PARTE_CODIGO,CODIGO_COMPRA_AUTOPARTE)
) ON [PRIMARY]
CREATE TABLE [GDD2020].[CAJA](
[TIPO_CAJA_CODIGO] [decimal](18, 0) PRIMARY KEY,
[TIPO_CAJA_DESC] [nvarchar](255) NULL,
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[MOTOR](
[TIPO_MOTOR_CODIGO] [decimal](18, 0) PRIMARY KEY,
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[TRANSMISION](
[TIPO_TRANSMISION_CODIGO] [decimal](18, 0) PRIMARY KEY,
[TIPO_TRANSMISION_DESC] [nvarchar](255) NULL,
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[AUTOMOVIL](
[AUTO_PATENTE] [nvarchar](50) PRIMARY KEY,
[AUTO_NRO_CHASIS] [nvarchar](50),
[AUTO_NRO_MOTOR] [nvarchar](50),
[AUTO_CANT_KMS] [decimal](18, 0),
[AUTO_FECHA_ALTA] [datetime2](3),
[MODELO_CODIGO] [decimal](18, 0),
[FABRICANTE_CODIGO] BIGINT,
[SUCURSAL_CODIGO] BIGINT,
[TIPO_AUTO_CODIGO] [decimal](18, 0),
CONSTRAINT FK_MODELO_CODIGO_AUTOMOVIL FOREIGN KEY (MODELO_CODIGO) REFERENCES [GDD2020].[MODELO](MODELO_CODIGO),
CONSTRAINT FK_FABRICANTE_CODIGO_AUTOMOVIL FOREIGN KEY (FABRICANTE_CODIGO) REFERENCES [GDD2020].[FABRICANTE](FABRICANTE_CODIGO),
CONSTRAINT FK_TIPO_AUTO_CODIGO FOREIGN KEY (TIPO_AUTO_CODIGO) REFERENCES [GDD2020].[TIPOAUTO](TIPO_AUTO_CODIGO)
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[USUARIO](
[USUARIO_NOMBRE] [nvarchar](20) NOT NULL PRIMARY KEY,
[USUARIO_PASSWORD] BINARY(256) NOT NULL
) ON [PRIMARY] --Este seguro no se use
CREATE TABLE [GDD2020].[COMPRA_AUTOMOVIL](
[COMPRA_AUTOMOVIL_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[AUTO_PATENTE] [nvarchar](50),
[SUCURSAL_CODIGO] BIGINT,
[COMPRA_NRO] [decimal](18, 0),
CONSTRAINT FK_AUTO_PATENTE_COMPRA_AUTO FOREIGN KEY (AUTO_PATENTE) REFERENCES [GDD2020].[AUTOMOVIL](AUTO_PATENTE),
CONSTRAINT FK_SUCURSAL_CODIGO_COMPRA_AUTOMOVIL FOREIGN KEY (SUCURSAL_CODIGO) REFERENCES [GDD2020].[SUCURSAL](SUCURSAL_CODIGO),
CONSTRAINT FK_COMPRA_NRO_COMPRA_AUTOMOVIL FOREIGN KEY (COMPRA_NRO) REFERENCES [GDD2020].[COMPRA](COMPRA_NRO)
) ON [PRIMARY] --insertado
CREATE TABLE [GDD2020].[FACTURA_AUTO](
[FAC_AUTO_CODIGO] BIGINT IDENTITY(1,1) PRIMARY KEY,
[AUTO_PATENTE] [nvarchar](50),
[FACTURA_NRO] [decimal](18, 0),
CONSTRAINT FK_AUTO_PATENTE_FACTURA_AUTO FOREIGN KEY (AUTO_PATENTE) REFERENCES [GDD2020].[AUTOMOVIL](AUTO_PATENTE),
CONSTRAINT FK_FACTURA_NRO_AUTO FOREIGN KEY (FACTURA_NRO) REFERENCES [GDD2020].[FACTURACION](FACTURA_NRO)
) ON [PRIMARY] --insertado
--Migrar datos
--Crear un usuario para la migraci?, no se si lo necesito
--INSERT INTO GDD2020.USUARIO (USUARIO_NOMBRE,USUARIO_PASSWORD) VALUES ('administrador','1234')
--Crear rol
--Asigno rol al usuario
--INSERTAR en las tablas ( INSERT SELECT)
--CLIENTE
INSERT INTO GDD2020.CLIENTE(CLIENTE_DNI,CLIENTE_APELLIDO,CLIENTE_NOMBRE,CLIENTE_DIRECCION,CLIENTE_FECHA_NAC,CLIENTE_MAIL)
SELECT DISTINCT m.CLIENTE_DNI,m.CLIENTE_APELLIDO,m.CLIENTE_NOMBRE,m.CLIENTE_DIRECCION,m.CLIENTE_FECHA_NAC,m.CLIENTE_MAIL
FROM gd_esquema.Maestra m
WHERE CLIENTE_DNI IS NOT NULL
--TIPOAUTO
INSERT INTO GDD2020.TIPOAUTO (TIPO_AUTO_CODIGO,TIPO_AUTO_DESC)
SELECT DISTINCT m.TIPO_AUTO_CODIGO,m.TIPO_AUTO_DESC
FROM gd_esquema.Maestra m
WHERE TIPO_AUTO_CODIGO IS NOT NULL
--SUCURSAL
INSERT INTO GDD2020.SUCURSAL (SUCURSAL_DIRECCION,SUCURSAL_MAIL,SUCURSAL_TELEFONO,SUCURSAL_CIUDAD)
SELECT DISTINCT m.SUCURSAL_DIRECCION,m.SUCURSAL_MAIL,m.SUCURSAL_TELEFONO,m.SUCURSAL_CIUDAD
FROM gd_esquema.Maestra m
WHERE SUCURSAL_DIRECCION IS NOT NULL
--COMPRA | Rompe
INSERT INTO GDD2020.COMPRA(COMPRA_NRO,SUCURSAL_CODIGO,COMPRA_FECHA,CLIENTE_CODIGO)
SELECT DISTINCT m.COMPRA_NRO,su.SUCURSAL_CODIGO,m.COMPRA_FECHA,cli.CLIENTE_CODIGO
FROM gd_esquema.Maestra m
JOIN GDD2020.SUCURSAL su
ON m.SUCURSAL_DIRECCION = su.SUCURSAL_DIRECCION
JOIN GDD2020.CLIENTE cli
ON m.CLIENTE_DNI = cli.CLIENTE_DNI
AND m.CLIENTE_APELLIDO = cli.CLIENTE_APELLIDO
AND m.CLIENTE_NOMBRE = cli.CLIENTE_NOMBRE
AND m.CLIENTE_FECHA_NAC = cli.CLIENTE_FECHA_NAC
AND m.CLIENTE_DIRECCION = cli.CLIENTE_DIRECCION
AND m.CLIENTE_MAIL = cli.CLIENTE_MAIL
WHERE m.COMPRA_NRO IS NOT NULL
--ITEM_COMPRA
INSERT INTO GDD2020.ITEM_COMPRA(COMPRA_PRECIO,COMPRA_NRO,COMPRA_CANT)
SELECT DISTINCT m.COMPRA_PRECIO,com.COMPRA_NRO,m.COMPRA_CANT
FROM gd_esquema.Maestra m
JOIN GDD2020.COMPRA com
ON m.COMPRA_NRO = com.COMPRA_NRO
WHERE m.COMPRA_NRO IS NOT NULL
--FACTURACION
INSERT INTO GDD2020.FACTURACION(FACTURA_NRO,SUCURSAL_CODIGO,PRECIO_FACTURADO,FACTURA_FECHA)
SELECT DISTINCT m.FACTURA_NRO, su.SUCURSAL_CODIGO, SUM(m.PRECIO_FACTURADO),m.FACTURA_FECHA
FROM gd_esquema.Maestra m
JOIN GDD2020.SUCURSAL su
ON m.FAC_SUCURSAL_DIRECCION = su.SUCURSAL_DIRECCION
WHERE FACTURA_NRO IS NOT NULL
GROUP BY m.FACTURA_NRO, su.SUCURSAL_CODIGO,m.FACTURA_FECHA
--ITEM_FACTURA
INSERT INTO GDD2020.ITEM_FACTURA(CLIENTE_CODIGO,FACTURA_NRO)
SELECT DISTINCT cli.CLIENTE_CODIGO,fac.FACTURA_NRO
FROM gd_esquema.Maestra m
JOIN GDD2020.CLIENTE cli
ON m.CLIENTE_DNI = cli.CLIENTE_DNI
AND m.CLIENTE_APELLIDO = cli.CLIENTE_APELLIDO
AND m.CLIENTE_NOMBRE = cli.CLIENTE_NOMBRE
AND m.CLIENTE_FECHA_NAC = cli.CLIENTE_FECHA_NAC
AND m.CLIENTE_DIRECCION = cli.CLIENTE_DIRECCION
AND m.CLIENTE_MAIL = cli.CLIENTE_MAIL
JOIN GDD2020.FACTURACION fac
ON m.FACTURA_NRO = fac.FACTURA_NRO
WHERE m.CANT_FACTURADA IS NOT NULL
--MODELO
INSERT INTO GDD2020.MODELO (MODELO_CODIGO,MODELO_NOMBRE,MODELO_POTENCIA)
SELECT DISTINCT m.MODELO_CODIGO,m.MODELO_NOMBRE,m.MODELO_POTENCIA
FROM gd_esquema.Maestra m
WHERE MODELO_CODIGO IS NOT NULL
--FABRICANTE
INSERT INTO GDD2020.FABRICANTE (FABRICANTE_NOMBRE)
SELECT DISTINCT m.FABRICANTE_NOMBRE
FROM gd_esquema.Maestra m
--COMPRA_AUTOPARTE
INSERT INTO GDD2020.COMPRA_AUTOPARTE(COMPRA_NRO)
SELECT DISTINCT co.COMPRA_NRO
FROM gd_esquema.Maestra m
JOIN GDD2020.COMPRA co ON (m.COMPRA_NRO = co.COMPRA_NRO)
WHERE m.AUTO_PARTE_CODIGO IS NOT NULL
--FACTURA_AUTOPARTE
INSERT INTO GDD2020.FACTURA_AUTOPARTE(SUCURSAL_CODIGO,CANT_FACTURADA,FACTURA_NRO)
SELECT DISTINCT su.SUCURSAL_CODIGO,m.CANT_FACTURADA,fac.FACTURA_NRO
FROM gd_esquema.Maestra m
JOIN GDD2020.SUCURSAL su
ON m.FAC_SUCURSAL_DIRECCION = su.SUCURSAL_DIRECCION
JOIN GDD2020.FACTURACION fac
ON m.FACTURA_NRO = fac.FACTURA_NRO
WHERE m.AUTO_PARTE_CODIGO IS NOT NULL AND m.FACTURA_NRO IS NOT NULL
--AUTOPARTE
INSERT INTO GDD2020.AUTOPARTE (AUTO_PARTE_CODIGO,AUTO_PARTE_DESCRIPCION,MODELO_CODIGO,FABRICANTE_CODIGO)
SELECT DISTINCT m.AUTO_PARTE_CODIGO,m.AUTO_PARTE_DESCRIPCION,mo.MODELO_CODIGO,fab.FABRICANTE_CODIGO
FROM gd_esquema.Maestra m
JOIN GDD2020.MODELO mo
ON m.MODELO_CODIGO = mo.MODELO_CODIGO
JOIN GDD2020.FABRICANTE fab
ON m.FABRICANTE_NOMBRE = fab.FABRICANTE_NOMBRE
WHERE AUTO_PARTE_CODIGO IS NOT NULL
--FACTURA_AUTOPARTE_X_AUTOPARTE
SET IDENTITY_INSERT GDD2020.FACTURA_AUTOPARTE_X_AUTOPARTE ON
INSERT INTO GDD2020.FACTURA_AUTOPARTE_X_AUTOPARTE(AUTO_PARTE_CODIGO,FAC_AUTOPARTE_CODIGO)
SELECT DISTINCT ap.AUTO_PARTE_CODIGO,fa.FAC_AUTOPARTE_CODIGO
FROM gd_esquema.Maestra m
JOIN GDD2020.AUTOPARTE ap ON (ap.AUTO_PARTE_CODIGO = m.AUTO_PARTE_CODIGO)
JOIN GDD2020.FACTURA_AUTOPARTE fa ON (fa.FACTURA_NRO = m.FACTURA_NRO)
WHERE m.AUTO_PARTE_CODIGO IS NOT NULL
SET IDENTITY_INSERT GDD2020.FACTURA_AUTOPARTE_X_AUTOPARTE OFF
--COMPRA_AUTOPARTE_X_AUTOPARTE
INSERT INTO GDD2020.COMPRA_AUTOPARTE_X_AUTOPARTE(AUTO_PARTE_CODIGO,CODIGO_COMPRA_AUTOPARTE)
SELECT DISTINCT ap.AUTO_PARTE_CODIGO,ca.CODIGO_COMPRA_AUTOPARTE
FROM gd_esquema.Maestra m
JOIN GDD2020.AUTOPARTE ap ON (m.AUTO_PARTE_CODIGO = ap.AUTO_PARTE_CODIGO)
JOIN GDD2020.COMPRA_AUTOPARTE ca ON (ca.COMPRA_NRO = m.COMPRA_NRO)
WHERE m.AUTO_PARTE_CODIGO IS NOT NULL
--SELECT DISTINCT m.AUTO_PARTE_CODIGO,m.AUTO_PARTE_DESCRIPCION,ca.CODIGO_COMPRA_AUTOPARTE,fa.FAC_AUTOPARTE_CODIGO,m.MODELO_CODIGO,fab.FABRICANTE_CODIGO
--FROM gd_esquema.Maestra m
--LEFT JOIN GDD2020.COMPRA co ON (m.COMPRA_NRO = co.COMPRA_NRO)
--LEFT JOIN GDD2020.COMPRA_AUTOPARTE ca ON (ca.COMPRA_NRO = co.COMPRA_NRO)
--LEFT JOIN GDD2020.FACTURACION fac ON (fac.FACTURA_NRO = m.FACTURA_NRO)
--LEFT JOIN GDD2020.FACTURA_AUTOPARTE fa ON (fa.FACTURA_NRO = fac.FACTURA_NRO)
--JOIN GDD2020.FABRICANTE fab ON (fab.FABRICANTE_NOMBRE = m.FABRICANTE_NOMBRE)
--WHERE AUTO_PARTE_CODIGO IS NOT NULL
--SELECT COUNT(DISTINCT AUTO_PARTE_CODIGO) cant FROM gd_esquema.Maestra
--WHERE AUTO_PARTE_CODIGO IS NOT NULL
--ORDER BY 1
--SELECT DISTINCT AUTO_PARTE_CODIGO,AUTO_PARTE_DESCRIPCION,COMPRA_NRO,FACTURA_NRO,MODELO_CODIGO,FABRICANTE_NOMBRE
--FROM gd_esquema.Maestra m
--WHERE AUTO_PARTE_CODIGO IS NOT NULL
--CAJA
INSERT INTO GDD2020.CAJA (TIPO_CAJA_CODIGO,TIPO_CAJA_DESC)
SELECT DISTINCT m.TIPO_CAJA_CODIGO,m.TIPO_CAJA_DESC
FROM gd_esquema.Maestra m
WHERE TIPO_CAJA_CODIGO IS NOT NULL
--MOTOR
INSERT INTO GDD2020.MOTOR (TIPO_MOTOR_CODIGO)
SELECT DISTINCT m.TIPO_MOTOR_CODIGO
FROM gd_esquema.Maestra m
WHERE TIPO_MOTOR_CODIGO IS NOT NULL
--TIPO_TRANSMISION
INSERT INTO GDD2020.TRANSMISION(TIPO_TRANSMISION_CODIGO,TIPO_TRANSMISION_DESC)
SELECT DISTINCT m.TIPO_TRANSMISION_CODIGO,m.TIPO_TRANSMISION_DESC
FROM gd_esquema.Maestra m
WHERE TIPO_TRANSMISION_CODIGO IS NOT NULL
--AUTOMOVIL
INSERT INTO GDD2020.AUTOMOVIL(
AUTO_PATENTE,AUTO_NRO_CHASIS,AUTO_NRO_MOTOR,AUTO_FECHA_ALTA,AUTO_CANT_KMS,MODELO_CODIGO,FABRICANTE_CODIGO,TIPO_AUTO_CODIGO)
SELECT DISTINCT m.AUTO_PATENTE,m.AUTO_NRO_CHASIS,m.AUTO_NRO_MOTOR,m.AUTO_FECHA_ALTA,m.AUTO_CANT_KMS,mod.MODELO_CODIGO,fab.FABRICANTE_CODIGO,ta.TIPO_AUTO_CODIGO
FROM gd_esquema.Maestra m
JOIN GDD2020.MODELO mod
ON m.MODELO_CODIGO = mod.MODELO_CODIGO
JOIN GDD2020.FABRICANTE fab
ON m.FABRICANTE_NOMBRE = fab.FABRICANTE_NOMBRE
JOIN GDD2020.TIPOAUTO ta
ON m.TIPO_AUTO_CODIGO = ta.TIPO_AUTO_CODIGO
WHERE AUTO_PATENTE IS NOT NULL
--COMPRA_AUTOMOVIL
INSERT INTO GDD2020.COMPRA_AUTOMOVIL(AUTO_PATENTE,SUCURSAL_CODIGO,COMPRA_NRO)
SELECT DISTINCT au.AUTO_PATENTE,su.SUCURSAL_CODIGO,com.COMPRA_NRO
FROM gd_esquema.Maestra m
JOIN GDD2020.AUTOMOVIL au
ON m.AUTO_PATENTE = au.AUTO_PATENTE
JOIN GDD2020.SUCURSAL su
ON m.SUCURSAL_DIRECCION = su.SUCURSAL_DIRECCION
JOIN GDD2020.COMPRA com
ON m.COMPRA_NRO = com.COMPRA_NRO
WHERE m.AUTO_PATENTE IS NOT NULL AND m.COMPRA_NRO IS NOT NULL
ORDER BY com.COMPRA_NRO
--FACTURA_AUTO
INSERT INTO GDD2020.FACTURA_AUTO(AUTO_PATENTE,FACTURA_NRO)
SELECT DISTINCT au.AUTO_PATENTE,fac.FACTURA_NRO
FROM gd_esquema.Maestra m
JOIN GDD2020.AUTOMOVIL au
ON m.AUTO_PATENTE = au.AUTO_PATENTE
JOIN GDD2020.FACTURACION fac
ON m.FACTURA_NRO = fac.FACTURA_NRO
WHERE m.AUTO_PATENTE IS NOT NULL AND m.FACTURA_NRO IS NOT NULL | true |
21a3189b3f88236f3b83d213e36a42fb89d955a7 | SQL | XiaCodie/vrlv3 | /database/listat_data_schema.sql | UTF-8 | 3,246 | 3.15625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 22.07.2015 klo 12:00
-- Palvelimen versio: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `vrlv3`
--
-- --------------------------------------------------------
--
-- Rakenne taululle `vrlv3_lista_maakunnat`
--
DROP TABLE IF EXISTS `vrlv3_lista_maakunnat`;
CREATE TABLE `vrlv3_lista_maakunnat` (
`id` smallint(2) NOT NULL AUTO_INCREMENT,
`maakunta` tinytext COLLATE utf8_swedish_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=22 ;
--
-- Vedos taulusta `vrlv3_lista_maakunnat`
--
INSERT INTO `vrlv3_lista_maakunnat` (`id`, `maakunta`) VALUES
(0, 'Ei saatavilla'),
(1, 'Ahvenanmaa'),
(2, 'Etelä-Karjala'),
(3, 'Etelä-Pohjanmaa'),
(4, 'Etelä-Savo'),
(5, 'Itä-Uusimaa'),
(6, 'Kainuu'),
(7, 'Kanta-Häme'),
(8, 'Keski-Pohjanmaa'),
(9, 'Keski-Suomi'),
(10, 'Kymenlaakso'),
(11, 'Lappi'),
(12, 'Pirkanmaa'),
(13, 'Pohjanmaa'),
(14, 'Pohjois-Karjala'),
(15, 'Pohjois-Pohjanmaa'),
(16, 'Pohjois-Savo'),
(17, 'Päijät-Häme'),
(18, 'Satakunta'),
(19, 'Uusimaa'),
(20, 'Varsinais-Suomi'),
(21, 'Ulkomaat');
--
-- Rakenne taululle `vrlv3_lista_tallikategoriat`
--
CREATE TABLE IF NOT EXISTS `vrlv3_lista_tallikategoriat` (
`kat` smallint(2) NOT NULL auto_increment,
`kategoria` varchar(20) character set utf8 NOT NULL,
`katelyh` varchar(3) character set utf8 NOT NULL,
`katnro` varchar(4) collate utf8_swedish_ci NOT NULL,
PRIMARY KEY (`kat`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=14 ;
--
-- Vedostetaan dataa taulusta `lista_tallikategoriat`
--
INSERT INTO `vrlv3_lista_tallikategoriat` (`kat`, `kategoria`, `katelyh`, `katnro`) VALUES
(1, 'ratsastuskoulu', 'RK', 'KAT1'),
(2, 'siittola', 'ST', 'KAT2'),
(3, 'kilpailukeskus', 'KK', 'KAT3'),
(4, 'valjakkotalli', 'VT', 'KAT4'),
(5, 'ravitalli', 'RT', 'KAT4'),
(6, 'laukkatalli', 'LK', 'KAT4'),
(7, 'westerntalli', 'WT', 'KAT4'),
(8, 'myyntitalli', 'MT', 'KAT5'),
(9, 'oriasema', 'OA', 'KAT6'),
(10, 'yksityistalli', 'YT', 'KAT7'),
(11, 'muu kilpatalli', 'KT', 'KAT4'),
(12, 'tamma-asema', 'TA', 'KAT6'),
(13, 'harrastetalli', 'HT', 'KAT0');
--
-- Rakenne taululle `vrlv3_lista_tiedotuskategoriat`
--
CREATE TABLE IF NOT EXISTS `vrlv3_lista_tiedotuskategoriat` (
`kid` int(11) NOT NULL AUTO_INCREMENT,
`kategoria` varchar(25) NOT NULL,
PRIMARY KEY (`kid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;
--
-- Vedos taulusta `vrlv3_lista_tiedotuskategoriat`
--
INSERT INTO `vrlv3_lista_tiedotuskategoriat` (`kid`, `kategoria`) VALUES
(1, 'VVJ'),
(2, 'kilpailut'),
(3, 'kasvattajanimet'),
(4, 'kantakirjat'),
(5, 'sivusto'),
(6, 'rotuyhdistykset'),
(7, 'ERJ'),
(8, 'Vippos'),
(9, 'KERJ'),
(10, 'VRL-tunnukset'),
(11, 'seurat'),
(12, 'KRJ'),
(13, 'tallit'),
(14, 'VMJ'),
(15, 'PKK'),
(16, 'laatuarvostelut'),
(17, 'työpaikat'),
(18, 'ranking'),
(19, 'porrastetut kilpailut'),
(20, 'rekisteri'),
(21, 'kasvattajaklubi'),
(22, 'ARJ'),
(23, 'opisto'),
(24, 'WRJ'),
(25, 'hallitus'),
(26, 'näyttelyt'),
(27, 'hevosrekisteri'),
(28, 'VRL'),
(29, 'adoptointi');
| true |
c6524021f80d8897471f5f1d2e64dffb09c959db | SQL | radtek/Database-3 | /oracle/admin/scripts/dbs_stats_delete.sql | UTF-8 | 352 | 3.046875 | 3 | [] | no_license | set feed on
set timing on
delete from dbadmin.dbs_stale_stats a
where job_id = &job_id
and table_name in ('SM_AVERAGE','SM_ACCOUNT_MOVEMENTS')
and inserts=0 and deletes=0 and updates=0 and truncated='YES'
and not exists (select 1 from dbadmin.dbs_stats_queue_details where job_id=a.job_id and stale_id=a.stale_id)
/
commit;
set timing off | true |
f47ed2896de2b047b2f90fd130552e8782c4d8a6 | SQL | derickgroves/sql-scratch-capstone-turn-in | /Derick Groves SQL/code.sql | UTF-8 | 2,118 | 3.859375 | 4 | [] | no_license | select *
from survey
limit 10;
select question, count(question) as responses
from survey
group by 1;
select *
from quiz
limit 5;
select *
from home_try_on
limit 5;
select *
from purchase
limit 5;
with funnel as(select q.user_id,
case
when h.user_id not null then 'TRUE'
else 'FALSE'
end as is_home_try_on,
h.number_of_pairs,
case
when p.user_id not null then 'TRUE'
else 'FALSE'
end as is_purchase
from quiz as 'q'
left join home_try_on as 'h'
on q.user_id = h.user_id
left join purchase as 'p'
on h.user_id = p.user_id)
select *
from funnel
limit 10;
with funnel as(select q.user_id,
case
when h.user_id not null then 'TRUE'
else 'FALSE'
end as is_home_try_on,
h.number_of_pairs,
case
when p.user_id not null then 'TRUE'
else 'FALSE'
end as is_purchase
from quiz as q
left join home_try_on as h
on q.user_id = h.user_id
left join purchase as p
on h.user_id = p.user_id)
select is_home_try_on, is_purchase, count(is_home_try_on) as number
from funnel
group by 1, 2;
with funnel as(select q.user_id,
case
when h.user_id not null then 'TRUE'
else 'FALSE'
end as is_home_try_on,
h.number_of_pairs,
case
when p.user_id not null then 'TRUE'
else 'FALSE'
end as is_purchase
from quiz as q
left join home_try_on as h
on q.user_id = h.user_id
left join purchase as p
on h.user_id = p.user_id)
select is_purchase, number_of_pairs, count(is_purchase) as number
from funnel
where number_of_pairs not null
group by 1, 2;
select style, count(style) as number
from quiz
group by 1;
select product_id, count(product_id) as number
from purchase
group by 1;
select model_name, color, count(*) as number
from purchase
group by 1, 2;
select model_name, count(*) as number
from purchase
group by 1;
select shape, count(*) as number
from quiz
group by 1;
select price, count(*) as cost
from purchase
group by 1;
select fit, count(*) as number
from quiz
group by 1;
select question, response, count(*) as number
from survey
group by 1, 2;
| true |
fb21b7a832ea8a3a3293f4f291a1345fd5482eac | SQL | Gandalf-the-Tartan/portfolio | /SQL/nanodegree/1_BETWEEN.sql | UTF-8 | 371 | 3.453125 | 3 | [] | no_license | # BETWEEN AND, shorthand for >= AND <=
SELECT occurred_at, gloss_qty
FROM orders
WHERE gloss_qty BETWEEN 24 AND 29;
#N.B. includes end and start points
#saves writing: column >= 24 AND column <= 29
#timestamp data type
SELECT *
FROM web_events
WHERE channel IN ('organic', 'adwords') AND occurred_at BETWEEN '2016-01-01' AND '2017-01-01'
ORDER BY occurred_at DESC;
| true |
64413b8319bfcdfd8aa3240832da266c65146b43 | SQL | tiwarikaustav/EmployeePayrollDBUC8ToUC12 | /UC7_SumAvgMinMaxFunctions&GroupByStatement.sql | UTF-8 | 571 | 3.59375 | 4 | [] | no_license | --UC7: Using SUM(), AVG(), MIN(), MAX() functions
SELECT SUM(salary) as 'Sum of Salary' FROM employee_payroll
WHERE gender = 'F';
SELECT SUM(salary) as 'Sum Of Salary', MIN(salary) as 'Minimum Salary',
MAX(salary) as 'Maximum Salary', COUNT(salary) as 'Number Of Males',
AVG(salary) as 'Average Salary', gender from employee_payroll group by gender;
SELECT SUM(salary) as 'Sum Of Salary', MIN(salary) as 'Minimum Salary',
MAX(salary) as 'Maximum Salary', COUNT(salary) as 'Number Of Females',
AVG(salary) as 'Average Salary' from employee_payroll group by gender;
| true |
26374b7bf248d0cf35a9182ace640f495e5fb1aa | SQL | TakiyaHideto/hive_eleme | /dm_ups_user_item_info_food_prefer.sql | UTF-8 | 5,510 | 3.875 | 4 | [] | no_license | #***************************************************************************************************
# ** 文件名称: dm.dm_ups_user_item_info_food_prefer.sql
# ** 功能描述: 生成用户食品偏好,并插入到用户画像中
# ** 创建者: jiahao.dong
# ** 创建日期: 2016-08-11
#***************************************************************************************************
drop table temp.temp_mdl_food_user_food_sample_sub1;
create table temp.temp_mdl_food_user_food_sample_sub1 as
select
a.user_id,
b.normalize_food_name as food_name,
count(order_id) as order_cnt,
sum(a.total_price) as total_price,
max(a.created_at) as last_order_time
-- sum(t2.user_month_order_num) as user_month_order_num
from (
select
user_id,
order_id,
entity_id as food_id,
food_name,
total_price,
created_at
from(
select
user_id,
id,
total as total_price,
created_at
from
dw.dw_trd_order_wide_day
where
dt='${day}' and
datediff('${day}',created_at)<61 and
order_status=1
) t1
join(
select
order_id,
entity_id,
name as food_name
from
dw.dw_trd_order_item
where
dt='${day}' and
datediff('${day}',created_at)<61
) t2
on(
t1.id=t2.order_id
)
) a
join(
select
food_id,
food_name,
normalize_food_name
from
dm.dm_mdl_food_name_normalize_day
where
dt='${day}'
) b
on(
a.food_id=b.food_id
)
group by
a.user_id,
b.normalize_food_name
;
drop table temp.temp_mdl_food_user_food_sample_sub2;
create table temp.temp_mdl_food_user_food_sample_sub2 as
select
user_id,
sum(order_cnt) as user_month_order_num
from
temp.temp_mdl_food_user_food_sample_sub1
group by
user_id
;
drop table temp.temp_mdl_food_user_food_sample;
create table temp.temp_mdl_food_user_food_sample as
select
t1.user_id,
food_name,
order_cnt,
total_price,
last_order_time,
user_month_order_num,
'${day}' as record_day
from
temp.temp_mdl_food_user_food_sample_sub1 t1
join
temp.temp_mdl_food_user_food_sample_sub2 t2
on(
t1.user_id=t2.user_id
)
;
drop table temp.temp_rec_user_food_score;
create table temp.temp_rec_user_food_score as
select
user_id,
food_name,
score,
row_number() over (partition by user_id order by score desc) as rno
from(
select
user_id,
food_name,
round((order_cnt/user_month_order_num)*bound_data(total_price,2,50)/(datediff('${day}',last_order_time)+1)+0.01,2) as score
from
temp.temp_mdl_food_user_food_sample
) t
;
drop table temp.temp_rec_user_food_score_normalized;
create table temp.temp_rec_user_food_score_normalized as
select
t.user_id,
concat('{', concat_ws(',',collect_set(concat('\"',t.food_name,'\":','\"',t.score_normalized,'\"'))), '}') food_info
from(
select
user_id,
food_name,
score as score_normalized
from
temp.temp_rec_user_food_score
where
rno<21 and
food_name != '' and
food_name is not null
) t
group by
t.user_id
;
drop table temp.temp_ups_user_food_prefer_partition;
create table temp.temp_ups_user_food_prefer_partition as
select
t.user_id,
t.attr_value
from(
select
case when t1.user_id is not null then t1.user_id else t2.user_id end as user_id,
case when t2.food_info is not null then t2.food_info else t1.attr_value end as attr_value
from(
select
user_id,
attr_value
from
dm.dm_ups_user_item_info
where
flag='rec_food' and
attr_key='food_prefer' and
datediff('${day}',dt)=1
) t1
full outer join (
select
user_id,
food_info
from temp.temp_rec_user_food_score_normalized) t2
on t1.user_id=t2.user_id) t
group by t.user_id, t.attr_value
;
insert overwrite table dm.dm_ups_user_item_info partition(dt='${day}', flag='rec_food')
select
user_id,
'rec' as top_category,
'food_prefer' as attr_key,
attr_value,
'1' as is_json,
from_unixtime(unix_timestamp()) as update_time
from
temp.temp_ups_user_food_prefer_partition;
insert overwrite table dm.dm_ups_user_item_info partition(dt='3000-12-31', flag='rec_food')
select
user_id,
'rec' as top_category,
'food_prefer' as attr_key,
attr_value,
'1' as is_json,
from_unixtime(unix_timestamp()) as update_time
from
temp.temp_ups_user_food_prefer_partition;
| true |
278df650c8620152388126420df92f864b559b36 | SQL | dmateusp/dbt-spark | /dbt/include/spark/macros/materializations/incremental.sql | UTF-8 | 2,317 | 3.71875 | 4 | [
"Apache-2.0"
] | permissive | {% macro get_insert_overwrite_sql(source_relation, target_relation, partitions) %}
{%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}
{%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}
insert overwrite table {{ target_relation }}
{{ partition_cols(label="partition") }}
select {{dest_cols_csv}} from {{ source_relation.include(database=false, schema=false) }}
{% endmacro %}
{% materialization incremental, adapter='spark' -%}
{%- set partitions = config.get('partition_by') -%}
{% if not partitions %}
{% do exceptions.raise_compiler_error("Table partitions are required for incremental models on Spark") %}
{% endif %}
{%- set identifier = model['alias'] -%}
{%- set tmp_identifier = model['alias'] ~ "__dbt_tmp" -%}
{%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}
{%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database, type='table') -%}
{%- set tmp_relation = api.Relation.create(identifier=tmp_identifier, type='table') -%}
{%- set full_refresh = flags.FULL_REFRESH == True and old_relation is not none -%}
{%- set old_relation_is_view = old_relation is not none and old_relation.type == 'view' -%}
{%- if full_refresh or old_relation_is_view -%}
{{ adapter.drop_relation(old_relation) }}
{%- set old_relation = none -%}
{%- endif %}
{% call statement() %}
set spark.sql.sources.partitionOverwriteMode = DYNAMIC
{% endcall %}
{% call statement() %}
set spark.sql.hive.convertMetastoreParquet = false
{% endcall %}
{{ run_hooks(pre_hooks) }}
{#-- This is required to make dbt's incremental scheme work #}
{%- if old_relation is none -%}
{%- call statement('main') -%}
{{ create_table_as(False, target_relation, sql) }}
{%- endcall %}
{%- else -%}
{%- call statement('main') -%}
{{ create_table_as(True, tmp_relation, sql) }}
{%- endcall -%}
{#-- insert statements don't like CTEs, so support them via a temp view #}
{%- call statement('main') -%}
{{ get_insert_overwrite_sql(tmp_relation, target_relation, partitions) }}
{%- endcall -%}
{%- endif %}
{{ run_hooks(post_hooks) }}
{%- endmaterialization %}
| true |
ebfb8f5548973953e2d46b83c1cd347cd7b253aa | SQL | gvdiaz/Curso_SQL | /Unidad 1/Unidad 3/Scripts/Ejercicio_practico_3_14.sql | UTF-8 | 2,741 | 3.953125 | 4 | [
"MIT"
] | permissive | # Descripción: Ejercicio 3.14
# Autor: Gustavo Vladimir Diaz
# Fecha: 27/09/2020
# Enunciado:
# A. Obtener los 5 primeros caracteres de la cadena "ABCDEFGHIJ"
# B. Obtener los 5 últimos caracteres de la cadena "ABCDEFGHIJ"
# C. Convertir a minúsculas la cadena "ABCDEFGHIJ"
# D. Convertir a mayúsculas el resultado de C.
# E. Obtener los caracteres 3ro, 4to y 5to de la cadena "ABCDEFGHIJ"
# F. Obtener una cadena que repita veinte veces la letra "A"
# G. Tomar la cadena "MAMA" y reemplazar cada "M" por una "C". (Prohibido protestar si la respuesta les huele mal)
# H. Eliminar los espacios en blanco a derecha de la cadena " ABC "
# I. Eliminar los espacios en blanco a izquierda de la cadena " ABC "
# J. Eliminar los espacios en blanco a derecha y a izquierda en la cadena "
#
# Objetivo de ejercicio: Implementar las funciones pedidas y devolver los resultados.
# Desarrollo
CREATE DATABASE prueba_eje_3_14;
USE prueba_eje_3_14;
# Obtener los 5 primeros caracteres de la cadena "ABCDEFGHIJ"
SELECT 'Obtener los 5 primeros caracteres de la cadena "ABCDEFGHIJ"';
SELECT LEFT("ABCDEFGHIJ", 5);
SELECT '';
# Obtener los 5 últimos caracteres de la cadena "ABCDEFGHIJ"
SELECT 'Obtener los 5 últimos caracteres de la cadena "ABCDEFGHIJ"';
SELECT RIGHT("ABCDEFGHIJ", 5);
SELECT '';
# Convertir a minúsculas la cadena "ABCDEFGHIJ"
SELECT 'Convertir a minúsculas la cadena "ABCDEFGHIJ"';
SELECT LOWER("ABCDEFGHIJ");
SELECT '';
# Convertir a mayúsculas el resultado de C
SELECT 'Convertir a mayúsculas el resultado de C.';
SELECT UPPER(LOWER("ABCDEFGHIJ"));
SELECT '';
# Obtener los caracteres 3ro, 4to y 5to de la cadena "ABCDEFGHIJ"
SELECT 'Obtener los caracteres 3ro, 4to y 5to de la cadena "ABCDEFGHIJ"';
SELECT SUBSTRING("ABCDEFGHIJ", 3, 3);
SELECT '';
# Obtener una cadena que repita veinte veces la letra "A"
SELECT 'Obtener una cadena que repita veinte veces la letra "A"';
SELECT REPEAT('A', 20); # En SQL server la función se llama "REPLICATE"
SELECT '';
# Tomar la cadena "MAMA" y reemplazar cada "M" por una "C".
SELECT 'Tomar la cadena "MAMA" y reemplazar cada "M" por una "C".';
SELECT 'MAMA';
SELECT REPLACE('MAMA', 'M', 'C');
SELECT '';
# Eliminar los espacios en blanco a derecha de la cadena " ABC "
SELECT 'Eliminar los espacios en blanco a derecha de la cadena " ABC "';
SELECT RTRIM(" ABC ");
SELECT '';
# Eliminar los espacios en blanco a izquierda de la cadena " ABC "
SELECT 'Eliminar los espacios en blanco a izquierda de la cadena " ABC "';
SELECT LTRIM(" ABC ");
SELECT '';
# Eliminar los espacios en blanco a derecha y a izquierda en la cadena "
SELECT 'Eliminar los espacios en blanco a derecha y a izquierda en la cadena "';
SELECT RTRIM(LTRIM(" ABC "));
SELECT '';
DROP DATABASE prueba_eje_3_14;
| true |
901c3f34ab185b2039efa4ea38ba56425262d332 | SQL | thona-seguros/Repositorio-Sicas | /Objetos-BD/Paquetes/oc_clausulas.sql | UTF-8 | 3,454 | 3.1875 | 3 | [] | no_license | --
-- OC_CLAUSULAS (Package)
--
-- Dependencies:
-- STANDARD (Package)
-- STANDARD (Package)
-- CLAUSULAS (Table)
--
CREATE OR REPLACE PACKAGE SICAS_OC.oc_clausulas IS
FUNCTION DESCRIPCION(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2;
FUNCTION OBLIGATORIA(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2;
FUNCTION TIPO_CLAUSULA(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2;
FUNCTION TIPO_ADMINISTRACION(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2;
FUNCTION APLICA_ADMINISTRACION(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2;
END OC_CLAUSULAS;
/
--
-- OC_CLAUSULAS (Package Body)
--
-- Dependencies:
-- OC_CLAUSULAS (Package)
--
CREATE OR REPLACE PACKAGE BODY SICAS_OC.oc_clausulas IS
FUNCTION DESCRIPCION(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2 IS
cDescClausula CLAUSULAS.DescClausula%TYPE;
BEGIN
BEGIN
SELECT DescClausula
INTO cDescClausula
FROM CLAUSULAS
WHERE CodCia = nCodCia
AND CodEmpresa = nCodEmpresa
AND CodClausula = cCodClausula;
EXCEPTION
WHEN NO_DATA_FOUND THEN
cDescClausula := 'NO EXISTE';
END;
RETURN(cDescClausula);
END DESCRIPCION;
FUNCTION OBLIGATORIA(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2 IS
cIndOblig CLAUSULAS.IndOblig%TYPE;
BEGIN
BEGIN
SELECT IndOblig
INTO cIndOblig
FROM CLAUSULAS
WHERE CodCia = nCodCia
AND CodEmpresa = nCodEmpresa
AND CodClausula = cCodClausula;
EXCEPTION
WHEN NO_DATA_FOUND THEN
cIndOblig := 'N';
END;
RETURN(cIndOblig);
END OBLIGATORIA;
FUNCTION TIPO_CLAUSULA(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2 IS
cIndTipoClausula CLAUSULAS.IndTipoClausula%TYPE;
BEGIN
BEGIN
SELECT IndTipoClausula
INTO cIndTipoClausula
FROM CLAUSULAS
WHERE CodCia = nCodCia
AND CodEmpresa = nCodEmpresa
AND CodClausula = cCodClausula;
EXCEPTION
WHEN NO_DATA_FOUND THEN
cIndTipoClausula := NULL;
END;
RETURN(cIndTipoClausula);
END TIPO_CLAUSULA;
FUNCTION APLICA_ADMINISTRACION(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2 IS
cAplicaTipoAdministracion CLAUSULAS.AplicaTipoAdministracion%TYPE;
BEGIN
BEGIN
SELECT AplicaTipoAdministracion
INTO cAplicaTipoAdministracion
FROM CLAUSULAS
WHERE CodCia = nCodCia
AND CodEmpresa = nCodEmpresa
AND CodClausula = cCodClausula;
EXCEPTION
WHEN NO_DATA_FOUND THEN
cAplicaTipoAdministracion := 'N';
END;
RETURN(cAplicaTipoAdministracion);
END APLICA_ADMINISTRACION;
FUNCTION TIPO_ADMINISTRACION(nCodCia NUMBER, nCodEmpresa NUMBER, cCodClausula VARCHAR2) RETURN VARCHAR2 IS
cTipoAdminsitracionClausula CLAUSULAS.TipoAdMINISTRACION%TYPE;
BEGIN
BEGIN
SELECT TipoAdministracion
INTO cTipoAdminsitracionClausula
FROM CLAUSULAS
WHERE CodCia = nCodCia
AND CodEmpresa = nCodEmpresa
AND CodClausula = cCodClausula;
EXCEPTION
WHEN NO_DATA_FOUND THEN
cTipoAdminsitracionClausula := null;
END;
RETURN( cTipoAdminsitracionClausula);
END TIPO_ADMINISTRACION;
END OC_CLAUSULAS;
/
| true |
2b9b27e66d285f2a08dcebcef88a7b48f76e4599 | SQL | emdimacali/todolistapp | /setupdb/createDbAndTables.sql | UTF-8 | 507 | 3.5625 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS todolistapp;
USE todolistapp;
CREATE TABLE IF NOT EXISTS app_users(
email varchar(255) NOT NULL,
password varchar(255) NOT NULL,
PRIMARY KEY (email)
);
CREATE TABLE IF NOT EXISTS tasks(
id int(255) NOT NULL AUTO_INCREMENT,
task_name varchar(500) NOT NULL,
date_created datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
date_completed datetime,
email varchar(255) NOT NULL,
PRIMARY KEY(id),
FOREIGN KEY(email) REFERENCES app_users(email)
); | true |
767012de9d1ca3a9003d954b8b76f0b4f42409e9 | SQL | rodrigost23/currency-convert-api | /db-init.sql | UTF-8 | 1,177 | 3.75 | 4 | [] | no_license | CREATE TABLE conversion_log (id SERIAL NOT NULL, from_currency_id INT DEFAULT NULL, to_currency_id INT DEFAULT NULL, timestamp TIMESTAMP(0) WITH TIME ZONE NOT NULL, input NUMERIC(10,
2) NOT NULL, result NUMERIC(10, 2) NOT NULL, PRIMARY KEY(id));
CREATE INDEX IDX_36AA9A5AA66BB013 ON conversion_log (from_currency_id);
CREATE INDEX IDX_36AA9A5A16B7BF15 ON conversion_log (to_currency_id);
CREATE TABLE currency (id SERIAL NOT NULL, code VARCHAR(255) NOT NULL, symbol VARCHAR(255) NOT NULL, rate NUMERIC(12, 6) NOT NULL, PRIMARY KEY(id));
ALTER TABLE conversion_log ADD CONSTRAINT FK_36AA9A5AA66BB013 FOREIGN KEY (from_currency_id) REFERENCES currency (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE conversion_log ADD CONSTRAINT FK_36AA9A5A16B7BF15 FOREIGN KEY (to_currency_id) REFERENCES currency (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
INSERT INTO currency (code, symbol, rate) VALUES ('USD', '$', '1'::numeric);
INSERT INTO currency (code, symbol, rate) VALUES ('BRL', 'R$', '4.62762'::numeric);
INSERT INTO currency (code, symbol, rate) VALUES ('EUR', 'R$', '0.885813'::numeric);
INSERT INTO currency (code, symbol, rate) VALUES ('GBP', '₤', '0.766313'::numeric); | true |
c2a49f00faefde3bfdba01fda9dbb3eb6b632393 | SQL | nuozhou715/DataBootcamp | /HW7/Analysis/analysis_2.sql | UTF-8 | 560 | 3.96875 | 4 | [] | no_license | select * from employees;
select employees.emp_no, employees.gender, employees.first_name, employees.last_name, employees.hire_date, salaries.salary
from employees
full join salaries
on employees.emp_no = salaries.emp_no;
select hire.emp_no, hire.first_name, hire.last_name, hire.hire_date
from (
select employees.emp_no, employees.gender, employees.first_name, employees.last_name, employees.hire_date, salaries.salary
from employees
full join salaries
on employees.emp_no = salaries.emp_no
) as hire
where (select extract(year from hire_date)) = '1986'; | true |
df5d38e353ef4670278097d621b7713fe4309d4f | SQL | gauravm31/VTAPP | /mysql/exercise_6/person.sql | UTF-8 | 1,202 | 4.375 | 4 | [] | no_license | CREATE TABLE persons (
email VARCHAR(25),
phone VARCHAR(10),
city VARCHAR(15),
PRIMARY KEY (email)
);
LOAD DATA LOCAL INFILE 'mysql/exercise_6/email_subscribers.csv'
INTO TABLE persons
FIELDS TERMINATED BY ' , '
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
--What all cities did people respond from
SELECT DISTINCT city FROM persons;
--How many people responded from each city
SELECT city, COUNT(email) FROM persons GROUP BY city;
--Which city were the maximum respondents from?
SET @max_respondents = (
SELECT MAX(counter.count1)
FROM (
SELECT COUNT(email) AS count1
FROM persons
GROUP BY city) AS counter);
SELECT city, COUNT(email) FROM persons GROUP BY city HAVING COUNT(email) = @max_respondents;
--What all email domains did people respond from ?
SELECT DISTINCT SUBSTRING_INDEX(email, '@', -1) FROM persons;
--Which is the most popular email domain among the respondents ?
SET @max_domain_users = (
SELECT MAX(counter.count1)
FROM (
SELECT COUNT(email) AS count1
FROM persons
GROUP BY SUBSTRING_INDEX(email, '@', -1)
) AS counter
);
SELECT SUBSTRING_INDEX(email, '@', -1) AS domain
FROM persons
GROUP BY domain
HAVING count(email) = @max_domain_users;
| true |
d585a680dcea002e4c772681e17abc2c2d815702 | SQL | devyeony/pics | /src/main/webapp/resource/kjy/db_query_mapper_insert.sql | UTF-8 | 3,676 | 2.96875 | 3 | [] | no_license | select * from studio;
select * from studio_filter;
select * from repeat_date;
--------------------------------------------
-- repeat_date insert
--------------------------------------------
-- stu_id 10
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('mon','17-19',10);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('tue','9-18',10);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('wed','9-18',10);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('thu','9-18',10);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('fri','9-13',10);
-- stu_id : 11
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('mon','11-23',11);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('tue','11-23',11);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('wed','11-23',11);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('thu','11-23',11);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('fri','11-23',11);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('sat','11-23',11);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('sun','11-23',11);
-- stu_id 12
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('mon','9-18',12);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('tue','9-18',12);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('wed','9-18',12);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('thu','9-18',12);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('fri','9-18',12);
-- stu_id 13
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('mon','0-24',13);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('tue','0-24',13);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('wed','0-24',13);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('thu','0-24',13);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('fri','0-24',13);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('sat','0-24',13);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('sun','0-24',13);
-- stu_id 15
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('mon','19-23',15);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('wed','19-23',15);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('thu','19-23',15);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('fri','19-23',15);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('sat','19-23',15);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('sun','19-23',15);
-- stu_id 14
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('mon','13-20',14);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('wed','9-21',14);
INSERT INTO repeat_date(weekday, time, stu_id) VALUES ('fri','17-23',14);
------------------------
-- exception_date
------------------------
select * from exception_date;
INSERT INTO exception_date(start_date, end_date,stu_id) VALUES ('2020-08-15','2020-08-17',10);
INSERT INTO exception_date(start_date, end_date,stu_id) VALUES ('2020-08-01','2020-08-08',11);
INSERT INTO exception_date(start_date, end_date,stu_id) VALUES ('2020-08-16','2020-08-16',15);
------------------------
-- reservation
------------------------
select * from reservation;
INSERT INTO reservation(cust_id, stu_id, start_date, end_date, total_price, res_date, total_people)
VALUES (1,10,'2020-08-15','2020-08-15',100000,'2020-07-31',5);
INSERT INTO reservation(cust_id, stu_id, start_date, end_date, total_price, res_date, total_people)
VALUES (3,10,'2020-08-10','2020-08-12',150000,'2020-07-27',10);
INSERT INTO reservation(cust_id, stu_id, start_date, end_date, total_price, res_date, total_people)
VALUES (4,10,'2020-08-10','2020-08-12',150000,'2020-07-25',12);
| true |
63bb0f3dcc033d01417f454d56072db5ecd79f55 | SQL | jampaniuday/sql_source | /sql/model_clause/otn_download/for.sql | UTF-8 | 377 | 3.421875 | 3 | [] | no_license | SELECT SUBSTR(country,1,20) country,
SUBSTR(prod,1,15) prod, year, sales
FROM sales_view
WHERE country='Italy'
MODEL RETURN UPDATED ROWS
PARTITION BY (country)
DIMENSION BY (prod, year)
MEASURES (sale sales)
RULES (
sales['Mouse Pad', FOR year FROM 2005 TO 2012 INCREMENT 1] =
1.2 * sales[cv(prod), 2001] )
ORDER BY country, prod, year
/
| true |
a703c0bbee3730a107f99260e28f7e73dc0c0d80 | SQL | typo3union/Python | /Quick/Ext/js_career - 236/ext_tables.sql | UTF-8 | 6,750 | 3.046875 | 3 | [] | no_license | #
# Table structure for table 'tx_jscareer_domain_model_clinik'
#
CREATE TABLE tx_jscareer_domain_model_clinik (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
);
#
# Table structure for table 'tx_jscareer_domain_model_manager'
#
CREATE TABLE tx_jscareer_domain_model_manager (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
name varchar(255) DEFAULT '' NOT NULL,
designation varchar(255) DEFAULT '' NOT NULL,
voraussetzungen text NOT NULL,
phone varchar(255) DEFAULT '' NOT NULL,
email varchar(255) DEFAULT '' NOT NULL,
picture int(11) unsigned NOT NULL default '0',
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
);
#
# Table structure for table 'tx_jscareer_domain_model_applicant'
#
CREATE TABLE tx_jscareer_domain_model_applicant (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
job int(11) unsigned DEFAULT '0' NOT NULL,
name varchar(255) DEFAULT '' NOT NULL,
phone varchar(255) DEFAULT '' NOT NULL,
email varchar(255) DEFAULT '' NOT NULL,
resume int(11) unsigned NOT NULL default '0',
contact_date int(11) DEFAULT '0' NOT NULL,
ip varchar(255) DEFAULT '' NOT NULL,
useragent varchar(255) DEFAULT '' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
);
#
# Table structure for table 'tx_jscareer_domain_model_job'
#
CREATE TABLE tx_jscareer_domain_model_job (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
place varchar(255) DEFAULT '' NOT NULL,
join_check tinyint(1) unsigned DEFAULT '0' NOT NULL,
join_date int(11) DEFAULT '0' NOT NULL,
text_check tinyint(1) unsigned DEFAULT '0' NOT NULL,
text varchar(255) DEFAULT '' NOT NULL,
ab_sofort tinyint(1) unsigned DEFAULT '0' NOT NULL,
timing int(11) DEFAULT '0' NOT NULL,
contract varchar(255) DEFAULT '' NOT NULL,
short_description text NOT NULL,
description_header varchar(255) DEFAULT '' NOT NULL,
description_part1 text NOT NULL,
description_part2 text NOT NULL,
pdf int(11) unsigned NOT NULL default '0',
caetgory int(11) unsigned DEFAULT '0',
contact_person int(11) unsigned DEFAULT '0' NOT NULL,
applicant int(11) unsigned DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
);
#
# Table structure for table 'tx_jscareer_domain_model_applicant'
#
CREATE TABLE tx_jscareer_domain_model_applicant (
job int(11) unsigned DEFAULT '0' NOT NULL,
);
#
# Table structure for table 'tx_jscareer_job_manager_mm'
#
CREATE TABLE tx_jscareer_job_manager_mm (
uid_local int(11) unsigned DEFAULT '0' NOT NULL,
uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
sorting int(11) unsigned DEFAULT '0' NOT NULL,
sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL,
KEY uid_local (uid_local),
KEY uid_foreign (uid_foreign)
);
## EXTENSION BUILDER DEFAULTS END TOKEN - Everything BEFORE this line is overwritten with the defaults of the extension builder | true |
8da43d1c26ba6a7318f309ed00d3f88a7e7ab095 | SQL | Felipepereiralima/MySQL | /Atividades Inner Join/Exercício_1.sql | UTF-8 | 3,202 | 3.953125 | 4 | [] | no_license | /*
Atividade 1
Crie um banco de dados para um serviço de um game Online , o nome do banco deverá ter o seguinte nome db_generation_game_online, onde, o sistema trabalhará com as informações dos personagens desse game.
O sistema trabalhará com 2 tabelas tb_personagem e tb_classe.
siga exatamente esse passo a passo:
Crie uma tabela tb_classe utilizando a habilidade de abstração e determine 3 atributos relevantes da classe para se trabalhar com o serviço desse game Online.
Crie uma tabela tb_personagem e utilizando a habilidade de abstração e determine 5 atributos relevantes dos funcionários para se trabalhar com o serviço desse game Online (não esqueça de criar a foreign key de tb_classe nesta tabela).
Popule esta tabela classe com até 5 dados.
Popule esta tabela personagem com até 8 dados.
Faça um select que retorne os personagens com o poder de ataque maior do que 2000.
Faça um select trazendo os personagens com poder de defesa entre 1000 e 2000.
Faça um select utilizando LIKE buscando os personagens com a letra C.
Faça um um select com Inner join entre tabela classe e personagem.
Faça um select onde traga todos os personagem de uma classe específica (exemplo todos os personagens que são arqueiros).
salve as querys para cada uma dos requisitos do exercício em um arquivo .SQL ou texto e coloque no seu GitHuB pessoal e compartilhe esta atividade.
*/
create database db_generation_game_online;
use db_generation_game_online;
create table tb_classe(
id_classe bigint(5) auto_increment,
tipo varchar(30) not null unique,
habitat varchar(30) not null,
vida int not null,
primary key (id_classe)
);
create table tb_personagem(
id_person bigint(5) auto_increment,
nome varchar(30) not null,
idade int not null,
personalidade varchar(30) not null,
atq_principal varchar(30) not null,
poder_ataq int not null,
poder_defesa int not null,
fk_classe bigint(5),
primary key (id_person),
foreign key (fk_classe) references tb_classe(id_classe)
);
insert into tb_classe(tipo, habitat, vida)
values ("Arcanista", "Floresta", 100), -- 1
("Ladino", "Cidade", 100), -- 2
("Guerreiro", "Cidade", 100), -- 3
("Arqueiro", "Floresta", 100), -- 4
("Anão", "Montanhas", 100); -- 5
insert into tb_personagem(nome, idade, personalidade, atq_principal, poder_ataq, poder_defesa, fk_classe)
values ("Felipe", 30, "introvertido", "Narigada", 2000, 1000, 1 ),
("Caio", 29, "extrovertido", "Barrigada", 3000, 1500, 2),
("Fabio", 28, "introvertido", "Facada", 1500, 750, 3),
("Rhamah", 27, "extrovertido", "Cabeçada", 5000, 2500, 4),
("Bruno", 26, "introvertido", "Porrada", 1000, 500, 5),
("João", 25, "introvertido", "Facada", 2500, 1250, 1),
("Vinicius", 24, "extrovertido", "Porrada", 10000, 5000, 2),
("Paulo", 23, "introvertido", "Barrigada",5000, 2500, 3);
select * from tb_personagem where poder_ataq > 2000;
select * from tb_personagem where poder_defesa between 1000 and 2000;
select * from tb_personagem where nome like "%c%";
select * from tb_personagem inner join tb_classe on tb_classe.id_classe = tb_personagem.fk_classe where tipo = "Arqueiro";
| true |
c08741e2023f08eac8042280362e8ef653e05c79 | SQL | OSLL/mdbci | /playground/mariadb_connection/test_results_db.sql | UTF-8 | 492 | 3.203125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS test_results_db;
USE test_results_db;
CREATE TABLE test_run (
id INT AUTO_INCREMENT,
jenkins_id INT,
start_time DATETIME,
target VARCHAR(256),
box VARCHAR(256),
product VARCHAR(256),
mariadb_version VARCHAR(256),
test_code_commit_id VARCHAR(256),
maxscale_commit_id VARCHAR(256),
job_name VARCHAR(256),
PRIMARY KEY(id)
);
CREATE TABLE results (
id INT,
test VARCHAR(256),
result INT,
FOREIGN KEY (id) REFERENCES test_run(id)
);
| true |
c9c175189e86eba471bcc784c2ce84b700a6131e | SQL | MManoj915/Autotime | /Scripts/Oracle/Provider Mandatory Tariff Mapping.sql | UTF-8 | 649 | 3.390625 | 3 | [] | no_license | SELECT TPC.*,GEN.CONSTANTNAME AS CPTNAME,GEN1.CONSTANTNAME AS FACTORTYPENAME, GEN3.CONSTANTNAME CALMETHODNAME
FROM IM_TARIFF_PER_CATEGORY TPC
JOIN ADMCOMPANY ADMCOM ON ADMCOM.COMPANYCODE=TPC.COMPANYCODE AND TPC.COMPANYCODE =1
LEFT JOIN GENCONSTANT GEN3 ON GEN3.CATEGORY= 'SLABCALCULATIONMODE' AND GEN3.LANGUAGECODE='EN-US' AND
GEN3.CONSTANTVALUE=TPC.CALMETHODCODE
LEFT JOIN GENCONSTANT GEN ON GEN.CONSTANTVALUE =TPC.CPTCODE AND GEN.CATEGORY='CPTMAIN' AND GEN.LANGUAGECODE='EN-US'
LEFT JOIN GENCONSTANT GEN1 ON GEN1.CONSTANTVALUE =TPC.FACTORTYPECODE AND GEN1.CATEGORY='LBLFACTORBASE' AND
GEN1.LANGUAGECODE='EN-US' WHERE TPC.ASSIGN_CODE=1 | true |
89bb2be1ed60e44042087439cd9248f715e4ec94 | SQL | grantdanielconsultingllc/projectx | /chapter5.sql | UTF-8 | 1,663 | 4.34375 | 4 | [] | no_license | -- chapter 5
-- Write a query to get the names of products ordered by name.
Select productname
From product
Order by productname;
-- copy the previous SQL and order by just product name, descending.
Select productname
From product
Order by productname Desc;
-- Write a query to get employee birthdate, first and last name ordered by birth date.
Select birthdate, firstname, lastname
From employee
Order by birthdate;
-- copy the previous SQL and order by birth date, descending.
Select birthdate, firstname, lastname
From employee
Order by birthdate Desc;
-- Write a query to order all orderheader by order date, ascending.
Select orderdate, orderid, employeeid, shipname
From orderheader
Order By orderdate ASC
-- copy the previous SQL and order by order date, then by employee, ascending.
Select orderdate, orderid, employeeid, shipname
From orderheader
Order By orderdate Asc,
employeeid Asc;
-- Write a query to get the first name, last name, and salary of employees ordered by salary highest first.
Select firstname, lastname, salary
From employee
Order By salary Desc;
-- Write a query to get the product name, unit price, and units in stock ordered by units in stock highest to lowest and then unit price lowest to highest.
Select productname, unitprice, unitsinstock
From product
Order By unitsinstock Desc,
unitprice Asc;
-- Write a query to get the name and unit price of the ten most expensive products.
Select unitprice
From product
Order By unitprice Desc
Limit 10;
-- copy previous SQL, change it to get the name and unit price of the ten least expensive products.
Select unitprice
From product
Order By unitprice Asc
Limit 10; | true |
ee71e158b8592479a78142a2363849af7b84a905 | SQL | LucaContri/dataanalysis | /SFReportEngine/resources/prc.metrics.sql | UTF-8 | 2,949 | 4.28125 | 4 | [] | no_license | select * from analytics.sla_arg_v2 arg
where arg.`Metric` in ('ARG Submission - Waiting On Client')
and arg.`Region` like 'EMEA%';
(select t.*,
timestampdiff(second, t.`First Submitted`, t.`First Reviewed`)/3600/24 as 'First Submitted to First Reviewed (Days)',
timestampdiff(second, t.`First Submitted`, t.`CA Approved`)/3600/24 as 'First Submitted to CA Approved (Days)',
ca.Reporting_Business_Units__c as 'CA RBU' from
(select
arg.Id,
arg.Name,
arg.`Business Line`, arg.`Pathway`, arg.`Program`, arg.`Standards`,ifnull(arg.`Standard Families`,'') as 'Standard Family',
r.Name as 'ARG Author',
r.Reporting_Business_Units__c as 'ARG Author RBU',
site.Name as 'Client Site',
ccs.Name as 'Site Country',
arg2.`Non_Conformance__c` as 'Non Conformance',
max(if(arg.`Metric` = 'ARG Revision - First', arg.Owner, null)) as 'CA',
#sum(if(arg.`Metric` = 'ARG Submission - Waiting On Client', timestampdiff(second, arg.`From`, arg.`To`)/3600/24,0)) as 'Waiting on Client minor NCR',
max(if(arg.`Metric` = 'ARG Revision - First', arg.`From`, null)) as 'First Submitted',
max(if(arg.`Metric` = 'ARG Revision - First', arg.`To`, null)) as 'First Reviewed',
date_format(max(if(arg.`Metric` = 'ARG Revision - First', arg.`From`, null)), '%Y-%m') as 'First Submitted Period',
date_format(max(if(arg.`Metric` = 'ARG Revision - First', arg.`To`, null)), '%Y-%m') as 'First Reviewed Period',
count(distinct ah.Id) as '# Rejections',
ifnull(group_concat(distinct ah.Rejection_Reason__c separator ';'),'') as 'Rejection Reasons',
max(if(arg.`Metric` = 'ARG Completion/Hold', arg.`From`, null)) as 'CA Approved',
date_format(max(if(arg.`Metric` = 'ARG Completion/Hold', arg.`From`, null)), '%Y-%m') as 'CA Approved Period'
from analytics.sla_arg_v2 arg
inner join salesforce.audit_report_group__c arg2 on arg.Id = arg2.Id
inner join salesforce.arg_work_item__c argwi on arg2.Id = argwi.RAudit_Report_Group__c and argwi.IsDeleted = 0
inner join salesforce.work_item__c wi on argwi.RWork_Item__c = wi.Id
inner join salesforce.site_certification_standard_program__c scsp on wi.Site_Certification_Standard__c = scsp.Id
inner join salesforce.certification__c sc on scsp.Site_Certification__c = sc.Id
inner join salesforce.account site on sc.Primary_client__c = site.Id
left join salesforce.country_code_setup__c ccs on site.Business_Country2__c = ccs.Id
inner join salesforce.resource__c r on arg2.RAudit_Report_Author__c = r.Id
left join salesforce.approval_history__c ah on arg.Id = ah.RAudit_Report_Group__c and ah.Status__c in ('Rejected')
where arg.`Metric` in ('ARG Revision - First', 'ARG Revision - Resubmission', 'ARG Completion/Hold')#, 'ARG Submission - Waiting On Client')
and arg.`To` is not null
group by arg.`Id`) t
left join salesforce.resource__c ca on t.`CA` = ca.Name
where t.`CA Approved` between '2015-10-01' and '2016-11-01'
#and ca.Reporting_Business_Units__c like 'EMEA%'
); | true |
81d2095724f44c75dcb427151c20a58879a25b8b | SQL | SabaTass/ETL-project | /SQL_data/SQL_Query_rankings.sql | UTF-8 | 1,268 | 4.15625 | 4 | [] | no_license | create table rank_airbnb1 as
select airbnb_id, brewery, dist, rank() over w from
distance window w as (partition by brewery order by dist asc);
-- create a new table from the query below to only include the top 5 airbnb rankings for each brewery
create table rank_airbnb2 as
select airbnb_id, brewery, dist, rank from rank_airbnb1 where rank < 6;
-- query to confirm data
select * from rank_airbnb2;
-- create a new table from joined tables to now include the airbnb NAME that
-- corresponds to the airbnb_id and has a rank of 1.
create table airbnb_rank1 as
select rank_airbnb2.brewery, rank_airbnb2.airbnb_id,
ny_abnb.airbnb_name, rank_airbnb2.rank, ny_abnb.price,
rank_airbnb2.dist, (rank_airbnb2.dist * 5280) as feet_dist
from rank_airbnb2
inner join ny_abnb on rank_airbnb2.airbnb_id = ny_abnb.airbnb_id
where rank_airbnb2.rank = 1
group by brewery, rank_airbnb2.dist, rank_airbnb2.rank, rank_airbnb2.airbnb_id,
ny_abnb.airbnb_id, ny_abnb.airbnb_name, ny_abnb.price
order by rank_airbnb2.brewery
-- Query data to confirm
select * from airbnb_rank1
-- The following query lists the Brewery tour itinerary with the Airbnb that is closest walking distance
-- measured in miles and feet.
select * from brewery_tour_list
| true |
b58b7f040473f121a64631fcd4caf57d398b931c | SQL | Take-01/frinob | /frinob/sql/frinob.sql | UTF-8 | 3,975 | 3.75 | 4 | [] | no_license | set names utf8;
set foreign_key_checks=0;
drop database if exists frinob;
create database frinob;
use frinob;
create table user_info(
id int primary key not null auto_increment comment "ID",
user_id varchar(16) unique not null comment "ユーザーID",
password varchar(100) not null comment "パスワード",
user_name varchar(20) not null comment "ユーザー名",
email varchar(30) not null comment "メールアドレス",
regist_date datetime comment "登録日時",
update_date datetime comment "更新日時"
)
default charset=utf8
comment="ユーザー情報テーブル"
;
insert into user_info values
(1, "guest1", "84a5aadfb52a360458afca1d6fec5b4f4d638c8743e471cd0b2e0e524b3224f7", "ゲスト1", "guest1@gmail.com", now(), now()),
(2, "guest2", "c389e7a4be00a29510ae0bb5cd2fed5f8571de68a536990a841246de60c231b5", "ゲスト2", "guest2@gmail.com", now(), now()),
(3, "guest3", "75218ef4817396295191656e9e65b6e32d73eb1c0a739aca185bc78e765e4605", "ゲスト3", "guest3@gmail.com", now(), now());
create table post_info(
id int primary key not null auto_increment comment "ID",
writer_id varchar(16) not null comment "投稿者",
title varchar(30) not null comment "タイトル",
body varchar(500) not null comment "本文",
category int not null default 0 comment "カテゴリー",
image_file_path varchar(100) comment "画像ファイルパス",
image_file_name varchar(50) comment "画像ファイル名",
regist_date datetime comment "登録日時",
update_date datetime comment "更新日時",
foreign key(writer_id) references user_info(user_id),
foreign key(category) references category(category_id)
)
default charset=utf8
comment="投稿情報テーブル"
;
create table favorite_post_info(
id int primary key not null auto_increment comment "ID",
user_id varchar(16) not null comment "ユーザーID",
post_id int not null comment "投稿記事ID",
post_tag1 varchar(20) not null default "未分類" comment "投稿記事のタグ1",
post_tag2 varchar(20) comment "投稿記事のタグ2",
post_tag3 varchar(20) comment "投稿記事のタグ3",
post_tag4 varchar(20) comment "投稿記事のタグ4",
post_tag5 varchar(20) comment "投稿記事のタグ5",
regist_date datetime comment "登録日時",
update_date datetime comment "更新日時",
foreign key(user_id) references user_info(user_id),
foreign key(post_id) references post_info(id)
)
default charset=utf8
comment="お気に入り投稿テーブル"
;
create table favorite_user_info(
id int primary key not null auto_increment comment "ID",
user_id varchar(16) not null comment "ユーザーID",
fav_user_id varchar(16) not null comment "お気に入りユーザーID",
user_tag1 varchar(20) not null default "未分類" comment "ユーザータグ1",
user_tag2 varchar(20) comment "ユーザータグ2",
user_tag3 varchar(20) comment "ユーザータグ3",
user_tag4 varchar(20) comment "ユーザータグ4",
user_tag5 varchar(20) comment "ユーザータグ5",
regist_date datetime comment "登録日時",
update_date datetime comment "更新日時",
foreign key(user_id) references user_info(user_id),
foreign key(fav_user_id) references user_info(user_id)
)
default charset=utf8
comment="お気に入りユーザーテーブル"
;
create table category(
category_id int primary key not null comment "カテゴリーID",
category_name varchar(20) unique not null comment "カテゴリー名",
category_description varchar(50) not null comment "カテゴリー説明",
regist_date datetime comment "登録日時",
update_date datetime comment "更新日時"
)
default charset=utf8
comment="カテゴリーテーブル"
;
insert into category values
(0, "未分類", "未分類", now(), now()),
(1, "生活", "料理、掃除など生活に関すること", now(), now()),
(2, "お金", "貯金、投資、節約などお金に関すること", now(), now()),
(3, "趣味", "趣味に関すること", now(), now()),
(4, "学習", "資格、学校、その他学習に関すること", now(), now()),
(5, "仕事", "仕事に関すること", now(), now()); | true |
4ab15951b57c78f2fb5a0ef82bcb344f75d14ad4 | SQL | BaekSangYeol/Practice | /src/main/java/practice/sql/delete.sql | UTF-8 | 781 | 3.140625 | 3 | [] | no_license | /*member delete(on delete cascade)*/
delete member where m_id = 'aaa';
/*cart delete*/
--상품 1개 삭제
delete cart where c_no = 1;
--상품 전체 삭제
delete cart where m_id = 'aaa';
/*reservation delete(on delete cascade)*/
--예약 목록 1개 삭제(한 번에 2개 예약 시 예약상품목록 2개도 삭제됨)
delete reservation where r_no = 1;
--1명의 회원 예약 목록 전부 삭제(예약상품목록도 전부 삭제)
delete reservation where m_id = 'aaa';
/*faq delete*/
--faq 자주찾는질문 삭제(관리자만 접근가능)
delete faq where f_no = 1;
/*qna delete*/
--상품문의 삭제
delete qna where q_no = 1;
/*review delete*/
--리뷰 삭제
delete review where rv_no = 1;
--select * from review;
--rollback; | true |
fb978b0f140b5fa0f8a737f0e4bdb36b9eb5204d | SQL | Praveenstein/musicSystem | /docs/chinook_additional_sql/q10_tracks_with_more_genre.sql | UTF-8 | 288 | 4.5625 | 5 | [] | no_license | SELECT DISTINCT
t.Name,
g.Name
FROM track t
INNER JOIN genre g
ON t.GenreId = g.GenreId
WHERE t.Name IN (SELECT
t.Name
FROM track t
GROUP BY t.Name
HAVING COUNT(DISTINCT t.GenreId) > 1
ORDER BY COUNT(DISTINCT t.GenreId) DESC, t.TrackId)
ORDER BY t.Name
LIMIT 20 | true |
e7b28be21ef3a0dd6a8c6265286057b99bab2c41 | SQL | 13141498695/gasxgj3iotyun | /jzkj-biz-admin/fileDocument/2019年1月10日gas3iotyundata.sql | UTF-8 | 12,088 | 3.078125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 172.26.28.204
Source Server Version : 50642
Source Host : 172.26.28.204:3306
Source Database : gas3iotyundata
Target Server Type : MYSQL
Target Server Version : 50642
File Encoding : 65001
Date: 2019-01-10 17:40:16
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for sys_box
-- ----------------------------
DROP TABLE IF EXISTS `sys_box`;
CREATE TABLE `sys_box` (
`box_id` varchar(100) NOT NULL COMMENT '箱子唯一id',
`box_version` varchar(100) DEFAULT NULL COMMENT '箱子版本',
`box_factory` varchar(100) DEFAULT NULL COMMENT '所属工厂',
`box_conpany` varchar(100) DEFAULT NULL COMMENT '所属公司',
`box_address` varchar(100) DEFAULT NULL COMMENT '箱子地址',
`box_name` varchar(100) DEFAULT NULL COMMENT '箱子名称',
`box_type` int(20) DEFAULT NULL COMMENT '箱子联系 1自建2,代管',
`box_time` datetime DEFAULT NULL COMMENT '创建时间',
`box_image` varchar(2000) DEFAULT NULL COMMENT '箱子图片',
`process drawing` varchar(2000) DEFAULT NULL COMMENT '工艺图 ,设计图',
PRIMARY KEY (`box_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`param_key` varchar(50) DEFAULT NULL COMMENT 'key',
`param_value` varchar(2000) DEFAULT NULL COMMENT 'value',
`status` tinyint(4) DEFAULT '1' COMMENT '状态 0:隐藏 1:显示',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`),
UNIQUE KEY `param_key` (`param_key`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='系统配置信息表';
-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
`dept_id` bigint(20) NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) DEFAULT NULL COMMENT '上级公司ID,一级公司为0',
`name` varchar(50) DEFAULT NULL COMMENT '公司名称',
`order_num` int(11) DEFAULT NULL COMMENT '排序',
`del_flag` tinyint(4) DEFAULT '0' COMMENT '是否删除 -1:已删除 0:正常',
PRIMARY KEY (`dept_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='公司管理';
-- ----------------------------
-- Table structure for sys_device
-- ----------------------------
DROP TABLE IF EXISTS `sys_device`;
CREATE TABLE `sys_device` (
`device_id` varchar(200) NOT NULL COMMENT '设备唯一标识',
`device_type` int(20) NOT NULL COMMENT '设备类型:0智能调压器1.采集仪',
`device_status` int(20) NOT NULL COMMENT '1使用2.停用',
`device_dtuid` varchar(100) DEFAULT NULL COMMENT 'DTU编号',
`sys_device_modellList` varchar(200) DEFAULT NULL COMMENT '选择模型(数据类型记录表)',
`device_road_id` varchar(200) DEFAULT NULL COMMENT '路信息外键',
`device_sysname` varchar(200) DEFAULT NULL COMMENT '系统展示名称',
`device_sim` varchar(200) DEFAULT NULL COMMENT 'sim卡编号',
`device_datatablename` varchar(200) DEFAULT NULL COMMENT '生成的表名',
`device_pic_phone` varchar(100) DEFAULT NULL COMMENT '负责人手机号',
`device_pic_email` varchar(100) DEFAULT NULL COMMENT '负责人邮箱',
`device_pic_weixin` varchar(100) DEFAULT NULL COMMENT '负责人微信',
`device_ uniqueNO` varchar(100) DEFAULT NULL COMMENT '硬件生成唯一编码',
`createtime` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sys_device_model_relation
-- ----------------------------
DROP TABLE IF EXISTS `sys_device_model_relation`;
CREATE TABLE `sys_device_model_relation` (
`device_model_id` varchar(100) NOT NULL DEFAULT '' COMMENT '唯一id',
`model_id` varchar(100) DEFAULT NULL COMMENT '模型关联id',
`device_id` varchar(100) NOT NULL DEFAULT '' COMMENT '设备关联id(就是采集仪)',
PRIMARY KEY (`device_model_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL COMMENT '字典名称',
`type` varchar(100) NOT NULL COMMENT '字典类型',
`code` varchar(100) NOT NULL COMMENT '字典码',
`value` varchar(1000) NOT NULL COMMENT '字典值',
`order_num` int(11) DEFAULT '0' COMMENT '排序',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(4) DEFAULT '0' COMMENT '删除标记 -1:已删除 0:正常',
PRIMARY KEY (`id`),
UNIQUE KEY `type` (`type`,`code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='数据字典表';
-- ----------------------------
-- Table structure for sys_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT NULL COMMENT '用户名',
`operation` varchar(50) DEFAULT NULL COMMENT '用户操作',
`method` varchar(200) DEFAULT NULL COMMENT '请求方法',
`params` varchar(5000) DEFAULT NULL COMMENT '请求参数',
`time` bigint(20) NOT NULL COMMENT '执行时长(毫秒)',
`ip` varchar(64) DEFAULT NULL COMMENT 'IP地址',
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COMMENT='系统日志';
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`menu_id` bigint(20) NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单ID,一级菜单为0',
`name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
`url` varchar(200) DEFAULT NULL COMMENT '菜单URL',
`perms` varchar(500) DEFAULT NULL COMMENT '授权(多个用逗号分隔,如:user:list,user:create)',
`type` int(11) DEFAULT NULL COMMENT '类型 0:目录 1:菜单 2:按钮',
`icon` varchar(50) DEFAULT NULL COMMENT '菜单图标',
`order_num` int(11) DEFAULT NULL COMMENT '排序',
PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8 COMMENT='菜单管理';
-- ----------------------------
-- Table structure for sys_model
-- ----------------------------
DROP TABLE IF EXISTS `sys_model`;
CREATE TABLE `sys_model` (
`model_id` varchar(100) NOT NULL COMMENT '唯一',
`model_name` varchar(50) NOT NULL COMMENT '模型名称',
`model_identifying` varchar(100) NOT NULL COMMENT '模型标识',
`model_datatype` varchar(100) NOT NULL COMMENT '数据类型',
`model_spam` varchar(100) NOT NULL COMMENT '取值范围',
`model_unit` varchar(255) DEFAULT NULL COMMENT '单位',
`model_readorwrite` int(30) DEFAULT NULL COMMENT '读写类型:0读写1只读',
`model_desc` varchar(200) DEFAULT NULL COMMENT '模型描述',
`createtime` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`model_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sys_oss
-- ----------------------------
DROP TABLE IF EXISTS `sys_oss`;
CREATE TABLE `sys_oss` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`url` varchar(200) DEFAULT NULL COMMENT 'URL地址',
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件上传';
-- ----------------------------
-- Table structure for sys_product
-- ----------------------------
DROP TABLE IF EXISTS `sys_product`;
CREATE TABLE `sys_product` (
`productId` varchar(100) NOT NULL COMMENT '产品id',
`product_name` varchar(100) DEFAULT NULL COMMENT '产品名称',
`version` varchar(100) DEFAULT NULL COMMENT '产品版本',
`nodetype` varchar(100) DEFAULT NULL COMMENT '节点类型',
`gateway` int(100) DEFAULT NULL COMMENT '是否接入网关 0是 1否 ',
`type_id` varchar(100) DEFAULT NULL COMMENT '产品类型id关联',
`network` int(100) DEFAULT NULL COMMENT '联网方式 1.3g 2.蜂巢 3.wifi',
`status` int(100) DEFAULT NULL COMMENT '0 .发布 1.未发布 2.发布中 3.下线',
`authentication` int(100) DEFAULT NULL COMMENT '是否id认证',
PRIMARY KEY (`productId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sys_product_type
-- ----------------------------
DROP TABLE IF EXISTS `sys_product_type`;
CREATE TABLE `sys_product_type` (
`product_type_id` varchar(255) NOT NULL COMMENT '唯一标识',
`product_type_name` varchar(255) DEFAULT NULL COMMENT '产品类型名称',
PRIMARY KEY (`product_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Table structure for sys_road
-- ----------------------------
DROP TABLE IF EXISTS `sys_road`;
CREATE TABLE `sys_road` (
`road_id` varchar(255) NOT NULL COMMENT '唯一标识',
`road_name` varchar(255) DEFAULT NULL COMMENT '路名称',
`road_desc` varchar(255) DEFAULT NULL COMMENT '路描述',
`road_box_id` varchar(255) DEFAULT NULL COMMENT '箱子外键',
`createtime` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`road_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`role_id` bigint(20) NOT NULL AUTO_INCREMENT,
`role_name` varchar(100) DEFAULT NULL COMMENT '角色名称',
`remark` varchar(100) DEFAULT NULL COMMENT '备注',
`dept_id` bigint(20) DEFAULT NULL COMMENT '公司ID',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='角色';
-- ----------------------------
-- Table structure for sys_role_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_dept`;
CREATE TABLE `sys_role_dept` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
`dept_id` bigint(20) DEFAULT NULL COMMENT '公司ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COMMENT='角色与公司对应关系';
-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
`menu_id` bigint(20) DEFAULT NULL COMMENT '菜单ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色与菜单对应关系';
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL COMMENT '用户名',
`password` varchar(100) DEFAULT NULL COMMENT '密码',
`salt` varchar(20) DEFAULT NULL COMMENT '盐',
`email` varchar(100) DEFAULT NULL COMMENT '邮箱',
`mobile` varchar(100) DEFAULT NULL COMMENT '手机号',
`status` tinyint(4) DEFAULT NULL COMMENT '状态 0:禁用 1:正常',
`dept_id` bigint(20) DEFAULT NULL COMMENT '公司ID',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`user_id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='系统用户';
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户与角色对应关系';
| true |
69246b639f35958b76bf674a2673214d7872fe94 | SQL | taipeifx/vote_data_TW | /2004_11/data cleaning 11.sql | UTF-8 | 3,852 | 3.8125 | 4 | [] | no_license | #EXPORT TO CSV FROM RESULTS FOR CLEANER DATA
################### DATA CLEANING #############################
#1 "attach elpaty to elcand"
CREATE TABLE cand_11 AS
SELECT elcand_11.CanNum, elcand_11.CanName, elcand_11.Sex, elcand_11.Age, elcand_11.CurInc, elpaty_9.PParty, elcand_11.RMate
FROM elcand_11
INNER JOIN elpaty_9
ON elcand_11.PPN = elpaty_9.PPN;
SELECT * FROM cand_11;
#join multiple rows into a single column (Pres, Vice Pres Cand in same row)
CREATE TABLE cand_11att AS
SELECT CanNum, PParty,
GROUP_CONCAT(CanName) AS CanNames
FROM cand_11
GROUP BY CanNum;
SELECT * FROM cand_11att;
#DROP TABLE cand_9att;
#2 "attach this cand_11att to elctks before cleaning"
CREATE TABLE tks_cand_11 AS
SELECT elctks_11.V1 , elctks_11.V2 , elctks_11.V3 , elctks_11.V4 , elctks_11.V5 , elctks_11.PollN, elctks_11.VotesGot , cand_11att.CanNames, cand_11att.PParty
FROM elctks_11
INNER JOIN cand_11att
ON elctks_11.CanNum = cand_11att.CanNum;
SELECT * FROM tks_cand_11;
#3 "tidyr spread() on elctks: CanNum to VotesGot (CanNum1 , 2, 3, 4 with VotesGot values"
#"tidyr spread() on elctks: CanNames + PParty to VotesGot (Candidates x 4 with VotesGot values"
#done in R, on tks_cand_xx , grab back tks_cand_xxus
CREATE TABLE `vote_data`.`tks_cand_11us` (
`V1` INT(2) NULL,
`V2` INT(3) NULL,
`V3` INT(2) NULL,
`V4` INT(3) NULL,
`V5` INT(4) NULL,
`PollN` INT(4) NULL,
`陳水扁 Chen Shui-bian, 呂秀蓮 Annette Lu: Dem.Prog.Party` INT(8) NULL,
`連戰 Lien Chan, 宋楚瑜 James Soong: Kuo.Min.Tang` INT(8) NULL
)
DEFAULT CHARACTER SET = utf8;
LOAD DATA INFILE 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/11/tks_cand_11us.csv' #change
INTO TABLE tks_cand_11us #change
FIELDS TERMINATED BY ','
IGNORE 1 lines; #ignore column names
SELECT * FROM tks_cand_11us;
#4 "clean up elprof as elprof_9c and attach tks_cand_9us to it"
CREATE TABLE elprof_11c AS
SELECT elprof_11.V1, elprof_11.V2, elprof_11.V3, elprof_11.V4, elprof_11.V5, elprof_11.PollN, elprof_11.ValidBallot, elprof_11.InvalBallot,
elprof_11.TotalVote, elprof_11.EligVoter, elprof_11.TotalPop, elprof_11.PerEligVoter, elprof_11.PerActVote
FROM elprof_11;
SELECT * FROM elprof_11c;
#attaching elprof_9c and tks_cand_9us
CREATE TABLE prof_tks_cand_11 AS
SELECT elprof_11c.V1, elprof_11c.V2, elprof_11c.V3, elprof_11c.V4, elprof_11c.V5, elprof_11c.PollN, elprof_11c.ValidBallot, elprof_11c.InvalBallot,
elprof_11c.TotalVote, elprof_11c.EligVoter, elprof_11c.TotalPop, elprof_11c.PerEligVoter, elprof_11c.PerActVote,
tks_cand_11us.`陳水扁 Chen Shui-bian, 呂秀蓮 Annette Lu: Dem.Prog.Party`,
tks_cand_11us.`連戰 Lien Chan, 宋楚瑜 James Soong: Kuo.Min.Tang`
FROM elprof_11c
INNER JOIN tks_cand_11us
ON elprof_11c.V1 = tks_cand_11us.V1 AND elprof_11c.V2 = tks_cand_11us.V2 AND elprof_11c.V3 = tks_cand_11us.V3 AND
elprof_11c.V4 = tks_cand_11us.V4 AND elprof_11c.V5 = tks_cand_11us.V5 AND elprof_11c.PollN = tks_cand_11us.PollN;
SELECT * FROM prof_tks_cand_11;
#5 "attach elbase last?" yes, attach elbase_9a to prof_tks_cand_9 on V1:V5. selecting both elbase_9a.AName and elbase_9a.ANameE
SELECT * FROM elbase_11a;
#CREATE TABLE final_11 AS
SELECT DISTINCT prof_tks_cand_11.PollN, prof_tks_cand_11.ValidBallot, prof_tks_cand_11.InvalBallot,
prof_tks_cand_11.TotalVote, prof_tks_cand_11.EligVoter, prof_tks_cand_11.TotalPop, prof_tks_cand_11.PerEligVoter, prof_tks_cand_11.PerActVote,
prof_tks_cand_11.`陳水扁 Chen Shui-bian, 呂秀蓮 Annette Lu: Dem.Prog.Party`,
prof_tks_cand_11.`連戰 Lien Chan, 宋楚瑜 James Soong: Kuo.Min.Tang`,
elbase_11a.AName, elbase_11a.ANameE
FROM prof_tks_cand_11
INNER JOIN elbase_11a
ON prof_tks_cand_11.V1 = elbase_11a.V1 AND prof_tks_cand_11.V2 = elbase_11a.V2 AND prof_tks_cand_11.V3 = elbase_11a.V3 AND prof_tks_cand_11.V4 = elbase_11a.V4 AND prof_tks_cand_11.V5 = elbase_11a.V5;
#select distinct for 20503 rows return, there are 33? repeats for some reason
| true |
18b560e978a5e6394733f9334f7f12165046bfbe | SQL | AbdulKanjo/TutorzWay | /db/schema.sql | UTF-8 | 596 | 2.828125 | 3 | [] | no_license | CREATE TABLE students
(
student_id SERIAL PRIMARY KEY NOT NULL,
first_name varchar(40),
last_name varchar(40),
location varchar(80),
age integer,
grade integer,
description varchar(40),
picture text,
favorite_tutor varchar(40),
favorite_subjects varchar(40)
);
CREATE TABLE tutor
(
tutor_id SERIAL PRIMARY KEY,
first_name character varying(40),
last_name character varying(40),
location character varying(80),
age integer,
years_experience integer,
class_subject character varying(40),
picture text,
coordinates text
); | true |
2f7f0a5d93d0fbc2af9e2a63124b82d35805dc52 | SQL | sedc-codecademy/skwd8-07-dbdevdesign | /g3/Session 7/additonal scripts/session 7 - retrospective.sql | UTF-8 | 731 | 3.765625 | 4 | [
"MIT"
] | permissive |
CREATE VIEW vv_OpstPregledPoVraboten
AS
SELECT e.FirstName+' '+e.LastName as imeiprezime, o.TotalPrice, c.Name as custmerName,
b.Name as BEName, b.Region as BERegion, STRING_AGG(p.Name,',') as ProduktiVoNaracka,
STRING_AGG(CAST(p.price as VARCHAR(10)),',') as cenipoprodukti, SUM(od.quantity) as Quantity
FROM Employee e
INNER JOIN dbo.[Order] o ON e.id = o.EmployeeId
INNER JOIN Customer c ON c.id = o.CustomerId
INNER JOIN BusinessEntity b ON b.id = o.BusinessEntityId
INNER JOIN OrderDetails od ON od.OrderId = o.Id
INNER JOIN Product p ON p.id = od.ProductId
WHERE o.EmployeeId=1
GROUP BY e.FirstName+' '+e.LastName, o.TotalPrice, c.Name, b.Name, b.Region
HAVING SUM(od.quantity)>5
SELECT * FROM vv_OpstPregledPoVraboten | true |
ec220fe4fc41abbc2befa90781abd94e37009f78 | SQL | dacamor/chinook | /sales_agent_invoices.sql | UTF-8 | 208 | 3.15625 | 3 | [] | no_license | Select Employee.FirstName || " " || Employee.LastName as FullName, Invoice.*
from invoice
join customer on invoice.CustomerId = Customer.CustomerId
join Employee on Customer.SupportRepId = Employee.EmployeeId | true |
2fc1e6025550b8c03ffdbab8e7d543538ad8d290 | SQL | Annelies-P/kaleidos-legacy-conversion | /src/convertor/lib/queries/themes.sql | UTF-8 | 178 | 2.59375 | 3 | [] | no_license | SELECT
taxonomy_term_data.tid as id,
taxonomy_term_data.name as name,
taxonomy_term_data.description as description
FROM
`taxonomy_term_data`
WHERE
`vid` = '2'
ORDER BY
`tid`;
| true |
bd9d2786306336deddb517da151c77d8775b3377 | SQL | Edison1007/Examen_Peliculas | /PELIS.sql | UTF-8 | 2,135 | 3.625 | 4 | [] | no_license | DROP DATABASE IF EXISTS videoclub;
CREATE DATABASE IF NOT EXISTS videoclub;
USE videoclub;
CREATE TABLE peliculas(
cod_pelicula INT PRIMARY KEY AUTO_INCREMENT,
titulo VARCHAR(100),
genero VARCHAR(100),
pais VARCHAR(100),
anyo INT
);
CREATE TABLE personas(
cod_persona INT PRIMARY KEY AUTO_INCREMENT,
nombre VARCHAR(100),
apellidos VARCHAR(150),
pais VARCHAR(100)
);
CREATE TABLE actuan(
cod_pelicula INT,
cod_persona INT,
PRIMARY KEY (cod_pelicula, cod_persona),
FOREIGN KEY (cod_pelicula) REFERENCES peliculas(cod_pelicula) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (cod_persona) REFERENCES personas(cod_persona) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE usuarios(
id INT PRIMARY KEY AUTO_INCREMENT,
usuario VARCHAR(20) UNIQUE,
pass VARCHAR(50)
);
-- Muestra de películas
INSERT INTO peliculas(titulo, genero, pais, anyo) VALUES ('Der Baader Meinhof Komplex', 'histórica', 'Alemania', 2008);
INSERT INTO peliculas(titulo, genero, pais, anyo) VALUES ('V for Vendetta', 'Acción', 'Estados Unidos', 2006);
-- Muestra de personas
INSERT INTO personas(nombre, apellidos, pais) VALUES ('Hugo', 'Wallace Weaving', 'Inglaterra');
INSERT INTO personas(nombre, apellidos, pais) VALUES ('Johanna', 'Wokalek', 'Alemania');
INSERT INTO personas(nombre, apellidos, pais) VALUES ('John', 'Hurt', 'Inglaterra');
INSERT INTO personas(nombre, apellidos, pais) VALUES ('Moritz', 'Bleibtreu', 'Alemania');
INSERT INTO personas(nombre, apellidos, pais) VALUES ('Natalie', 'Portman', 'Israel');
INSERT INTO personas(nombre, apellidos, pais) VALUES ('Stephen', 'Rea', 'Irlanda');
-- Muestra de relaciones entre películas y personas
INSERT INTO actuan(cod_pelicula, cod_persona) VALUES (1, 2);
INSERT INTO actuan(cod_pelicula, cod_persona) VALUES (1, 4);
INSERT INTO actuan(cod_pelicula, cod_persona) VALUES (2, 1);
INSERT INTO actuan(cod_pelicula, cod_persona) VALUES (2, 3);
INSERT INTO actuan(cod_pelicula, cod_persona) VALUES (2, 5);
INSERT INTO actuan(cod_pelicula, cod_persona) VALUES (2, 6);
-- Usuario sin contraseña para realizar pruebas
INSERT INTO usuarios VALUES (1, '', ''); | true |
193fcfcb4408b6bbf5a611ba846c498eacf744d2 | SQL | morgangiraud/ecvd-php | /finaltest/rouksana/chat/mysql.sql | UTF-8 | 508 | 3.015625 | 3 | [
"MIT"
] | permissive | CREATE DATABASE ecvchat;
USE ecvchat;
CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT,
email VARCHAR(255),
username VARCHAR(255),
password VARCHAR(255),
photo_id INT,
PRIMARY KEY (ID)
);
CREATE TABLE files (
id INT NOT NULL AUTO_INCREMENT,
filename VARCHAR(255),
path VARCHAR(255),
extension VARCHAR(255),
PRIMARY KEY (ID)
);
CREATE TABLE messages (
id INT NOT NULL AUTO_INCREMENT,
message VARCHAR(255),
created_at DATETIME NOT NULL DEFAULT NOW(),
user_id INT,
PRIMARY KEY (ID)
); | true |
c5bf5bcb143e276833028b8895009e346a6a4a8f | SQL | n2parko/abstract-capital | /sql examples/weekly-spending.sql | UTF-8 | 167 | 3.296875 | 3 | [
"MIT"
] | permissive | select date_trunc(date, week) as week, sum(amount) as weekly_spending
from prototype.transactions_view
where date >= '2020-07-31'
and amount > 0
group by 1
order by 1 | true |
e3a63cb5ffa36f3a42de875838be9c8cea5ffc6c | SQL | ThibautJoub/gsbfraisth | /sql/3_creations_status_fiche_hors_forfait.sql | UTF-8 | 1,271 | 3.515625 | 4 | [] | no_license | 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 */;
--
-- Structure de la table `StatutHorsForfait`
--
CREATE TABLE IF NOT EXISTS `StatutHorsForfait` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`libelle` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `StatutHorsForfait`
--
INSERT INTO `StatutHorsForfait` (`id`, `libelle`) VALUES
(1, 'En attente des justificatifs'),
(2, 'Validée'),
(3, 'Remboursée'),
(4, 'Refusée');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
ALTER TABLE `LigneFraisHorsForfait` ADD `statut` INT(11) NOT NULL DEFAULT 1;
ALTER TABLE `LigneFraisHorsForfait` ADD CONSTRAINT `FK_LigneHorsForfait_StatutHorsForfait` FOREIGN KEY (`statut`) REFERENCES `StatutHorsForfait`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
| true |
f5e4a85769139d328f8cb5f7c74ee2b8eb117ed5 | SQL | agencia-desigual/sistema-contatos-producao | /documents/database/create.sql | UTF-8 | 2,035 | 3.890625 | 4 | [] | no_license | CREATE TABLE usuario(
id_usuario INT NOT NULL AUTO_INCREMENT,
nome VARCHAR(100) NOT NULL,
email VARCHAR(150) NOT NULL,
senha VARCHAR(150) NOT NULL,
status BOOLEAN NOT NULL DEFAULT true,
cadastro TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id_usuario)
);
CREATE TABLE token(
id_token INT NOT NULL AUTO_INCREMENT,
id_usuario INT NOT NULL,
token TEXT NOT NULL,
ip VARCHAR(100) NOT NULL,
data_expira TIMESTAMP NOT NULL,
data TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id_token),
FOREIGN KEY (id_usuario) REFERENCES usuario(id_usuario)
);
CREATE TABLE categoria(
id_categoria INT NOT NULL AUTO_INCREMENT,
nome VARCHAR(150) NOT NULL,
PRIMARY KEY (id_categoria)
);
CREATE TABLE fornecedor (
id_fornecedor INT NOT NULL AUTO_INCREMENT,
id_categoria INT NOT NULL,
nome VARCHAR(100) NOT NULL,
observacao TEXT NULL DEFAULT NULL,
telefone TEXT NULL DEFAULT NULL,
cidade VARCHAR(150) NULL DEFAULT NULL,
email VARCHAR(150) NULL DEFAULT NULL,
PRIMARY KEY (id_fornecedor),
FOREIGN KEY (id_categoria) REFERENCES categoria(id_categoria)
);
CREATE TABLE modelo(
id_modelo INT NOT NULL AUTO_INCREMENT,
nome VARCHAR(150) NOT NULL,
cpf VARCHAR(100) NULL DEFAULT NULL,
dataNascimento DATE NOT NULL,
sexo ENUM('masculino', 'feminino') NOT NULL,
atuacao TEXT NULL DEFAULT NULL,
etnia TEXT NULL DEFAULT NULL,
manequim VARCHAR(50) NULL DEFAULT NULL,
altura VARCHAR(50) NULL DEFAULT NULL,
calcado VARCHAR(50) NULL DEFAULT NULL,
telefone TEXT NULL DEFAULT NULL,
estado VARCHAR(3) NOT NULL,
cidade VARCHAR(150) NOT NULL,
canal ENUM('site', 'sistema') NOT NULL DEFAULT 'sistema',
cadastro TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id_modelo)
);
CREATE TABLE foto(
id_foto INT NOT NULL AUTO_INCREMENT,
id_modelo INT NOT NULL,
imagem VARCHAR(150) NOT NULL,
PRIMARY KEY (id_foto),
FOREIGN KEY (id_modelo) REFERENCES modelo (id_modelo)
);
| true |
610c07b2123464b975818d8276abfb7b11f9bd38 | SQL | eveisesi/athena | /.config/migrations/20210205232929_member_jump_clones.up.sql | UTF-8 | 587 | 3 | 3 | [
"MIT"
] | permissive | CREATE TABLE `member_jump_clones` (
`member_id` INT UNSIGNED NOT NULL,
`jump_clone_id` INT UNSIGNED NOT NULL,
`location_id` BIGINT UNSIGNED NOT NULL,
`location_type` ENUM('station', 'structure') NOT NULL,
`implants` JSON NOT NULL,
`created_at` TIMESTAMP NOT NULL,
`updated_at` TIMESTAMP NOT NULL,
PRIMARY KEY (`member_id`, `jump_clone_id`) USING BTREE,
CONSTRAINT `member_jump_clones_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `athena`.`members` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
) COLLATE = 'utf8mb4_unicode_ci' ENGINE = InnoDB; | true |
35e7251df62fc1d8b569b86f6d1da12167fafb13 | SQL | realtechz/IBM-Data-Science-Files | /5.Databases_and_SQL_for_Data_Science/Week 2 - Advanced SQL/1. String Patterns, Ranges, Sorting, and Grouping/wk2q3.sql | UTF-8 | 147 | 2.640625 | 3 | [
"MIT"
] | permissive | -- RETRIEVE ALL EMPLOYEES IN DEPARTMENT 5 WHOSE SALARY IS BETWEEN
-- 60000 AND 70000
SELECT * FROM EMPLOYEES
WHERE SALARY BETWEEN 60000 AND 70000; | true |
5fa4eccb806a8b8bc44fab895c86e5efb1a630a6 | SQL | oscar0812/BookZale | /data/bookStore.sql | UTF-8 | 7,195 | 3.3125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 07, 2018 at 03:44 AM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.9
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: `bookStore`
--
-- --------------------------------------------------------
--
-- Table structure for table `book`
--
CREATE TABLE `book` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`price` double(8,2) NOT NULL,
`description` varchar(4098) NOT NULL,
`image_url` varchar(128) NOT NULL,
`category_id` int(11) NOT NULL,
`posted_by` int(11) NOT NULL,
`sold` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `book`
--
INSERT INTO `book` (`id`, `name`, `price`, `description`, `image_url`, `category_id`, `posted_by`, `sold`) VALUES
(1, 'Harry potter and the sorcerer\'s stone', 50.00, 'Excellent condition. Need money.', 'https://images-na.ssl-images-amazon.com/images/I/51HSkTKlauL._SX346_BO1,204,203,200_.jpg', 13, 1, 0),
(2, 'Biology Book for 1301 students', 100.00, 'Ok condition, has some tear and wear, dont need it anymore.', 'https://www.pearsonhighered.com/assets/bigcovers/0/8/0/5/0805366245.jpg', 1, 1, 0),
(3, 'Horton hears a who', 10.00, 'For kids', 'https://images-na.ssl-images-amazon.com/images/I/51AdV1UFjQL._SX365_BO1,204,203,200_.jpg', 13, 1, 0),
(4, '1984', 20.00, 'Very interesting read.', 'https://images-na.ssl-images-amazon.com/images/I/514CVwOrybL._SX333_BO1,204,203,200_.jpg', 11, 1, 0),
(5, 'Fahrenheit 451', 80.00, 'They burn books in this book...', 'https://images-na.ssl-images-amazon.com/images/I/61MvIVaurSL.jpg', 11, 1, 0),
(6, 'Of Mice and Men', 5.00, 'How could he shoot lenny??!', 'https://images-na.ssl-images-amazon.com/images/I/51wuHv30-ML._SX359_BO1,204,203,200_.jpg', 12, 1, 0),
(7, 'Hunger Games: Mockingjay', 20.00, 'KATNISS!', 'https://images-na.ssl-images-amazon.com/images/I/71X7lgH1nRL.jpg', 11, 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
CREATE TABLE `category` (
`id` int(11) NOT NULL,
`parent` int(11) NOT NULL,
`name` varchar(32) NOT NULL,
`description` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `parent`, `name`, `description`) VALUES
(1, 0, 'Students', 'Books required by your school, sold by other students.'),
(2, 0, 'Nonfiction', 'Prose writing that is based on facts, real events, and real people, such as biography or history.'),
(3, 0, 'Fiction', 'Prose, especially short stories and novels, that describes imaginary events and people.'),
(4, 0, 'Foklore', 'The traditional beliefs, customs, and stories of a community, passed through the generations by word of mouth.'),
(5, 0, 'Drama', 'A composition in prose or verse presenting in dialogue or pantomime a story involving conflict or contrast of character.'),
(6, 2, 'Persuasive Writing', 'Presenting reasons and examples to influence action or thought.'),
(7, 2, 'Informative Writing', 'Soul purpose of educating on a certain topic.'),
(8, 2, 'Autobiography', 'An account of a person\'s life written by that person.'),
(9, 2, 'Biography', 'An account of someone\'s life written by someone else.'),
(10, 3, 'Historical Fiction', 'A story that is made up but is set in the past and sometimes borrows true characteristics of the time period in which it is set.'),
(11, 3, 'Science Fiction', 'Imagined future scientific or technological advances and major social or environmental changes, frequently portraying space or time travel and life on other planets.'),
(12, 3, 'Realistic Fiction', 'Consisting of stories that could have actually occurred to people or animals in a believable setting. '),
(13, 3, 'Fantasy', 'Contains a plot that cannot occur in the real world. Its plot usually involves witchcraft or magic, taking place on an undiscovered planet of an unknown world.'),
(14, 4, 'Fable', 'A fictional story that features animals, legendary creatures, plants, inanimate objects, or forces of nature that are anthropomorphized and that illustrates or leads to a particular moral lesson.'),
(15, 4, 'Myth', 'A legendary or a traditional story that usually concerns an event or a hero, with or without using factual or real explanations.'),
(16, 4, 'Tall Tale', 'A story with unbelievable elements, related as if it were true and factual. '),
(17, 4, 'Legend', 'A traditional story or group of stories told about a particular person or place.'),
(18, 4, 'Fairytale', 'A short story that typically features entities such as dwarfs, dragons, elves, fairies, giants, gnomes, goblins, griffins, mermaids, talking animals, trolls, unicorns, or witches, and usually magic or enchantments.'),
(19, 5, 'Comedy', 'A type of dramatic work that is amusing and satirical in its tone, mostly having a cheerful ending. '),
(20, 5, 'Tragedy', 'The main character is brought to ruin or suffers extreme sorrow, especially as a consequence of a tragic flaw, moral weakness, or inability to cope with unfavorable circumstances.');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`email` varchar(64) NOT NULL,
`password` varchar(128) NOT NULL,
`date_joined` int(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `name`, `email`, `password`, `date_joined`) VALUES
(1, 'Oscar R Torres', 'oscar0812torres@gmail.com', '$2a$12$9I4hqDmeComM0x0gJV27muYZ0QbAYz0k9BENuYI7IghHXXngLY/oO', 1525413600);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `book`
--
ALTER TABLE `book`
ADD PRIMARY KEY (`id`),
ADD KEY `posted_by` (`posted_by`),
ADD KEY `category_id` (`category_id`);
--
-- Indexes for table `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `book`
--
ALTER TABLE `book`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `book`
--
ALTER TABLE `book`
ADD CONSTRAINT `book_ibfk_1` FOREIGN KEY (`posted_by`) REFERENCES `user` (`id`),
ADD CONSTRAINT `book_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
0bcca460c9a5e78b674407c96da2f6ece9d4f2ec | SQL | gwrippee/SQL-SSRS | /Inside Sales - Customer Service/Samples/JT_DroppedSamplesJohnB.sql | UTF-8 | 1,070 | 3.046875 | 3 | [] | no_license | /*********************************************************************************
** **
** SR# 13712 **
** Programmer: James Tuttle Date: 08/26/2013 **
** ---------------------------------------------------------------------------- **
** Purpose: All samples/display for 001-50 and 002-41 that **
** have QOH > 0 **
** **
** **
** **
** **
**********************************************************************************/
ALTER PROC JT_DroppedSamplesJohnB AS
BEGIN
SELECT idco AS [Co]
,idloc AS [Loc]
,iditem AS [Item]
,iddesc AS [Description]
,idqoh AS [QOH]
,idbin AS [Bin]
FROM OPENQUERY(GSFL2K,
'SELECT idco
,idloc
,iditem
,iddesc
,idqoh
,idbin
,IdFCRG
,imdrop
FROM itemdetl id
LEFT JOIN itemmast im ON im.imitem = id.iditem
WHERE id.idloc IN (41,50)
AND id.idfcrg = ''S''
AND im.imdrop = ''D''
ORDER BY id.idco
,id.idloc
')
END | true |
5e1ae2025cac710c95101f32606dd8e0a7ace64e | SQL | efaro2014/Dojo-Assignments | /webfun/databases/world.sql | UTF-8 | 655 | 3.859375 | 4 | [] | no_license | SELECT countries.name, languages.language, languages.percentage
From countries
JOIN languages
ON languages.country_id=countries.id
WHERE languages.language='Slovene'
ORDER BY languages.percentage DESC;
SELECT countries.name, count(*)
From cities
left JOIN countries
ON cities.country_id=countries.id;
SELECT cities.name, cities.population
From cities
join countries on
cities.country_id= countries.id
WHERE countries.name ='Mexico' and cities.population >500000;
SELECT countries.name, langauges.language, languages.percentage
From languages
left join countries on
languages.country_id= countries.id
WHERE languages.percentage > '89%';
| true |
c50340e762fd3560b7a07fece7a96dd3564659e3 | SQL | pntlong/Demo-Spring | /src/main/resources/db/migration/V1__init.sql | UTF-8 | 2,147 | 3.625 | 4 | [] | no_license | create extension if not exists "uuid-ossp";
create table account
(
id uuid not null default uuid_generate_v4() primary key,
account_name varchar(255) not null,
password varchar(255) not null,
role varchar not null,
created_date timestamp not null default now(),
last_updated timestamp not null default now()
);
create table employee
(
id uuid not null default uuid_generate_v4() primary key,
first_name varchar(255) not null,
last_name varchar(255) not null,
email varchar(255) not null,
age varchar(255) not null,
role varchar not null,
created_date timestamp not null default now(),
last_updated timestamp not null default now()
);
create table account_employee
(
id uuid not null default uuid_generate_v4() primary key,
account_id uuid not null,
employee_id uuid not null,
created_date timestamp not null default now(),
last_updated timestamp not null default now(),
foreign key (account_id) references account (id) on delete cascade,
foreign key (employee_id) references employee (id) on delete cascade
);
create table application_user
(
id uuid not null default uuid_generate_v4() primary key,
employee_id uuid unique not null,
username varchar(255) unique not null,
password varchar(128) not null,
verified boolean not null,
created_date timestamp not null default now(),
last_updated timestamp not null default now(),
foreign key (employee_id) references employee (id) on delete cascade
);
create table temperature
(
id uuid not null default uuid_generate_v4() primary key,
employee_id uuid unique not null,
temperature_value decimal(15, 2) not null default 0.00,
created_date timestamp not null default now(),
last_updated timestamp not null default now(),
foreign key (employee_id) references employee (id) on delete cascade
); | true |
ace1da20828e597e3d82219ccb4f8ea69d0a7961 | SQL | wylyandrews/QuiziCool | /Database/Test_Procedure_Calls.sql | UTF-8 | 2,456 | 3.15625 | 3 | [] | no_license | -- QuiziCool --
-- A database project --
-- Wyly Andrews, Riley Abrahamson, and Dawson Coleman --
-- sql page for running test procedures --
-- Created on: April 12, 2019 --
-- Last updated on: April 30, 2019 --
CALL generate_question('Does this procedure have way too many arguments?', 'C', 'Test Category', 1, 'No', 'Never', 'Definitely', 'This one is off the screen');
CALL generate_category('Fruit Facts', 'QuizBot', 'This is your chance to prove your juicy knowledge!');
CALL generate_question('Which of the following is a fruit?', 'B', 'Fruit Facts', 1, 'Broccoli', 'Tomato', 'Cabbage', 'Carrot');
CALL generate_question('Which of the following is considered a berry?', 'D', 'Fruit Facts', 2, 'Strawberry', 'Apple', 'Pear', 'Banana');
CALL generate_question('What is the study of fruits?', 'A', 'Fruit Facts', 1, 'Pomology', 'Trophort', 'Floriculture', 'Botany' );
CALL generate_question('Which is NOT a fruit?', 'A', 'Fruit Facts', 1, 'Beet', 'Coconut', 'Eggplant', 'Starfruit' );
CALL generate_category('Rock''n'' Roll', 'QuizBot', 'Are you ready to rock?' );
CALL generate_question('Who was the lead singer of Aerosmith?', 'D', 'Rock''n'' Roll', 1, 'Slash', 'Gene Simmons', 'Johnny Depp', 'Steven Tyler');
CALL generate_question('Who was the original writer of the 1995 song "Hurt"?', 'C', 'Rock''n'' Roll', 2, 'Johnny Cash', 'Bob Dylan', 'Trent Reznor', 'Freddie Mercury');
CALL generate_question('Which musical group has NOT made a concept album?', 'D', 'Rock''n'' Roll', 1, 'Pink Floyd', 'David Bowie', 'The Beatles', 'Queen' );
CALL generate_category('Star Wars', 'QuizBot', 'May the force be with you in this quiz about Star Wars!');
CALL generate_question('How many movies are in the original trilogy?', 'A', 'Star Wars', 0, '1', '2', '3', '4' );
CALL generate_question('Which character is NOT a jedi master?', 'B', 'Star Wars', 0, 'Obi-Wan Kenobi', 'Anakin Skywalker', 'Qui-Gon Jinn', 'Yoda');
CALL generate_question('What is Luke Skywalker''s callsign?' , 'B', 'Star Wars', 2, 'Blue Three', 'Red Five', 'Green Seven', 'Yellow Nine');
CALL new_score(-1, 1, 10, 2); -- invalid playerID
CALL new_score(1, -1, 10, 2); -- invalid categoryID
CALL new_score(1, 1, 1000, 2); -- invalid score
CALL new_score(1, 1, -1, 2); -- invalid score
CALL new_score(1, 1, 10, 10); -- invalid correct answers
CALL new_score(1, 1, 10, 2); -- functional
CALL new_score(1, 3, 40, 3); -- functional | true |
d42b5dbf9cf86c4c4e3ebfcd3bfdae911e130733 | SQL | MaySkye/fiber-monitor-system-server | /src/main/resources/db-back/fiber_monitor_system.sql | UTF-8 | 22,158 | 3.265625 | 3 | [] | no_license |
CREATE DATABASE `fiber_monitor_system` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
grant all PRIVILEGES on fiber_monitor_system.* to root@'%' identified by '123456';
flush privileges;
use fiber_monitor_system;
set session sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
/*
Navicat Premium Data Transfer
Source Server : 本机
Source Server Type : MySQL
Source Server Version : 80017
Source Host : localhost:3306
Source Schema : fiber_monitor_system
Target Server Type : MySQL
Target Server Version : 80017
File Encoding : 65001
Date: 17/06/2021 23:14:29
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for alarm_device
-- ----------------------------
DROP TABLE IF EXISTS `alarm_device`;
CREATE TABLE `alarm_device` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`alarm_value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`device_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fault_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`alarm_lower_limit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`resource_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`site_name` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` tinyint(4) DEFAULT 0,
`timestamp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`alarm_upper_limit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for databasechangelog
-- ----------------------------
DROP TABLE IF EXISTS `databasechangelog`;
CREATE TABLE `databasechangelog` (
`ID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`AUTHOR` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`FILENAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`DATEEXECUTED` datetime(0) NOT NULL,
`ORDEREXECUTED` int(11) NOT NULL,
`EXECTYPE` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`MD5SUM` varchar(35) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`DESCRIPTION` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`COMMENTS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`TAG` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`LIQUIBASE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`CONTEXTS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`LABELS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`DEPLOYMENT_ID` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of databasechangelog
-- ----------------------------
INSERT INTO `databasechangelog` VALUES ('00000000000001', 'jhipster', 'config/liquibase/changelog/00000000000000_initial_schema.xml', '2019-06-03 16:05:33', 1, 'EXECUTED', '7:4d85236a8667651805fef548ed3c68ea', 'createTable tableName=jhi_user; createTable tableName=jhi_authority; createTable tableName=jhi_user_authority; addPrimaryKey tableName=jhi_user_authority; addForeignKeyConstraint baseTableName=jhi_user_authority, constraintName=fk_authority_name, ...', '', NULL, '3.5.4', NULL, NULL, '9549132544');
INSERT INTO `databasechangelog` VALUES ('00000000000002', 'jhipster', 'config/liquibase/changelog/00000000000000_initial_schema.xml', '2019-06-27 17:27:33', 2, 'EXECUTED', '7:93e3a09dd8d4e15ae9ad4a3c483133e0', 'createTable tableName=jhi_date_time_wrapper', '', NULL, '3.5.4', 'test', NULL, '1627653069');
-- ----------------------------
-- Table structure for databasechangeloglock
-- ----------------------------
DROP TABLE IF EXISTS `databasechangeloglock`;
CREATE TABLE `databasechangeloglock` (
`ID` int(11) NOT NULL,
`LOCKED` bit(1) NOT NULL,
`LOCKGRANTED` datetime(0) DEFAULT NULL,
`LOCKEDBY` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of databasechangeloglock
-- ----------------------------
INSERT INTO `databasechangeloglock` VALUES (1, b'0', NULL, NULL);
-- ----------------------------
-- Table structure for jhi_authority
-- ----------------------------
DROP TABLE IF EXISTS `jhi_authority`;
CREATE TABLE `jhi_authority` (
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of jhi_authority
-- ----------------------------
INSERT INTO `jhi_authority` VALUES ('ROLE_ADMIN');
INSERT INTO `jhi_authority` VALUES ('ROLE_MONITOR');
INSERT INTO `jhi_authority` VALUES ('ROLE_USER');
-- ----------------------------
-- Table structure for jhi_persistent_audit_event
-- ----------------------------
DROP TABLE IF EXISTS `jhi_persistent_audit_event`;
CREATE TABLE `jhi_persistent_audit_event` (
`event_id` bigint(20) NOT NULL AUTO_INCREMENT,
`event_date` datetime(0) DEFAULT NULL,
`event_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`principal` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`event_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for jhi_persistent_audit_evt_data
-- ----------------------------
DROP TABLE IF EXISTS `jhi_persistent_audit_evt_data`;
CREATE TABLE `jhi_persistent_audit_evt_data` (
`event_id` bigint(20) NOT NULL,
`value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`event_id`, `name`) USING BTREE,
CONSTRAINT `FK2ehnyx2si4tjd2nt4q7y40v8m` FOREIGN KEY (`event_id`) REFERENCES `jhi_persistent_audit_event` (`event_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for jhi_user
-- ----------------------------
DROP TABLE IF EXISTS `jhi_user`;
CREATE TABLE `jhi_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`login` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`password_hash` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`first_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`last_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`email` varchar(254) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`image_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`activated` bit(1) NOT NULL,
`lang_key` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`activation_key` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`reset_key` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`created_date` timestamp(0),
`reset_date` timestamp(0),
`last_modified_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`last_modified_date` timestamp(0),
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `ux_user_login`(`login`) USING BTREE,
UNIQUE INDEX `ux_user_email`(`email`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of jhi_user
-- ----------------------------
INSERT INTO `jhi_user` VALUES (2, 'anonymoususer', '$2a$10$j8S5d7Sr7.8VTOYNviDPOeWX8KcYILUVJBsYV83Y5NtECayypx9lO', 'Anonymous', 'User', 'anonymous@localhost', '', b'1', 'zh-cn', NULL, NULL, 'system', NULL, NULL, 'system', NULL);
INSERT INTO `jhi_user` VALUES (3, 'admin', '$2a$10$gSAhZrxMllrbgj/kkK9UceBPpChGWJA7SYIb1Mqo.n5aNLq1/oRrC', 'Administrator', 'Administrator', '527966005@qq.com', '', b'1', 'zh-cn', NULL, '34969480582853358552', 'system', NULL, '2020-05-12 07:30:34', 'anonymousUser', '2020-05-12 07:30:34');
INSERT INTO `jhi_user` VALUES (9, 'wangwei', '$2a$10$4n9m73y0DKePqrvAjU3q5..zU5Wq8kvZU0LojaLkqfItSHcM8UREe', '伟', '王', '550443096@qq.com', NULL, b'1', 'zh-cn', '23962320755844611968', NULL, 'anonymousUser', '2020-05-13 08:25:10', NULL, 'wangwei', '2020-06-13 08:05:45');
-- ----------------------------
-- Table structure for jhi_user_authority
-- ----------------------------
DROP TABLE IF EXISTS `jhi_user_authority`;
CREATE TABLE `jhi_user_authority` (
`user_id` bigint(20) NOT NULL,
`authority_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`user_id`, `authority_name`) USING BTREE,
INDEX `fk_authority_name`(`authority_name`) USING BTREE,
CONSTRAINT `fk_authority_name` FOREIGN KEY (`authority_name`) REFERENCES `jhi_authority` (`name`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `jhi_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of jhi_user_authority
-- ----------------------------
INSERT INTO `jhi_user_authority` VALUES (3, 'ROLE_ADMIN');
INSERT INTO `jhi_user_authority` VALUES (9, 'ROLE_ADMIN');
INSERT INTO `jhi_user_authority` VALUES (9, 'ROLE_MONITOR');
INSERT INTO `jhi_user_authority` VALUES (3, 'ROLE_USER');
INSERT INTO `jhi_user_authority` VALUES (9, 'ROLE_USER');
-- ----------------------------
-- Table structure for site
-- ----------------------------
DROP TABLE IF EXISTS `site`;
CREATE TABLE `site` (
`site_id` int(255) NOT NULL AUTO_INCREMENT,
`site_level` int(255) DEFAULT NULL,
`site_localx` double(255, 3) DEFAULT NULL,
`site_localy` double(255, 3) DEFAULT NULL,
`site_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`site_info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`site_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`site_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`connect` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`devcount` int(11) DEFAULT NULL,
`state` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`site_id`) USING BTREE,
INDEX `site_name`(`site_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 38 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of site
-- ----------------------------
INSERT INTO `site` VALUES (1, 1, 108.947, 34.348, '西安', NULL, '正式', NULL, '武汉;沈阳', 1, NULL);
INSERT INTO `site` VALUES (2, 1, 116.416, 39.908, '北京', NULL, '正式', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (3, 1, 117.235, 31.828, '合肥', NULL, '正式', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (4, 1, 114.316, 30.597, '武汉', NULL, '正式', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (5, 3, 113.636, 34.759, '郑州', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (6, 2, 121.478, 31.236, '上海', NULL, '正式', NULL, '北京;合肥', 1, NULL);
INSERT INTO `site` VALUES (7, 2, 125.331, 43.823, '长春', NULL, '正式', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (8, 2, 109.519, 18.260, '三亚', NULL, '正式', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (9, 2, 86.200, 41.756, '库尔勒', NULL, '正式', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (10, 3, 117.208, 39.093, '天津', NULL, '普通', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (11, 3, 120.217, 30.250, '杭州', NULL, '普通', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (12, 3, 120.598, 31.299, '苏州', NULL, '普通', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (13, 3, 120.711, 28.011, '温州', NULL, '普通', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (14, 3, 123.438, 41.816, '沈阳', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (15, 3, 126.542, 45.807, '哈尔滨', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (16, 3, 87.629, 43.836, '乌鲁木齐', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (17, 3, 98.501, 39.744, '酒泉', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (18, 3, 93.521, 42.838, '哈密', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (19, 3, 104.077, 30.578, '成都', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (20, 3, 102.839, 24.893, '昆明', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (21, 3, 108.378, 22.820, '南宁', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (22, 3, 106.633, 26.655, '贵州', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (23, 3, 113.276, 23.137, '广州', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (24, 3, 112.952, 28.237, '长沙', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (25, 3, 112.125, 32.015, '襄樊', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (26, 3, 118.672, 24.882, '泉州', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (27, 3, 117.126, 36.651, '济南', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (28, 3, 118.793, 32.063, '南京', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (29, 3, 103.845, 36.069, '兰州', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (30, 3, 110.361, 21.283, '湛江', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (31, 3, 112.552, 37.879, '太原', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (32, 3, 114.518, 38.052, '石家庄', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (33, 3, 76.001, 39.478, '喀什', NULL, '测试', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (35, 3, 109.320, 34.150, '蓝田', NULL, '普通', NULL, NULL, 1, NULL);
INSERT INTO `site` VALUES (37, 3, 112.128, 32.016, '襄阳市', '', '普通', '', NULL, NULL, NULL);
-- ----------------------------
-- Table structure for site_line
-- ----------------------------
DROP TABLE IF EXISTS `site_line`;
CREATE TABLE `site_line` (
`line_id` int(11) NOT NULL AUTO_INCREMENT,
`point1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`point2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`line_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`line_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`line_info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`length` double(255, 2) DEFAULT NULL,
`stable` double(255, 2) DEFAULT NULL,
`transspeed` double(255, 2) DEFAULT NULL,
`state` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`line_id`) USING BTREE,
INDEX `point1`(`point1`) USING BTREE,
INDEX `point2`(`point2`) USING BTREE,
CONSTRAINT `site_line_ibfk_1` FOREIGN KEY (`point1`) REFERENCES `site` (`site_name`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `site_line_ibfk_2` FOREIGN KEY (`point2`) REFERENCES `site` (`site_name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of site_line
-- ----------------------------
INSERT INTO `site_line` VALUES (1, '喀什', '库尔勒', '喀什-库尔勒', '普通', NULL, NULL, 6.92, 6.69, '正常');
INSERT INTO `site_line` VALUES (2, '库尔勒', '乌鲁木齐', '库尔勒-乌鲁木齐', '普通', NULL, NULL, 6.96, 5.34, '正常');
INSERT INTO `site_line` VALUES (3, '乌鲁木齐', '哈密', '乌鲁木齐-哈密', '普通', NULL, NULL, 4.24, 9.96, '正常');
INSERT INTO `site_line` VALUES (4, '哈密', '酒泉', '哈密-酒泉', '普通', NULL, NULL, 3.70, 8.55, '正常');
INSERT INTO `site_line` VALUES (5, '酒泉', '兰州', '酒泉-兰州', '普通', NULL, NULL, 7.98, 0.97, '正常');
INSERT INTO `site_line` VALUES (6, '兰州', '西安', '兰州-西安', '重点', NULL, NULL, 2.22, 6.39, '正常');
INSERT INTO `site_line` VALUES (7, '西安', '成都', '西安-成都', '重点', NULL, NULL, 5.19, 4.20, '正常');
INSERT INTO `site_line` VALUES (8, '西安', '襄樊', '西安-襄樊', '重点', NULL, NULL, 4.98, 5.84, '正常');
INSERT INTO `site_line` VALUES (9, '西安', '太原', '西安-太原', '重点', '重要', 600.00, 5.75, 4.27, '正常');
INSERT INTO `site_line` VALUES (10, '成都', '昆明', '成都-昆明', '重点', NULL, NULL, 9.47, 3.14, '正常');
INSERT INTO `site_line` VALUES (11, '昆明', '贵州', '昆明-贵州', '重点', NULL, NULL, 8.50, 1.09, '正常');
INSERT INTO `site_line` VALUES (12, '贵州', '南宁', '贵州-南宁', '重点', NULL, NULL, 1.97, 0.37, '正常');
INSERT INTO `site_line` VALUES (13, '南宁', '湛江', '南宁-湛江', '重点', NULL, NULL, 4.85, 6.61, '正常');
INSERT INTO `site_line` VALUES (14, '湛江', '三亚', '湛江-三亚', '重点', NULL, NULL, 6.95, 4.08, '正常');
INSERT INTO `site_line` VALUES (15, '湛江', '广州', '湛江-广州', '重点', NULL, NULL, 0.95, 3.33, '正常');
INSERT INTO `site_line` VALUES (16, '襄樊', '武汉', '襄樊-武汉', '重点', NULL, NULL, 0.45, 6.31, '正常');
INSERT INTO `site_line` VALUES (17, '武汉', '长沙', '武汉-长沙', '重点', NULL, NULL, 0.03, 3.72, '正常');
INSERT INTO `site_line` VALUES (18, '长沙', '广州', '长沙-广州', '重点', NULL, NULL, 8.97, 5.88, '正常');
INSERT INTO `site_line` VALUES (19, '西安', '郑州', '西安-郑州', '重点', NULL, NULL, 4.25, 8.78, '正常');
INSERT INTO `site_line` VALUES (20, '郑州', '武汉', '郑州-武汉', '重点', NULL, NULL, 1.02, 1.09, '正常');
INSERT INTO `site_line` VALUES (21, '太原', '石家庄', '太原-石家庄', '重点', NULL, NULL, 1.82, 3.38, '正常');
INSERT INTO `site_line` VALUES (22, '石家庄', '北京', '石家庄-北京', '重点', NULL, NULL, 7.06, 3.19, '正常');
INSERT INTO `site_line` VALUES (23, '武汉', '合肥', '武汉-合肥', '重点', NULL, NULL, 8.52, 5.91, '正常');
INSERT INTO `site_line` VALUES (24, '合肥', '南京', '合肥-南京', '重点', NULL, NULL, 5.22, 3.75, '正常');
INSERT INTO `site_line` VALUES (25, '北京', '天津', '北京-天津', '重点', NULL, NULL, 4.55, 9.70, '正常');
INSERT INTO `site_line` VALUES (26, '天津', '济南', '天津-济南', '重点', NULL, NULL, 4.10, 7.98, '正常');
INSERT INTO `site_line` VALUES (27, '济南', '南京', '济南-南京', '重点', NULL, NULL, 7.01, 4.32, '正常');
INSERT INTO `site_line` VALUES (28, '南京', '苏州', '南京-苏州', '普通', NULL, NULL, 1.27, 0.41, '正常');
INSERT INTO `site_line` VALUES (29, '苏州', '上海', '苏州-上海', '普通', NULL, NULL, 5.27, 5.22, '正常');
INSERT INTO `site_line` VALUES (30, '上海', '杭州', '上海-杭州', '普通', NULL, NULL, 5.65, 9.00, '正常');
INSERT INTO `site_line` VALUES (31, '杭州', '温州', '杭州-温州', '普通', NULL, NULL, 1.93, 1.63, '正常');
INSERT INTO `site_line` VALUES (32, '温州', '泉州', '温州-泉州', '普通', NULL, NULL, 5.01, 8.56, '正常');
INSERT INTO `site_line` VALUES (33, '广州', '泉州', '广州-泉州', '普通', NULL, NULL, 4.46, 3.50, '正常');
INSERT INTO `site_line` VALUES (34, '北京', '沈阳', '北京-沈阳', '普通', NULL, NULL, 4.90, 4.63, '正常');
INSERT INTO `site_line` VALUES (35, '沈阳', '长春', '沈阳-长春', '普通', NULL, NULL, 3.51, 0.46, '正常');
INSERT INTO `site_line` VALUES (36, '长春', '哈尔滨', '长春-哈尔滨', '普通', NULL, NULL, 3.82, 4.78, '正常');
-- ----------------------------
-- Table structure for telemetry
-- ----------------------------
DROP TABLE IF EXISTS `telemetry`;
CREATE TABLE `telemetry` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`alarm_lower_limit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`alarm_state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`alarm_upper_limit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`base` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`blocked` bit(1) DEFAULT NULL,
`data_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`detected_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`device_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`lower_limit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`offset` int(11) DEFAULT NULL,
`ratio` int(11) DEFAULT NULL,
`site_name` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`state` int(11) DEFAULT NULL,
`timestamp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upper_limit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
| true |
7ceb270b62cbf4c073c4df78e297cb908a06adc3 | SQL | philipscode/bd | /lab_3/view_3.sql | UTF-8 | 206 | 2.9375 | 3 | [] | no_license | CREATE VIEW `Sport club`.`constant` AS
SELECT `sn`.`full_name` Sportsman
FROM `Sport club`.`sportsmen` `sn`
WHERE `sn`.`certificate_number` NOT IN (SELECT `sportsman` FROM `Sport club`.`previous trainers`); | true |
15a05d77203c7ea97d2624e70847436306ebfe59 | SQL | Pokham/pet_adoption | /serverside/createDatabases.sql | UTF-8 | 923 | 3.078125 | 3 | [] | no_license | DROP DATABASE IF EXISTS AnimalShelters;
CREATE DATABASE AnimalShelters;
USE AnimalShelters;
CREATE TABLE Locations
(
ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
Address VARCHAR(100),
Website VARCHAR(100),
Phone VARCHAR(20)
);
CREATE TABLE Contacts
(
ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(30),
Email VARCHAR(30),
Message VARCHAR(144)
);
INSERT INTO Locations (Name, Address, Website, Phone) VALUES
('Friends For Life',
'107 E. 22nd Street Houston, TX 77008',
'http://www.friends4life.org',
'NONE');
INSERT INTO Locations (Name, Address, Website, Phone) VALUES
('Houston SPCA',
'900 Portway Drive Houston, TX 77024',
'http://www.houstonspca.org',
'(713) 869-SPCA');
INSERT INTO Locations (Name, Address, Website, Phone) VALUES
('BARC',
'3300 Carr Street, Houston TX 77026',
'http://www.houstontx.gov/barc/',
'713-837-0311'); | true |
a8f89ef8358c32bf5f7f2098da2d03ca48449dce | SQL | lopezmoises/BD2 | /exercicios-1/42.sql | UTF-8 | 189 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | SELECT * FROM world.country
LEFT JOIN world.countrylanguage ON world.countrylanguage.CountryCode = world.country.Code
WHERE Language = 'Spanish' AND IsOfficial = 'T' AND Percentage > 96.00 | true |
1fa8d7bd72b47d0f1b74177eb6dc1321778e01b5 | SQL | jiwankang/internet-traffic | /server_code.sql | UTF-8 | 2,169 | 3.734375 | 4 | [] | no_license | CREATE TABLE `endreason` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`description` VARCHAR(255) NOT NULL
);
CREATE TABLE `networknode` (
`ip` VARCHAR(255) NOT NULL,
`port` INTEGER NOT NULL,
PRIMARY KEY (`ip`, `port`)
);
CREATE TABLE `protocol` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL
);
CREATE TABLE `flow` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`end_reason` INTEGER,
`category` VARCHAR(255) NOT NULL,
`application_protocol` VARCHAR(255) NOT NULL,
`web_service` VARCHAR(255) NOT NULL,
`src_node_ip` VARCHAR(255) NOT NULL,
`src_node_port` INTEGER NOT NULL,
`dest_node_ip` VARCHAR(255) NOT NULL,
`dest_node_port` INTEGER NOT NULL,
`protocol_id` INTEGER,
`end_reason_id` INTEGER
);
CREATE INDEX `idx_flow__dest_node_ip_dest_node_port` ON `flow` (`dest_node_ip`, `dest_node_port`);
CREATE INDEX `idx_flow__end_reason_id` ON `flow` (`end_reason_id`);
CREATE INDEX `idx_flow__protocol_id` ON `flow` (`protocol_id`);
CREATE INDEX `idx_flow__src_node_ip_src_node_port` ON `flow` (`src_node_ip`, `src_node_port`);
ALTER TABLE `flow` ADD CONSTRAINT `fk_flow__dest_node_ip__dest_node_port` FOREIGN KEY (`dest_node_ip`, `dest_node_port`) REFERENCES `networknode` (`ip`, `port`) ON DELETE CASCADE;
ALTER TABLE `flow` ADD CONSTRAINT `fk_flow__end_reason_id` FOREIGN KEY (`end_reason_id`) REFERENCES `endreason` (`id`) ON DELETE SET NULL;
ALTER TABLE `flow` ADD CONSTRAINT `fk_flow__protocol_id` FOREIGN KEY (`protocol_id`) REFERENCES `protocol` (`id`) ON DELETE SET NULL;
ALTER TABLE `flow` ADD CONSTRAINT `fk_flow__src_node_ip__src_node_port` FOREIGN KEY (`src_node_ip`, `src_node_port`) REFERENCES `networknode` (`ip`, `port`) ON DELETE CASCADE;
CREATE TABLE `packetinfo` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`flow_id` INTEGER NOT NULL,
`packet_total_count` INTEGER,
`octet_total_count` INTEGER,
`min_pkt_size` DOUBLE,
`max_pkt_size` DOUBLE,
`avg_pkt_size` DOUBLE,
`stdev_pkt_size` DOUBLE
);
CREATE INDEX `idx_packetinfo__flow_id` ON `packetinfo` (`flow_id`);
ALTER TABLE `packetinfo` ADD CONSTRAINT `fk_packetinfo__flow_id` FOREIGN KEY (`flow_id`) REFERENCES `flow` (`id`)
| true |
9500ff9025b0473367e3788ad780b4bdbe677e7d | SQL | Natreton/SQL-iSkillo | /HW-18.sql | UTF-8 | 237 | 4.03125 | 4 | [] | no_license | SELECT users.id,
users.username,
COUNT(posts.userId) as Total
FROM users
LEFT JOIN posts
ON users.id = posts.userId
GROUP BY users.id, users.username
HAVING COUNT(posts.userId) < 5
ORDER BY COUNT(posts.userId) ASC ;
| true |
365996450c1d0f98c91fc21b74713cbdcd66a9dd | SQL | LegionDark/SQL_testbed | /sql/custom/mob_groups_custom.sql | UTF-8 | 115,900 | 2.8125 | 3 | [] | no_license | -- ---------------------------------------------------------------------------
-- This file adds onto, or modifies portions of the table "mob_groups" created
-- by the file mob_droplist.sql and must be imported/executed AFTER that file.
--
-- For new entries DarkStar does not have, use "INSERT INTO"
-- For changing entries that already exist use "REPLACE INTO"
-- REPLACE tells MySQL to delete the old line and insert the new one.
-- Using the wrong 1 of these 2 commands will result in errors.
-- ---------------------------------------------------------------------------
-- REPLACE INTO `mob_groups` VALUES (groupid,poolid,zoneid,respawntime,spawntype,dropid,HP,MP,minLevel,maxLevel,allegiance;
-- This group needs research before sorting
REPLACE INTO `mob_groups` VALUES (106120,4099,253,60,0,0,10000,9000,121,125,0); -- The fuck is this!!!! <----
REPLACE INTO `mob_groups` VALUES (15107,3179,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (15122,4373,48,0,128,9106,80000,80000,128,130,0); -- Wordorbor_the_Artificer
REPLACE INTO `mob_groups` VALUES (15112,4020,48,0,128,0,17000,17000,107,112,0);
-- ------------------
REPLACE INTO `mob_groups` VALUES (99,2083,4,14400,0,1788,20000,20000,105,107,0); -- Intulo
REPLACE INTO `mob_groups` VALUES (125,500,5,14400,0,370,50000,0,115,117,0); -- Bonnacon
REPLACE INTO `mob_groups` VALUES (135,1303,5,0,128,934,4333,0,74,75,0);
REPLACE INTO `mob_groups` VALUES (141,2156,5,86400,128,1852,200000,100000,125,125,0); -- Jormungand
REPLACE INTO `mob_groups` VALUES (217,3916,7,86400,128,3522,200000,100000,125,125,0); -- Tiamat
REPLACE INTO `mob_groups` VALUES (412,29,15,60,0,10,5300,0,106,110,0); -- Ab xzomit
REPLACE INTO `mob_groups` VALUES (413,86,15,0,128,9200,80000,10000,113,116,0); -- Alkonost
REPLACE INTO `mob_groups` VALUES (415,232,15,0,128,175,90000,20000,113,116,0); -- Arimaspi Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (416,261,15,0,128,9268,90000,20000,113,116,0); -- Ashtaerh the Gallvexed Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (418,326,15,750,0,229,80000,30000,113,116,0); -- Bakka Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (419,330,15,600,0,231,80000,20000,113,116,0); -- Balaur Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (420,457,15,0,128,9202,90000,10000,113,116,0); -- Bloodeye Vileberry
REPLACE INTO `mob_groups` VALUES (421,458,15,0,128,329,60000,20000,113,116,0); -- Bloodguzzler Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (422,491,15,0,128,9203,80000,10000,113,116,0); -- Bombadeel
REPLACE INTO `mob_groups` VALUES (423,742,15,0,128,9204,80000,20999,113,116,0); -- Clingy Clare
REPLACE INTO `mob_groups` VALUES (424,853,15,60,0,606,10000,10000,106,110,0); -- Cryptonberry_Occultist Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (425,902,15,60,0,633,10000,10000,106,110,0); -- Dapifier Imp Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (426,951,15,60,0,668,10000,10000,106,110,0); -- Deep Eye Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (428,1150,15,60,0,820,80000,10000,106,110,0); -- Dybbuk Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (429,1171,15,0,128,838,130000,10000,113,116,0); -- Eccentric Eve Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (430,1244,15,60,0,887,10000,10000,106,110,0); -- Ephemeral Clionid Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (431,1245,15,60,0,889,10000,10000,106,110,0); -- Ephemeral Limule Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (432,1312,15,0,128,938,60000,20999,113,116,0); -- Fear Gorta Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (433,1348,15,600,0,962,110000,0,113,116,0); -- Fistule Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (434,1457,15,600,0,1075,80000,20999,113,116,0); -- Gangly Gean Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (435,1630,15,60,0,1197,10000,0,106,110,0); -- Gneiss Leech Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (436,1840,15,600,0,9205,80000,10000,113,116,0); -- Guimauve
REPLACE INTO `mob_groups` VALUES (437,1848,15,60,0,1608,10000,10000,106,110,0); -- Gunge Slug Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (440,1939,15,0,128,1673,80000,0,113,116,0); -- Hexenpilz Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (441,1942,15,60,0,9269,10000,0,106,110,0); -- Highland Rafflesia Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (442,1943,15,60,0,1675,10000,0,106,110,0); -- Highland Treant Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (443,1967,15,60,0,1693,10000,0,106,110,0); -- Hoary Ragwort Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (444,2209,15,0,128,9206,80000,20999,113,116,0); -- Keratyrannos
REPLACE INTO `mob_groups` VALUES (445,2217,15,600,0,1889,80000,0,113,116,0); -- Khalamari Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (446,2294,15,0,128,1966,110000,20000,113,116,0); -- Kukulkan Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (447,2389,15,0,128,2041,60000,0,113,116,0); -- Lentor Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (449,2404,15,60,0,2051,10000,10999,106,110,0); -- Ley Clionid Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (450,2409,15,60,0,2058,10000,20999,106,110,0); -- Licorice Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (452,2632,15,60,0,2258,10000,0,106,110,0); -- Mesa Wivre Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (453,2743,15,60,0,2351,10000,20000,106,110,0); -- Morboling Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (454,3107,15,600,0,9207,80000,10000,113,116,0); -- Pavan
REPLACE INTO `mob_groups` VALUES (456,3244,15,60,0,2890,10000,20000,106,110,0); -- Qaitu Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (457,3326,15,600,0,2927,80000,0,113,116,0); -- Raskovnik Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (458,3334,15,60,0,2930,10000,10000,106,110,0); -- Razorback Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (460,3466,15,0,128,9208,60000,20999,113,116,0); -- Sarcophilus
REPLACE INTO `mob_groups` VALUES (461,3577,15,60,0,3173,10000,0,106,110,0); -- Shadow Fungar Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (462,3578,15,60,0,3174,10000,0,106,110,0); -- Shadow Lizard Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (463,3633,15,0,128,9209,60000,10000,113,116,0); -- Siranpa Kamuy
REPLACE INTO `mob_groups` VALUES (464,3696,15,60,0,3274,10000,10000,106,110,0); -- Sods Limule Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (466,3948,15,60,0,3540,10000,0,106,110,0); -- Tonberry Bedeviler Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (467,3962,15,600,0,3553,80000,30000,113,116,0); -- Tonberry Lieje Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (468,4042,15,60,0,3617,10000,0,106,110,0); -- Trotting Sapling Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (469,4054,15,900,0,3632,110000,30000,113,116,0); -- Turul Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (470,4236,15,60,0,4016,10000,0,106,110,0); -- Viridis Wyvern Abyssea-Konschtat
REPLACE INTO `mob_groups` VALUES (471,4480,15,60,0,4338,10000,0,106,110,0); -- Ypotryll
REPLACE INTO `mob_groups` VALUES (603,2608,24,3960,0,2239,30000,20000,105,107,0); -- Megalobugard
REPLACE INTO `mob_groups` VALUES (862,21,33,0,128,4,175000,175000,125,125,0); -- Absolute Virtue
REPLACE INTO `mob_groups` VALUES (868,2132,33,0,128,1834,75000,75000,125,125,0); -- Jailer of Hope
REPLACE INTO `mob_groups` VALUES (869,2133,33,0,128,1835,75000,75000,125,125,0); -- Jailer of Justice
REPLACE INTO `mob_groups` VALUES (870,2134,33,0,128,1836,125000,125000,125,125,0); -- Jailer of Love
REPLACE INTO `mob_groups` VALUES (871,2135,33,0,128,1837,75000,75000,125,125,0); -- Jailer of Prudence
REPLACE INTO `mob_groups` VALUES (875,2976,33,1056,0,2536,0,0,100,100,0); -- Om hpemde
REPLACE INTO `mob_groups` VALUES (876,2977,33,1056,0,2537,0,0,101,105,0); -- Om Phuabo
REPLACE INTO `mob_groups` VALUES (877,2978,33,1056,0,2538,0,0,100,100,0); -- Om Xzomit
REPLACE INTO `mob_groups` VALUES (878,2979,33,3600,0,2539,0,0,105,107,0); -- Om yovra
REPLACE INTO `mob_groups` VALUES (883,3420,33,0,128,0,5000,0,90,95,0); -- Ru Aern
REPLACE INTO `mob_groups` VALUES (891,4089,33,3600,0,3654,0,0,82,82,0); -- Ulyovra
REPLACE INTO `mob_groups` VALUES (898,1241,34,1056,0,883,0,0,99,101,0); -- Eo Ghrah
REPLACE INTO `mob_groups` VALUES (899,1242,34,1056,0,884,0,0,101,102,0); -- Eo Zdei
REPLACE INTO `mob_groups` VALUES (900,4661,34,0,128,4398,80000,75000,110,110,0); -- Ix Aern MNK
REPLACE INTO `mob_groups` VALUES (901,2113,34,0,128,0,0,0,100,100,0); -- Ix Ghrah
REPLACE INTO `mob_groups` VALUES (902,2136,34,0,128,1838,80000,75000,110,110,0); -- Jailer of Temperance
REPLACE INTO `mob_groups` VALUES (906,3269,34,0,128,0,50000,50000,100,100,0); -- Qn_aern_rdm
REPLACE INTO `mob_groups` VALUES (907,4651,34,0,128,0,50000,50000,100,100,0); -- Qn_aern_whm
REPLACE INTO `mob_groups` VALUES (914,300,35,1056,0,216,0,0,101,105,0); -- Aw Ghrah
REPLACE INTO `mob_groups` VALUES (915,301,35,1056,0,0,0,0,99,103,0); -- Aw zdei
REPLACE INTO `mob_groups` VALUES (916,4660,35,0,128,4397,75000,75000,110,110,0); -- Ix Aern DRK
REPLACE INTO `mob_groups` VALUES (917,2112,35,0,128,4396,75000,75000,110,110,0); -- Ix Aern DRG
REPLACE INTO `mob_groups` VALUES (918,2114,35,0,128,0,0,35000,85,87,0); -- Ix zdei
REPLACE INTO `mob_groups` VALUES (919,2130,35,0,128,1832,75000,75000,120,120,0); -- Jailer of Faith
REPLACE INTO `mob_groups` VALUES (920,2131,35,0,128,1833,75000,75000,120,120,0); -- Jailer of Fortitude
REPLACE INTO `mob_groups` VALUES (921,2215,35,0,128,0,50000,50000,100,100,0); -- JoF Helper
REPLACE INTO `mob_groups` VALUES (922,4659,35,0,128,0,50000,50000,100,100,0); -- JoF Helper
REPLACE INTO `mob_groups` VALUES (1445,388,45,60,0,271,10000,20000,106,110,0); -- Beholder
REPLACE INTO `mob_groups` VALUES (1446,470,45,60,0,340,10000,0,106,110,0); -- Blood Bat
REPLACE INTO `mob_groups` VALUES (1448,625,45,60,0,460,10000,0,106,110,0); -- Canyon Eft
REPLACE INTO `mob_groups` VALUES (1449,627,45,60,0,462,10000,0,106,110,0); -- Canyon Scorpion
REPLACE INTO `mob_groups` VALUES (1450,628,45,60,0,463,10000,20000,106,110,0); -- Caoineag
REPLACE INTO `mob_groups` VALUES (1452,748,45,60,0,549,10000,10000,106,110,0); -- Cluckatrice
REPLACE INTO `mob_groups` VALUES (1453,1244,45,60,0,888,10000,20999,106,110,0); -- Ephemeral Clionid
REPLACE INTO `mob_groups` VALUES (1454,1245,45,60,0,890,10000,20999,106,110,0); -- Ephemeral Limule
REPLACE INTO `mob_groups` VALUES (1455,1843,45,60,0,1604,10000,20999,106,110,0); -- Gulch Limule
REPLACE INTO `mob_groups` VALUES (1456,1845,45,60,0,1606,10000,20999,106,110,0); -- Gully Clionid
REPLACE INTO `mob_groups` VALUES (1457,1941,45,60,0,1674,10000,0,106,110,0); -- Hieracosphinx
REPLACE INTO `mob_groups` VALUES (1458,2129,45,60,0,1831,10000,0,106,110,0); -- Jaguarundi
REPLACE INTO `mob_groups` VALUES (1459,2323,45,60,0,1990,10000,0,106,110,0); -- Lamenter
REPLACE INTO `mob_groups` VALUES (1460,2813,45,60,0,9248,10000,0,106,110,0); -- Naul
REPLACE INTO `mob_groups` VALUES (1461,3082,45,60,0,2733,10000,0,106,110,0); -- Pachypodium
REPLACE INTO `mob_groups` VALUES (1462,3409,45,60,0,9249,60000,10000,106,110,0); -- Rubicund Adenium
REPLACE INTO `mob_groups` VALUES (1463,3798,45,60,0,0,0,0,0,0,0); -- Sturdy Pyxis \\these are boxes so dont need stats//
REPLACE INTO `mob_groups` VALUES (1486,39,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1487,52,48,0,128,0,17000,17000,112,112,0);
REPLACE INTO `mob_groups` VALUES (1488,2127,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1489,273,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1491,361,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1492,405,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1493,406,48,0,128,0,17000,17000,112,112,0);
REPLACE INTO `mob_groups` VALUES (1494,493,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1496,577,48,0,128,0,17000,17000,122,127,0);
REPLACE INTO `mob_groups` VALUES (1497,1123,48,0,128,0,17000,17000,122,127,0);
REPLACE INTO `mob_groups` VALUES (1498,1074,48,0,128,0,17000,17000,122,127,0);
REPLACE INTO `mob_groups` VALUES (1499,922,48,0,128,9106,40000,40000,127,132,0); -- Dartorgor_the_Austere
REPLACE INTO `mob_groups` VALUES (1500,944,48,0,128,9106,40000,40000,115,117,0); -- Decimator_Mabel_Ja
REPLACE INTO `mob_groups` VALUES (1501,1054,48,0,128,0,17000,17000,112,112,0);
REPLACE INTO `mob_groups` VALUES (1502,1112,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1503,1182,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1504,1276,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1505,1335,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1506,1357,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1507,1365,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1508,1492,48,1,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1509,1493,48,1,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1510,1494,48,1,128,0,17000,17000,107,112,0);
-- REPLACE INTO `mob_groups` VALUES (15112,4035,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1512,1496,48,1,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1513,1498,48,0,128,9106,60000,60000,122,127,0); -- Gere
REPLACE INTO `mob_groups` VALUES (1514,1505,48,0,128,0,17000,17000,115,117,0);
REPLACE INTO `mob_groups` VALUES (1515,1608,48,0,128,9106,60000,60000,120,123,0); -- Girzorhor_the_Imprudent
REPLACE INTO `mob_groups` VALUES (1517,1846,48,0,128,9106,60000,60000,117,122,0); -- Gulool_Ja_Ja
REPLACE INTO `mob_groups` VALUES (1518,1851,48,0,128,9106,60000,60000,126,129,0); -- Gurfurlur_the_Menacing
REPLACE INTO `mob_groups` VALUES (1520,2059,48,0,128,9106,60000,60000,122,127,0); -- Illuyankas
REPLACE INTO `mob_groups` VALUES (1524,2230,48,0,128,0,17000,17000,112,112,0);
REPLACE INTO `mob_groups` VALUES (1525,2327,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1526,2333,48,0,128,0,17000,17000,112,122,0);
REPLACE INTO `mob_groups` VALUES (1527,2336,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1528,2337,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1529,2342,48,0,128,9106,40000,40000,122,127,0); -- Lamia_No 15
REPLACE INTO `mob_groups` VALUES (1530,2346,48,0,128,9106,40000,40000,122,127,0); -- Lamia_No 2
REPLACE INTO `mob_groups` VALUES (1531,2347,48,0,128,9106,40000,40000,122,127,0); -- Lamia_No 21
REPLACE INTO `mob_groups` VALUES (1532,2350,48,0,128,9106,40000,40000,122,127,0); -- Lamia_No 3
REPLACE INTO `mob_groups` VALUES (1533,2351,48,0,128,0,17000,17000,112,117,0);
REPLACE INTO `mob_groups` VALUES (1534,2352,48,0,128,9106,40000,40000,122,122,0); -- Lamia_No 4
REPLACE INTO `mob_groups` VALUES (1535,2353,48,0,128,9106,40000,40000,122,127,0); -- Lamia_No 9
REPLACE INTO `mob_groups` VALUES (1536,2356,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1537,2358,48,0,128,0,17000,17000,122,127,0);
REPLACE INTO `mob_groups` VALUES (1538,2359,48,0,128,0,17000,17000,122,127,0);
REPLACE INTO `mob_groups` VALUES (1539,2510,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1540,2514,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1541,2517,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1542,2519,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1543,2520,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1544,2521,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1545,2530,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1546,2532,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1547,2536,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1548,2539,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1549,2541,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1550,2606,48,0,128,2237,100000,0,117,120,0);
REPLACE INTO `mob_groups` VALUES (1550,2606,48,0,128,9106,80000,80000,127,132,0); -- Medusa
REPLACE INTO `mob_groups` VALUES (1551,2618,48,0,128,9106,40000,40000,107,112,0); -- Merrow_No 11
REPLACE INTO `mob_groups` VALUES (1552,2622,48,0,128,0,17000,17000,112,117,0);
REPLACE INTO `mob_groups` VALUES (1553,2623,48,0,128,9106,40000,40000,112,117,0); -- Merrow_No 12
REPLACE INTO `mob_groups` VALUES (1554,2626,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1555,2628,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1556,2821,48,0,128,9106,60000,60000,122,127,0); -- Nemean_Lion
REPLACE INTO `mob_groups` VALUES (1557,3093,48,0,128,9106,70000,60000,112,117,0); -- Panurgic_Ryubool_Ja
REPLACE INTO `mob_groups` VALUES (1558,3126,48,0,128,0,17000,17000,112,112,0);
REPLACE INTO `mob_groups` VALUES (1559,3137,48,0,128,0,17000,17000,112,112,0);
REPLACE INTO `mob_groups` VALUES (1561,3253,48,1,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1562,3258,48,1,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1565,3297,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1566,3309,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1567,3437,48,0,128,9106,50000,50000,112,117,0); -- Sagelord_Molaal_Ja
REPLACE INTO `mob_groups` VALUES (1569,3505,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1570,3516,48,0,128,9106,60000,60000,125,128,0); -- Searing_Vogaal_Ja
REPLACE INTO `mob_groups` VALUES (1571,3620,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1573,3789,48,0,128,9106,70000,60000,119,123,0); -- Strifelord_Bakool_Ja
REPLACE INTO `mob_groups` VALUES (1574,3812,48,0,128,9106,80000,60000,128,130,0); -- Surmerdar_the_Unbridled
REPLACE INTO `mob_groups` VALUES (1576,3910,48,0,128,9106,60000,60000,125,127,0); -- Thunderclap_Sareel_Ja
REPLACE INTO `mob_groups` VALUES (1577,4011,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1578,4014,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1579,4016,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1581,4025,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1582,4026,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1583,4031,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1584,4033,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1586,4037,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1587,4251,48,1,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1588,4255,48,0,128,9106,60000,60000,130,132,0); -- Vorjirzur_the_Valiant
REPLACE INTO `mob_groups` VALUES (1589,4257,48,0,128,9106,60000,60000,128,130,0); -- Vorporlor_the_Barbaric
REPLACE INTO `mob_groups` VALUES (1591,4300,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1592,4301,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1593,4302,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (1594,4335,48,0,128,0,17000,17000,122,127,0);
REPLACE INTO `mob_groups` VALUES (1596,4393,48,0,128,9106,80000,80000,130,133,0); -- Xarhorkur_the_Claviger
REPLACE INTO `mob_groups` VALUES (1597,4493,48,0,128,0,17000,17000,100,103,0);
REPLACE INTO `mob_groups` VALUES (1598,4524,48,0,128,9106,70000,70000,130,133,0); -- Zurmurwur_the_Ruthless
REPLACE INTO `mob_groups` VALUES (1643,1773,51,0,128,1536,80000,80000,120,120,0); -- Gotah Zha
REPLACE INTO `mob_groups` VALUES (1651,2018,51,259200,0,9731,100000,100000,120,120,0); -- Hydra
REPLACE INTO `mob_groups` VALUES (1653,2090,51,0,128,1793,75000,60000,115,120,0); -- Iriz Ima
REPLACE INTO `mob_groups` VALUES (1669,2539,51,300,0,0,60000,20000,103,107,0);
REPLACE INTO `mob_groups` VALUES (1696,3922,51,0,128,3525,100000,100000,120,120,0); -- Tinnin
REPLACE INTO `mob_groups` VALUES (1709,4265,51,0,128,4035,45000,0,110,115,0); -- Vulpangue
REPLACE INTO `mob_groups` VALUES (1743,930,52,0,128,652,80000,80000,125,130,0); -- Dea
REPLACE INTO `mob_groups` VALUES (1771,2423,52,0,128,2065,60000,60000,115,120,0); -- Lividroot_Amooshah
REPLACE INTO `mob_groups` VALUES (1778,2537,52,300,0,2179,75000,0,110,112,0);
REPLACE INTO `mob_groups` VALUES (1782,2606,52,0,128,2237,1000000,0,118,120,0);
REPLACE INTO `mob_groups` VALUES (1807,220,54,10800,128,168,75000,145000,105,107,0); -- Archaic Mirror
REPLACE INTO `mob_groups` VALUES (1845,2354,54,1056,0,0,50000,45000,101,103,0); -- Lamia Palace Guard
REPLACE INTO `mob_groups` VALUES (1857,2417,54,0,128,2061,45000,40000,110,115,0); -- lil apkallu
REPLACE INTO `mob_groups` VALUES (1859,2606,54,259200,0,2237,100000,100000,128,128,0); -- Medusa
REPLACE INTO `mob_groups` VALUES (1874,2920,54,0,128,2491,80000,80000,125,130,0); -- Nuhn
REPLACE INTO `mob_groups` VALUES (1886,4217,54,0,128,4000,45000,40000,110,115,0); -- Velonis
REPLACE INTO `mob_groups` VALUES (1889,4490,54,0,128,4340,60000,60000,115,120,0); -- Zareekhl
REPLACE INTO `mob_groups` VALUES (2028,118,61,0,128,84,60000,60000,115,120,0); -- anantaboga
REPLACE INTO `mob_groups` VALUES (2031,524,61,0,128,385,45000,40000,110,115,0); -- Brass Borer
REPLACE INTO `mob_groups` VALUES (2032,680,61,86400,0,502,100000,100000,128,128,0); -- Cerberus
REPLACE INTO `mob_groups` VALUES (2033,738,61,0,128,535,45000,40000,110,115,0); -- Claret
REPLACE INTO `mob_groups` VALUES (2053,2223,61,0,128,1894,80000,80000,125,130,0); -- Khromasoul
REPLACE INTO `mob_groups` VALUES (2059,3465,61,0,128,3059,100000,100000,120,120,0); -- Sarameya
REPLACE INTO `mob_groups` VALUES (2079,34,62,0,128,15,80000,80000,125,130,0); -- Achamoth
REPLACE INTO `mob_groups` VALUES (2083,220,62,10800,128,168,75000,145000,105,107,0); -- Archaic Mirror
REPLACE INTO `mob_groups` VALUES (2088,1020,62,0,128,725,60000,60000,115,120,0); -- Dextrose
REPLACE INTO `mob_groups` VALUES (2095,1851,62,900,0,1609,100000,100000,128,128,0); -- Gurfurlur_the_Menacing
REPLACE INTO `mob_groups` VALUES (2099,1948,62,300,128,0,50000,145000,101,103,0); -- Hilltroll Mirror Guard
REPLACE INTO `mob_groups` VALUES (2109,3339,62,0,128,2936,60000,60000,115,120,0); -- reaction
REPLACE INTO `mob_groups` VALUES (2131,4366,62,300,128,0,50000,145000,101,103,0); -- Woodtroll Mirror Guard
REPLACE INTO `mob_groups` VALUES (2165,220,65,10800,128,168,75000,145000,105,107,0); -- Archaic Mirror
REPLACE INTO `mob_groups` VALUES (2170,691,65,0,128,506,45000,40000,110,112,0); -- chamrosh
REPLACE INTO `mob_groups` VALUES (2176,1846,65,259200,0,1607,100000,100000,120,120,0); -- Gulool_Ja_Ja
REPLACE INTO `mob_groups` VALUES (2179,2089,65,0,128,1792,60000,60000,115,120,0); -- Iriri Samariri
REPLACE INTO `mob_groups` VALUES (2187,2512,65,300,0,0,50000,145000,101,103,0); -- Mamool Ja Conservator
REPLACE INTO `mob_groups` VALUES (2205,2543,65,300,0,0,50000,145000,101,103,0); -- Mamool Ja Treasurer
REPLACE INTO `mob_groups` VALUES (2284,717,68,0,128,525,45000,40000,110,115,0); -- Chigre
REPLACE INTO `mob_groups` VALUES (2293,2910,68,0,128,2487,80000,80000,120,120,0); -- Nosferatu
REPLACE INTO `mob_groups` VALUES (2294,2911,68,0,128,0,10000,0,87,92,0); -- nos Smn
REPLACE INTO `mob_groups` VALUES (2295,2912,68,0,128,0,10000,0,87,92,0); -- nos smn
REPLACE INTO `mob_groups` VALUES (2296,2913,68,0,128,0,10000,0,87,92,0); -- nos smn
REPLACE INTO `mob_groups` VALUES (2297,3089,68,0,128,0,25000,25000,110,110,0); -- Pandemonium Lamp
REPLACE INTO `mob_groups` VALUES (2298,3090,68,0,128,2741,250000,250000,125,125,0); -- Pandemonium Warden
REPLACE INTO `mob_groups` VALUES (2364,243,72,0,128,177,80000,80000,125,130,0); -- armed gears
REPLACE INTO `mob_groups` VALUES (2366,705,72,0,128,517,45000,40000,110,115,0); -- Cheese hoarder
REPLACE INTO `mob_groups` VALUES (2371,2931,72,0,128,2496,40000,40000,110,112,0); -- Ob
REPLACE INTO `mob_groups` VALUES (2731,2037,78,0,128,0,45000,0,97,100,0);
REPLACE INTO `mob_groups` VALUES (2766,9082,78,0,128,9082,110000,10000,120,120,0); -- Odin
REPLACE INTO `mob_groups` VALUES (2767,9083,78,0,128,9083,100000,10000,120,120,0); -- Alex
REPLACE INTO `mob_groups` VALUES (2789,1272,79,0,128,913,80000,80000,125,130,0); -- Experimental lamia
REPLACE INTO `mob_groups` VALUES (2795,2220,79,86400,0,1893,100000,100000,128,128,0); -- Khimara
REPLACE INTO `mob_groups` VALUES (2804,2489,79,0,128,2133,80000,80000,120,120,0); -- Mahijlaef
REPLACE INTO `mob_groups` VALUES (2829,4063,79,0,128,3638,100000,100000,120,120,0); -- Tyger
REPLACE INTO `mob_groups` VALUES (2830,4221,79,0,128,4007,60000,60000,115,120,0); -- Verdelet
-- --------------
-- Beast Pets
-- --------------
REPLACE INTO `mob_groups` VALUES (4595,3541,0,128,0,0,0,0,43,55,0);
REPLACE INTO `mob_groups` VALUES (4596,3562,0,128,0,0,0,0,33,45,0);
REPLACE INTO `mob_groups` VALUES (4597,3563,0,128,0,0,0,0,53,65,0);
REPLACE INTO `mob_groups` VALUES (4598,3564,0,128,0,0,0,0,23,35,0);
REPLACE INTO `mob_groups` VALUES (4599,3565,0,128,0,0,0,0,43,55,0);
REPLACE INTO `mob_groups` VALUES (4600,3566,0,128,0,0,0,0,33,45,0);
REPLACE INTO `mob_groups` VALUES (4601,3569,0,128,0,0,0,0,53,65,0);
REPLACE INTO `mob_groups` VALUES (4602,3570,0,128,0,0,0,0,28,40,0);
REPLACE INTO `mob_groups` VALUES (4603,3576,0,128,0,0,0,0,51,63,0);
REPLACE INTO `mob_groups` VALUES (4604,3624,0,128,0,0,0,0,28,40,0);
REPLACE INTO `mob_groups` VALUES (4605,3757,0,128,0,0,0,0,51,63,0);
REPLACE INTO `mob_groups` VALUES (4606,3769,0,128,0,0,0,0,38,45,0);
REPLACE INTO `mob_groups` VALUES (4607,3912,0,128,0,0,0,0,63,75,0);
REPLACE INTO `mob_groups` VALUES (4608,3926,0,128,0,0,0,0,76,90,0);
REPLACE INTO `mob_groups` VALUES (4609,4081,0,128,0,0,0,0,90,99,0);
REPLACE INTO `mob_groups` VALUES (4610,4118,0,128,0,0,0,0,23,55,0);
REPLACE INTO `mob_groups` VALUES (4611,4120,0,128,0,0,0,0,23,75,0);
REPLACE INTO `mob_groups` VALUES (4612,4208,0,128,0,0,0,0,76,99,0);
REPLACE INTO `mob_groups` VALUES (4613,4228,0,128,0,0,0,0,81,99,0);
REPLACE INTO `mob_groups` VALUES (4614,4238,0,128,0,0,0,0,33,65,0);
REPLACE INTO `mob_groups` VALUES (4615,4296,0,128,0,0,0,0,79,99,0);
REPLACE INTO `mob_groups` VALUES (4616,4309,0,128,0,0,0,0,23,75,0);
REPLACE INTO `mob_groups` VALUES (4617,4315,0,128,0,0,0,0,86,94,0);
REPLACE INTO `mob_groups` VALUES (4618,4494,0,128,0,0,0,0,75,75,0);
REPLACE INTO `mob_groups` VALUES (4619,4495,0,128,0,0,0,0,28,40,0);
REPLACE INTO `mob_groups` VALUES (4620,4496,0,128,0,0,0,0,53,75,0);
REPLACE INTO `mob_groups` VALUES (4621,4498,0,128,0,0,0,0,33,45,0);
REPLACE INTO `mob_groups` VALUES (4622,4510,0,128,0,0,0,0,58,75,0);
REPLACE INTO `mob_groups` VALUES (4623,4520,0,128,0,0,0,0,43,55,0);
REPLACE INTO `mob_groups` VALUES (4624,1,0,0,128,0,0,0,63,75,0);
REPLACE INTO `mob_groups` VALUES (4625,2,0,0,128,0,0,0,38,50,0);
REPLACE INTO `mob_groups` VALUES (4626,3,0,0,128,0,0,0,63,75,0);
REPLACE INTO `mob_groups` VALUES (4627,7,0,0,128,0,0,0,76,99,0);
REPLACE INTO `mob_groups` VALUES (4628,10,0,128,0,0,0,0,76,99,0);
REPLACE INTO `mob_groups` VALUES (4629,13,0,128,0,0,0,0,76,86,0);
REPLACE INTO `mob_groups` VALUES (4630,50,0,128,0,0,0,0,85,95,0);
REPLACE INTO `mob_groups` VALUES (4631,125,0,128,0,0,0,0,85,95,0);
REPLACE INTO `mob_groups` VALUES (4632,278,0,128,0,0,0,0,83,93,0);
REPLACE INTO `mob_groups` VALUES (4633,525,0,128,0,0,0,0,90,99,0);
REPLACE INTO `mob_groups` VALUES (4634,538,0,128,0,0,0,0,95,99,0);
REPLACE INTO `mob_groups` VALUES (4635,600,0,128,0,0,0,0,93,99,0);
REPLACE INTO `mob_groups` VALUES (4636,601,0,128,0,0,0,0,86,99,0);
REPLACE INTO `mob_groups` VALUES (4637,602,0,128,0,0,0,0,96,99,0);
REPLACE INTO `mob_groups` VALUES (4638,609,0,128,0,0,0,0,76,99,0);
REPLACE INTO `mob_groups` VALUES (4639,907,0,128,0,0,0,0,23,99,0);
REPLACE INTO `mob_groups` VALUES (4640,1753,0,128,0,0,0,0,75,99,0);
REPLACE INTO `mob_groups` VALUES (4641,1841,0,128,0,0,0,0,23,35,0);
REPLACE INTO `mob_groups` VALUES (5063,4416,96,330,0,4231,0,0,63,68,0);
REPLACE INTO `mob_groups` VALUES (5066,4423,96,330,0,4237,0,0,36,68,0);
REPLACE INTO `mob_groups` VALUES (5067,4428,96,330,0,4252,0,0,63,68,0);
REPLACE INTO `mob_groups` VALUES (5068,4444,96,330,0,4284,0,0,63,68,0);
REPLACE INTO `mob_groups` VALUES (5072,4459,96,330,0,4314,0,0,63,68,0);
REPLACE INTO `mob_groups` VALUES (5162,2772,97,10800,0,9314,80000,100000,110,112,0); -- Muq_Shabeel
REPLACE INTO `mob_groups` VALUES (5213,4410,97,330,0,4222,0,0,76,78,0);
REPLACE INTO `mob_groups` VALUES (5217,4425,97,0,0,4241,0,0,0,0,0);
REPLACE INTO `mob_groups` VALUES (5221,4450,97,330,0,4302,0,0,76,78,0);
REPLACE INTO `mob_groups` VALUES (5368,4404,98,330,0,4211,0,0,71,73,0);
REPLACE INTO `mob_groups` VALUES (5371,4427,98,330,0,4249,0,0,71,73,0);
REPLACE INTO `mob_groups` VALUES (5372,4431,98,330,0,4257,0,0,71,73,0);
REPLACE INTO `mob_groups` VALUES (5374,4445,98,330,0,4289,0,0,71,73,0);
REPLACE INTO `mob_groups` VALUES (5379,4461,98,330,0,4320,0,0,71,73,0);
REPLACE INTO `mob_groups` VALUES (5516,4404,99,1056,0,4212,0,0,79,82,0);
REPLACE INTO `mob_groups` VALUES (5517,4410,99,1056,0,4223,0,0,77,79,0);
REPLACE INTO `mob_groups` VALUES (5518,4412,99,1056,0,4227,0,0,81,83,0);
REPLACE INTO `mob_groups` VALUES (5520,4418,99,1056,0,4236,0,0,81,83,0);
REPLACE INTO `mob_groups` VALUES (5523,4425,99,0,0,4242,0,0,76,79,0);
REPLACE INTO `mob_groups` VALUES (5529,4450,99,1056,0,4303,0,0,77,79,0);
REPLACE INTO `mob_groups` VALUES (5742,4124,103,3600,128,3678,0,0,29,30,0); -- Valkrum Emperor
REPLACE INTO `mob_groups` VALUES (5783,2254,104,3600,128,1935,35000,0,55,55,0); -- King Arthro
REPLACE INTO `mob_groups` VALUES (5947,2384,107,3600,128,2036,0,0,10,11,0); -- Leaping Lizzy
REPLACE INTO `mob_groups` VALUES (6008,519,109,75615,0,4405,1357,1357,30,30,0);
REPLACE INTO `mob_groups` VALUES (6037,2155,109,7200,0,1851,1243,0,27,28,0);
REPLACE INTO `mob_groups` VALUES (6099,3630,110,3600,128,3208,45000,0,58,58,0); -- Simurgh
REPLACE INTO `mob_groups` VALUES (6161,410,112,86400,0,285,56000,60000,103,107,0); -- Biast
REPLACE INTO `mob_groups` VALUES (6267,1138,114,18000,128,813,20000,20000,105,107,0); -- Dune Widow
REPLACE INTO `mob_groups` VALUES (6388,3734,116,3600,128,3310,0,0,9,10,0); -- Spiny Spipi
REPLACE INTO `mob_groups` VALUES (6495,1643,119,330,0,1243,80000,10000,16,20,0); -- ?
REPLACE INTO `mob_groups` VALUES (6569,3376,120,3600,128,2987,30000,0,55,55,0); -- Roc
REPLACE INTO `mob_groups` VALUES (6620,2203,121,14400,0,1884,20000,20000,105,107,0); -- Keeper of Halidom
REPLACE INTO `mob_groups` VALUES (6687,2677,123,18000,0,2302,20000,20000,105,107,0); -- Mischevious Micholas
REPLACE INTO `mob_groups` VALUES (6705,423,124,7200,128,303,3197,0,58,59,0);
REPLACE INTO `mob_groups` VALUES (6785,2262,125,21600,128,1937,25000,0,80,85,0); -- King Vinegarroon
REPLACE INTO `mob_groups` VALUES (6842,387,127,18000,128,270,70000,0,98,100,0); -- OST 86400
REPLACE INTO `mob_groups` VALUES (6848,2255,127,0,128,1936,100000,0,128,128,0); -- King Behemoth
REPLACE INTO `mob_groups` VALUES (6857,44,128,18000,128,24,70000,0,98,100,0); -- OST 86400
REPLACE INTO `mob_groups` VALUES (6859,268,128,0,128,195,93000,0,128,128,0); -- Aspidochelone
REPLACE INTO `mob_groups` VALUES (6944,47,132,0,128,27,80000,0,113,116,0); -- Adamastor
REPLACE INTO `mob_groups` VALUES (6945,76,132,600,0,46,60000,0,113,116,0); -- Akash
REPLACE INTO `mob_groups` VALUES (6946,140,132,60,0,101,10000,0,106,110,0); -- Angler Tiger
REPLACE INTO `mob_groups` VALUES (6947,319,132,0,128,226,90000,0,113,116,0); -- Baba Yaga
REPLACE INTO `mob_groups` VALUES (6948,358,132,60,0,252,10000,0,106,110,0); -- Bathyal Gigas
REPLACE INTO `mob_groups` VALUES (6949,436,132,60,0,310,10000,0,106,110,0); -- Black Merino
REPLACE INTO `mob_groups` VALUES (6950,520,132,60,0,382,10000,0,106,110,0); -- Brae Opo-Opo
REPLACE INTO `mob_groups` VALUES (6951,530,132,0,128,396,110000,0,113,116,0); -- Briareus
REPLACE INTO `mob_groups` VALUES (6953,622,132,60,0,457,10000,0,106,110,0); -- Cankercap
REPLACE INTO `mob_groups` VALUES (6954,633,132,0,128,466,110000,30000,113,116,0); -- Carabosse
REPLACE INTO `mob_groups` VALUES (6955,699,132,600,0,513,60000,0,113,116,0); -- Chasmic Hornet
REPLACE INTO `mob_groups` VALUES (6956,828,132,60,0,589,10000,0,106,110,0); -- Crapaudy
REPLACE INTO `mob_groups` VALUES (6957,834,132,60,0,597,10000,0,106,110,0); -- Crepuscule Puk
REPLACE INTO `mob_groups` VALUES (6959,968,132,60,0,681,10000,0,106,110,0); -- Demersal Gigas
REPLACE INTO `mob_groups` VALUES (6960,1095,132,0,128,783,80000,0,113,116,0); -- Dozing Dorian
REPLACE INTO `mob_groups` VALUES (6961,1244,132,60,0,888,10000,20999,106,110,0); -- Ephemeral Clionid
REPLACE INTO `mob_groups` VALUES (6962,1244,132,60,0,888,10000,20999,106,110,0); -- Ephemeral Limule
REPLACE INTO `mob_groups` VALUES (6963,1301,132,60,0,932,10000,20000,106,110,0); -- Farfadet
REPLACE INTO `mob_groups` VALUES (6964,1488,132,60,0,1097,10000,0,106,110,0); -- Geier
REPLACE INTO `mob_groups` VALUES (6965,1548,132,60,0,1143,10000,20999,106,110,0); -- Gigadaphnia
REPLACE INTO `mob_groups` VALUES (6966,1785,132,0,128,1539,75000,75000,106,110,0); -- Grandgousier
REPLACE INTO `mob_groups` VALUES (6967,1810,132,60,0,1582,10000,0,106,110,0); -- Great Wasp
REPLACE INTO `mob_groups` VALUES (6968,1867,132,60,0,1619,10000,0,106,110,0); -- Hadal Gigas
REPLACE INTO `mob_groups` VALUES (6969,1872,132,0,128,1621,110000,0,113,116,0); -- Hadhayosh
REPLACE INTO `mob_groups` VALUES (6970,1888,132,60,0,1626,10000,0,106,110,0); -- Hammering Ram
REPLACE INTO `mob_groups` VALUES (6971,2088,132,60,0,1791,10000,0,106,110,0); -- Irate Sheep
REPLACE INTO `mob_groups` VALUES (6972,2104,132,600,0,1809,60000,0,113,116,0); -- Irrlicht
REPLACE INTO `mob_groups` VALUES (6973,2196,132,600,0,1873,60000,10000,113,116,0); -- Karkinos
REPLACE INTO `mob_groups` VALUES (6974,2204,132,600,0,1885,60000,0,113,116,0); -- Keesha Poppo
REPLACE INTO `mob_groups` VALUES (6975,2380,132,0,128,2032,60000,0,113,116,0); -- La Theine Liege
REPLACE INTO `mob_groups` VALUES (6976,2446,132,0,128,2090,80000,0,113,116,0); -- Lugarhoo
REPLACE INTO `mob_groups` VALUES (6977,2448,132,60,0,2092,10000,0,106,110,0); -- Luison
REPLACE INTO `mob_groups` VALUES (6978,2549,132,600,0,2189,60000,0,113,116,0); -- Mangy-tailed Marvin
REPLACE INTO `mob_groups` VALUES (6980,2610,132,600,0,2240,60000,0,113,116,0); -- Megamaw Mikey
REPLACE INTO `mob_groups` VALUES (6981,2611,132,0,128,2241,80000,0,113,116,0); -- Megantereon
REPLACE INTO `mob_groups` VALUES (6982,2798,132,600,0,2413,60000,10000,113,116,0); -- Nahn
REPLACE INTO `mob_groups` VALUES (6983,2836,132,0,128,2423,80000,0,113,116,0); -- Nguruvilu
REPLACE INTO `mob_groups` VALUES (6984,3080,132,750,0,2732,60000,30000,113,116,0); -- Ovni
REPLACE INTO `mob_groups` VALUES (6985,3091,132,0,128,2742,80000,0,113,116,0); -- Pantagruel
REPLACE INTO `mob_groups` VALUES (6986,3103,132,60,0,9257,10000,0,106,110,0); -- Pasture Funguar
REPLACE INTO `mob_groups` VALUES (6987,3134,132,600,0,2775,60000,0,113,116,0); -- Piasa
REPLACE INTO `mob_groups` VALUES (6988,3154,132,60,0,2800,10000,0,106,110,0); -- Plateau Glider
REPLACE INTO `mob_groups` VALUES (6989,3155,132,60,0,2801,10000,0,106,110,0); -- Plateau Hare
REPLACE INTO `mob_groups` VALUES (6990,3180,132,0,128,2819,80000,20000,113,116,0); -- Poroggo Dom Juan
REPLACE INTO `mob_groups` VALUES (6991,3185,132,60,0,2823,10000,20000,106,110,0); -- Poroggo Seducteur
REPLACE INTO `mob_groups` VALUES (6992,3216,132,60,0,2839,10000,20000,106,110,0); -- Psychopomp
REPLACE INTO `mob_groups` VALUES (6993,3380,132,60,0,2998,10000,20000,106,110,0); -- Rock Grinder
REPLACE INTO `mob_groups` VALUES (6995,3543,132,60,0,3123,10000,10000,106,110,0); -- Sentinel Crab
REPLACE INTO `mob_groups` VALUES (6997,3975,132,0,128,3565,80000,0,113,116,0); -- Toppling Tuber
REPLACE INTO `mob_groups` VALUES (6998,4043,132,0,128,3618,80000,0,113,116,0); -- Trudging Thomas
REPLACE INTO `mob_groups` VALUES (6999,4216,132,60,0,3999,10000,20999,106,110,0); -- Veld Clionid
REPLACE INTO `mob_groups` VALUES (7033,1909,134,900,0,1646,60000,40000,110,115,0); -- Wulgaru
REPLACE INTO `mob_groups` VALUES (7986,4522,147,7200,0,4403,1830,1830,36,38,0);
REPLACE INTO `mob_groups` VALUES (8000,4494,148,7200,0,4383,60000,200000,105,107,0); -- Za Dha Adamantking
REPLACE INTO `mob_groups` VALUES (8003,475,149,900,128,346,40000,0,101,105,0); -- Blubbery Bulge
REPLACE INTO `mob_groups` VALUES (8009,1046,149,1800,0,750,164236,35000,110,112,0);
REPLACE INTO `mob_groups` VALUES (8072,3075,150,7200,0,2728,60000,200000,105,107,0); -- Overlord Bakgodek
REPLACE INTO `mob_groups` VALUES (8096,4072,151,7200,0,3645,60000,200000,105,107,0); -- Tzee Xicu the Manifest
REPLACE INTO `mob_groups` VALUES (8114,4442,151,990,0,4283,0,0,65,69,0);
REPLACE INTO `mob_groups` VALUES (8120,4455,151,604800,128,4307,4260,0,72,74,0);
REPLACE INTO `mob_groups` VALUES (8175,1280,154,18000,128,918,50000,0,98,100,0); -- OST 86400
REPLACE INTO `mob_groups` VALUES (8178,2840,154,0,128,2425,98000,0,128,130,0);
REPLACE INTO `mob_groups` VALUES (8321,4404,155,0,0,4214,0,9000,81,83,0);
REPLACE INTO `mob_groups` VALUES (8322,4412,155,0,0,4228,0,0,81,83,0);
REPLACE INTO `mob_groups` VALUES (8323,4418,155,0,0,4237,0,0,81,83,0);
REPLACE INTO `mob_groups` VALUES (8379,87,158,7200,128,55,59000,0,101,105,0); -- Alkyoneus
REPLACE INTO `mob_groups` VALUES (8429,3712,159,0,128,3287,50000,60000,101,105,0); -- Sozu Rogberry
REPLACE INTO `mob_groups` VALUES (8463,1425,160,18000,0,1049,40000,0,101,105,0); -- Friar Rush
REPLACE INTO `mob_groups` VALUES (8508,1134,161,86400,128,808,40000,60000,101,105,0); -- Duke Haborym
REPLACE INTO `mob_groups` VALUES (8576,4239,162,7620,128,4019,40000,35000,101,105,0); -- Viscount Morax
REPLACE INTO `mob_groups` VALUES (8715,5479,164,330,0,4215,0,0,91,95,0); -- Yagudo Abbot
REPLACE INTO `mob_groups` VALUES (8717,4421,164,0,128,0,0,0,80,80,0); -- Yagudo Guard
REPLACE INTO `mob_groups` VALUES (8718,5492,164,330,0,4261,0,0,93,97,0); -- Yagudo Lutenist
REPLACE INTO `mob_groups` VALUES (8719,4433,164,330,0,4267,0,0,95,101,0); -- Yagudo Missionary
REPLACE INTO `mob_groups` VALUES (8720,5491,164,330,0,4293,0,0,93,97,0); -- Yagudo Prior
REPLACE INTO `mob_groups` VALUES (8721,4447,164,330,0,4297,0,0,95,101,0); -- Yagudo Pythoness
REPLACE INTO `mob_groups` VALUES (8722,4454,164,0,128,0,0,0,84,86,0); -- Yagudo's Elemental
REPLACE INTO `mob_groups` VALUES (8723,4455,164,330,0,4308,0,0,71,73,0);
REPLACE INTO `mob_groups` VALUES (8726,5482,164,330,0,4324,0,0,93,99,0); -- Yagudo Zealot
REPLACE INTO `mob_groups` VALUES (8892,525,171,1056,0,392,0,0,81,85,0); -- Brass Quadav
REPLACE INTO `mob_groups` VALUES (8894,538,171,1056,0,400,0,0,85,91,0); -- Bronze Quadav
REPLACE INTO `mob_groups` VALUES (8914,1207,171,1056,0,861,0,0,87,91,0); -- Emerald Quadav
REPLACE INTO `mob_groups` VALUES (8929,1917,171,1056,0,1653,0,0,85,91,0); -- Helidor Quadav
REPLACE INTO `mob_groups` VALUES (8947,2965,171,1056,0,2531,0,0,85,91,0); -- Old Quadav
REPLACE INTO `mob_groups` VALUES (8952,3200,171,1056,0,2829,0,0,83,88,0); -- Processionaire
REPLACE INTO `mob_groups` VALUES (8963,3464,171,1056,0,3058,0,0,87,91,0); -- Sapphirine Quadav
REPLACE INTO `mob_groups` VALUES (8972,3628,171,1056,0,3206,0,0,83,87,0); -- Silver Quadav
REPLACE INTO `mob_groups` VALUES (9036,1841,174,86400,128,1602,55000,0,118,120,0);
REPLACE INTO `mob_groups` VALUES (9089,1166,175,1056,0,0,0,0,96,99,0); -- Eastern Spriggan
REPLACE INTO `mob_groups` VALUES (9101,1638,175,1056,0,1225,0,0,76,81,0); -- Goblin Blastmaster
REPLACE INTO `mob_groups` VALUES (9102,1646,175,1056,0,1254,0,0,76,81,0); -- Goblin Corpsman
REPLACE INTO `mob_groups` VALUES (9103,1664,175,1056,0,1307,0,0,76,81,0); -- Goblin Freesword
REPLACE INTO `mob_groups` VALUES (9106,1698,175,1056,0,1415,0,0,76,81,0); -- Goblin Pioneer
REPLACE INTO `mob_groups` VALUES (9129,2908,175,1056,0,0,0,0,96,99,0); -- Northern Spriggan
REPLACE INTO `mob_groups` VALUES (9134,2998,175,1056,0,2574,0,0,91,96,0); -- Orcish Brawler
REPLACE INTO `mob_groups` VALUES (9135,3001,175,1056,0,2581,0,0,91,96,0); -- Orcish Chasseur
REPLACE INTO `mob_groups` VALUES (9136,3004,175,1056,0,2589,0,0,91,96,0); -- Orcish Cursemaker
REPLACE INTO `mob_groups` VALUES (9140,3039,175,1056,0,2692,0,0,91,96,0); -- Orcish Trooper
REPLACE INTO `mob_groups` VALUES (9167,3710,175,1056,0,0,0,0,96,99,0); -- Southern Spriggan
REPLACE INTO `mob_groups` VALUES (9177,4299,175,1056,0,4083,0,0,81,84,0); -- War Smilodon
REPLACE INTO `mob_groups` VALUES (9178,4325,175,1056,0,0,0,0,96,99,0); -- Western Spriggan
REPLACE INTO `mob_groups` VALUES (9187,698,176,3600,128,512,30000,0,80,81,0); -- Charybdis
REPLACE INTO `mob_groups` VALUES (9211,2803,176,10800,0,2414,60000,35000,115,117,0); -- Namtar
REPLACE INTO `mob_groups` VALUES (9231,3558,176,7200,0,3139,20000,20000,105,107,0); -- Seww the Squidlimbed
REPLACE INTO `mob_groups` VALUES (9267,289,178,330,0,4377,0,0,81,84,0); -- Aura Statue
REPLACE INTO `mob_groups` VALUES (9269,4672,178,0,128,0,45500,10000,110,115,0); -- pet byakko
REPLACE INTO `mob_groups` VALUES (9276,4670,178,0,128,0,45000,100000,110,115,0); -- pet genbu
REPLACE INTO `mob_groups` VALUES (9278,2265,178,0,128,4372,90000,50000,130,130,0); -- Kirin
REPLACE INTO `mob_groups` VALUES (9279,2266,178,0,128,0,30000,20000,100,105,0);
REPLACE INTO `mob_groups` VALUES (9284,4671,178,0,128,0,45000,100000,110,115,0); -- pet siryu
REPLACE INTO `mob_groups` VALUES (9286,4673,178,0,128,0,45000,100000,110,115,0); -- pet suzy
REPLACE INTO `mob_groups` VALUES (9290,75,179,0,128,0,25000,5000,120,120,0);
REPLACE INTO `mob_groups` VALUES (9291,305,179,0,128,0,75000,0,120,120,0);
REPLACE INTO `mob_groups` VALUES (9297,862,179,0,128,0,100000,5000,120,120,0);
REPLACE INTO `mob_groups` VALUES (9300,3199,179,0,128,0,50000,0,120,120,0);
REPLACE INTO `mob_groups` VALUES (9303,3584,179,0,128,0,25000,5000,120,120,0);
REPLACE INTO `mob_groups` VALUES (9304,4006,179,0,128,0,100000,5000,120,120,0);
REPLACE INTO `mob_groups` VALUES (9305,4249,179,0,128,0,75000,0,120,120,0);
REPLACE INTO `mob_groups` VALUES (9490,4064,188,0,128,3639,8000,0,77,78,0); -- Tymexox_Ninefingers
REPLACE INTO `mob_groups` VALUES (9510,70,190,0,128,0,15000,10000,107,107,0); -- Airi
REPLACE INTO `mob_groups` VALUES (9513,671,190,14400,128,498,140000,0,110,112,0);
REPLACE INTO `mob_groups` VALUES (9535,2105,190,0,128,0,15000,10000,107,107,0); -- Iruci
REPLACE INTO `mob_groups` VALUES (9539,3124,190,0,128,0,15000,10000,107,107,0); -- Pey
REPLACE INTO `mob_groups` VALUES (9551,4261,190,86400,128,4033,200000,100000,125,125,0); -- Vrtra
REPLACE INTO `mob_groups` VALUES (9649,3795,193,792,0,3387,0,0,103,105,0); -- Stroper Chyme
REPLACE INTO `mob_groups` VALUES (9784,2165,196,86400,0,1861,52000,80000,118,120,0); -- Juggler Hecatomb
REPLACE INTO `mob_groups` VALUES (9806,297,197,750,128,213,3827,0,68,68,0);
REPLACE INTO `mob_groups` VALUES (9810,940,197,330,0,662,0,0,40,42,0); -- Exoray
REPLACE INTO `mob_groups` VALUES (9816,1271,197,330,0,912,0,0,51,54,0); -- Death Jacket
REPLACE INTO `mob_groups` VALUES (9820,1990,197,330,0,1705,0,0,50,53,0); -- Hornfly
REPLACE INTO `mob_groups` VALUES (9838,4375,197,330,0,4187,0,0,40,44,0); -- Worker Crawler
REPLACE INTO `mob_groups` VALUES (9842,228,198,3600,0,174,3500,0,36,37,0); -- Argus
REPLACE INTO `mob_groups` VALUES (9866,2386,198,3600,0,2039,3200,0,35,36,0); -- Leech King
REPLACE INTO `mob_groups` VALUES (9910,3549,200,21400,128,3130,50000,0,70,70,0); -- Serket
REPLACE INTO `mob_groups` VALUES (9931,630,204,21400,128,465,25000,0,70,70,0); -- Capericious Cassie
REPLACE INTO `mob_groups` VALUES (9940,1164,204,3600,0,835,0,0,63,63,0); -- Eastern Shadow
REPLACE INTO `mob_groups` VALUES (9960,4323,204,3600,0,4137,0,0,63,63,0); -- Western Shadow
REPLACE INTO `mob_groups` VALUES (9962,265,205,86400,128,191,60000,80000,113,115,0); -- Ash Dragon
REPLACE INTO `mob_groups` VALUES (9990,4066,205,86400,0,3642,43000,60000,101,105,0); -- Tyrannic Tunnok
REPLACE INTO `mob_groups` VALUES (9994,4258,205,21600,0,4031,40000,20000,101,105,0); -- Vouivre
REPLACE INTO `mob_groups` VALUES (10094,4001,208,5400,0,3588,40500,0,101,105,0); -- Triarius X-XV
REPLACE INTO `mob_groups` VALUES (10105,339,212,7200,0,241,60000,60000,115,117,0); -- Baobhan Sith
REPLACE INTO `mob_groups` VALUES (10107,584,212,7200,128,434,20000,0,80,80,0); -- Bune
REPLACE INTO `mob_groups` VALUES (10135,3856,212,7200,0,3441,50000,60000,115,117,0); -- Taxim
REPLACE INTO `mob_groups` VALUES (10138,4390,212,21600,128,4200,0,0,70,75,0); -- Wyvernpoacher Drachlox
REPLACE INTO `mob_groups` VALUES (10158,2439,213,21600,128,2079,60000,0,125,130,0); -- Lord of Onzozo
REPLACE INTO `mob_groups` VALUES (10161,2790,213,3600,128,2404,4500,0,50,52,0); -- Mysticmaker Profblix
REPLACE INTO `mob_groups` VALUES (10163,3063,213,3600,128,2722,9400,0,65,70,0); -- Ose
REPLACE INTO `mob_groups` VALUES (10172,61,215,900,0,32,70000,200000,118,120,0); -- Aggressor Antlion
REPLACE INTO `mob_groups` VALUES (10173,115,215,60,0,82,12000,1000,114,117,0); -- Amuckatrice
REPLACE INTO `mob_groups` VALUES (10174,116,215,900,0,83,90000,200000,118,120,0); -- Amun
REPLACE INTO `mob_groups` VALUES (10178,398,215,0,128,278,95000,999,118,120,0); -- Berstuk
REPLACE INTO `mob_groups` VALUES (10179,448,215,0,128,321,90000,100000,118,120,0); -- Blazing Eruca
REPLACE INTO `mob_groups` VALUES (10180,700,215,60,0,514,12000,1000,114,117,0); -- Chasm Coeurl
REPLACE INTO `mob_groups` VALUES (10181,701,215,60,0,9258,12000,10000,114,117,0); -- Chasm Gnat
REPLACE INTO `mob_groups` VALUES (10182,835,215,60,0,598,12000,1999,114,117,0); -- Crevice Amoeban
REPLACE INTO `mob_groups` VALUES (10184,943,215,60,0,665,12000,1000,114,117,0); -- Decayed Flesh
REPLACE INTO `mob_groups` VALUES (10186,956,215,60,0,671,12000,10000,114,117,0); -- Defile Scorpion
REPLACE INTO `mob_groups` VALUES (10188,1117,215,0,128,797,70000,200000,118,120,0); -- Drekavak
REPLACE INTO `mob_groups` VALUES (10191,1236,215,60,0,879,12000,10000,114,117,0); -- Entozoon
REPLACE INTO `mob_groups` VALUES (10195,1439,215,60,0,9259,12000,1000,114,117,0); -- funnel Antilion
REPLACE INTO `mob_groups` VALUES (10196,1446,215,0,128,1069,70000,10000,118,120,0); -- Gaizkin
REPLACE INTO `mob_groups` VALUES (10196,1446,215,0,128,9243,80000,20999,118,120,0); -- gaizkin
REPLACE INTO `mob_groups` VALUES (10197,1547,215,600,0,9244,90000,10000,118,120,0); -- gieremund
REPLACE INTO `mob_groups` VALUES (10197,1547,215,900,0,1142,70000,10000,118,120,0); -- Gieremund
REPLACE INTO `mob_groups` VALUES (10198,1789,215,0,128,1543,70000,10000,118,120,0); -- Granite Borer
REPLACE INTO `mob_groups` VALUES (10199,1844,215,60,0,1605,12000,1000,114,117,0); -- Gullycampa
REPLACE INTO `mob_groups` VALUES (10200,1889,215,60,0,1627,12000,1999,114,117,0); -- Hannequet
REPLACE INTO `mob_groups` VALUES (10201,2053,215,60,0,1768,12000,1000,114,117,0); -- Ignis Eruca
REPLACE INTO `mob_groups` VALUES (10203,2084,215,60,0,1790,12000,10000,114,117,0); -- Inugami
REPLACE INTO `mob_groups` VALUES (10204,2091,215,900,0,1794,90000,200000,118,120,0); -- Ironclad Cleaver
REPLACE INTO `mob_groups` VALUES (10205,2109,215,0,128,1812,110000,259099,118,120,0); -- Itzpapaloti
REPLACE INTO `mob_groups` VALUES (10206,2183,215,0,128,1869,90000,200000,118,120,0); -- Kampe
REPLACE INTO `mob_groups` VALUES (10207,2219,215,0,128,1891,90000,10000,118,120,0); -- Kharon
REPLACE INTO `mob_groups` VALUES (10210,2650,215,0,128,9245,90000,10000,118,120,0); -- mielikki
-- Om ' Aern
-- pld
REPLACE INTO `mob_groups` VALUES (10211,2773,215,60,0,2387,12000,2100,114,117,0); -- Murrian Chigoe
-- rng
REPLACE INTO `mob_groups` VALUES (10212,2785,215,60,0,2403,12000,20000,114,117,0); -- Myriadeyes
-- bst
REPLACE INTO `mob_groups` VALUES (10213,2876,215,0,128,2461,90000,200000,118,120,0); -- Nightshade
-- war
REPLACE INTO `mob_groups` VALUES (10216,3087,215,0,128,2738,70000,100000,118,120,0); -- Palid Percy
-- drg
REPLACE INTO `mob_groups` VALUES (10221,3364,215,60,0,2963,12000,10000,114,117,0); -- Rift Dragon
-- drk
REPLACE INTO `mob_groups` VALUES (10222,3365,215,60,0,2964,12000,10000,114,117,0); -- Rift Treant
-- whm
REPLACE INTO `mob_groups` VALUES (10223,3382,215,60,0,3002,12000,10000,114,117,0); -- Rock Murex
-- thf
REPLACE INTO `mob_groups` VALUES (10224,3498,215,60,0,3082,12000,10000,114,117,0); -- Schnitter
-- sam
REPLACE INTO `mob_groups` VALUES (10226,3678,215,0,128,3241,110000,250000,118,120,0); -- Smok
-- blm
REPLACE INTO `mob_groups` VALUES (10227,3746,215,60,0,3325,12000,10000,114,117,0); -- Spuk
-- mnk
-- rdm
REPLACE INTO `mob_groups` VALUES (10230,3861,217,0,128,9247,70000,10000,118,120,0); -- Chhir Batti
-- smn
REPLACE INTO `mob_groups` VALUES (10230,3861,215,600,0,9247,60000,10000,118,120,0); -- tejas
REPLACE INTO `mob_groups` VALUES (10231,3881,215,60,0,3452,12000,1000,114,117,0); -- Terminus Eft
REPLACE INTO `mob_groups` VALUES (10232,3932,215,0,128,3529,90000,200000,118,120,0); -- Titlacauan
REPLACE INTO `mob_groups` VALUES (10233,3989,215,60,0,3576,12000,10000,114,117,0); -- Treacle Slug
REPLACE INTO `mob_groups` VALUES (10234,4051,215,900,0,3625,70000,200000,118,120,0); -- Tunga
-- brd
REPLACE INTO `mob_groups` VALUES (10235,4080,215,0,128,3648,110000,200000,118,120,0); -- Ulhuadshi
REPLACE INTO `mob_groups` VALUES (10238,4288,215,900,0,4071,70000,200000,118,120,0); -- Warbler
REPLACE INTO `mob_groups` VALUES (10239,4328,215,0,128,4138,90000,200000,118,120,0); -- Wherewetrice
REPLACE INTO `mob_groups` VALUES (10240,4329,215,900,0,4139,70000,200000,118,120,0); -- Whiro
REPLACE INTO `mob_groups` VALUES (10241,4400,215,900,0,4207,110000,209999,118,120,0); -- Yaanei
REPLACE INTO `mob_groups` VALUES (10242,25,216,600,0,9228,60000,10000,118,120,0); -- Abyssic Cluster
REPLACE INTO `mob_groups` VALUES (10243,26,216,60,0,7,12000,12000,114,117,0); -- Abyssobugard
REPLACE INTO `mob_groups` VALUES (10244,108,216,0,128,75,110000,200000,118,120,0); -- Amhuluk
REPLACE INTO `mob_groups` VALUES (10245,124,216,60,0,92,12000,12000,114,117,0); -- Ancient Orbon
REPLACE INTO `mob_groups` VALUES (10246,256,216,900,0,186,70000,200000,118,120,0); -- asanbosam
REPLACE INTO `mob_groups` VALUES (10247,276,216,900,0,198,70000,200000,118,120,0); -- Athamas
REPLACE INTO `mob_groups` VALUES (10248,279,216,60,0,201,12000,12000,114,117,0); -- Atrociraptor
REPLACE INTO `mob_groups` VALUES (10249,293,216,0,128,9229,60000,20999,118,120,0); -- Avalerion
REPLACE INTO `mob_groups` VALUES (10250,356,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10251,357,216,60,0,9260,12000,10000,114,117,0); -- Boartrap
REPLACE INTO `mob_groups` VALUES (10252,481,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10253,533,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10254,589,216,60,0,439,12000,10000,114,117,0); -- Buzzfly
REPLACE INTO `mob_groups` VALUES (10255,678,216,0,128,501,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10255,678,216,0,128,9230,80000,10000,118,120,0); -- Cep-Kamuy
REPLACE INTO `mob_groups` VALUES (10256,729,216,0,128,529,110000,100000,118,120,0); -- Cirein-croin
REPLACE INTO `mob_groups` VALUES (10257,750,216,60,0,551,12000,1000,114,117,0); -- Coastal Colibri
REPLACE INTO `mob_groups` VALUES (10258,825,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10259,869,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10260,945,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10261,1037,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10262,1048,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10263,1142,216,60,0,816,12000,1000,114,117,0); -- Dusk Lizard
REPLACE INTO `mob_groups` VALUES (10264,1157,216,60,0,827,12000,1000,114,117,0); -- Dynamo CLUSTER
REPLACE INTO `mob_groups` VALUES (10265,1162,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10266,1176,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10267,1243,216,60,0,886,10000,9990,114,117,0);
REPLACE INTO `mob_groups` VALUES (10268,1246,216,60,0,891,10000,9990,114,117,0);
REPLACE INTO `mob_groups` VALUES (10269,1258,216,60,0,901,10000,9990,114,117,0);
REPLACE INTO `mob_groups` VALUES (10270,1359,216,600,0,9231,70000,20999,118,120,0); -- Flame skimmer
REPLACE INTO `mob_groups` VALUES (10271,1427,216,60,0,1052,12000,1000,114,117,0); -- Frigatebird
REPLACE INTO `mob_groups` VALUES (10272,1437,216,0,128,1059,70000,10000,118,120,0); -- Funereal_Apkallu
REPLACE INTO `mob_groups` VALUES (10273,1475,216,60,0,1086,12000,1000,114,117,0); -- Gasher
REPLACE INTO `mob_groups` VALUES (10274,1766,216,60,0,1529,12000,1000,114,117,0); -- Gore Bats
REPLACE INTO `mob_groups` VALUES (10275,1842,216,900,0,1603,90000,20000,118,120,0); -- Gukmatz
REPLACE INTO `mob_groups` VALUES (10276,1932,216,900,0,1668,70000,250000,118,120,0); -- Heqet
REPLACE INTO `mob_groups` VALUES (10277,2061,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10278,2093,216,0,128,9232,70000,10000,118,120,0); -- Ironclad Observer
REPLACE INTO `mob_groups` VALUES (10279,2094,216,0,128,2498,90000,200000,118,120,0); -- Ironclad Pulverizor
REPLACE INTO `mob_groups` VALUES (10280,2095,216,900,0,9234,90000,10000,118,120,0); -- Ironclad Severer
REPLACE INTO `mob_groups` VALUES (10281,2139,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10281,2139,216,600,0,9235,70000,10000,118,120,0); -- Jala
REPLACE INTO `mob_groups` VALUES (10282,2195,216,0,128,9236,70000,20999,118,120,0); -- Karkatakam
REPLACE INTO `mob_groups` VALUES (10283,2302,216,900,0,1972,110000,119990,118,120,0); -- Kuthaei
REPLACE INTO `mob_groups` VALUES (10284,2418,216,60,0,2062,12000,1000,114,117,0); -- Limestone Hare
REPLACE INTO `mob_groups` VALUES (10285,2553,216,0,128,9237,70000,10000,118,120,0); -- Manohra
REPLACE INTO `mob_groups` VALUES (10286,2567,216,60,0,2204,12000,10000,114,117,0); -- Maritime Peiste
REPLACE INTO `mob_groups` VALUES (10287,2666,216,0,128,9238,70000,20999,118,120,0); -- Minax Bugard
REPLACE INTO `mob_groups` VALUES (10288,2682,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10289,2781,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10290,2819,216,0,128,9239,70000,10000,118,120,0); -- Nehebkau
REPLACE INTO `mob_groups` VALUES (10290,2819,216,60,0,2421,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10291,2905,216,0,128,2484,75000,0,114,117,0); -- Nonno
REPLACE INTO `mob_groups` VALUES (10292,2918,216,0,128,9241,70000,20999,118,120,0); -- Npfundlwa
REPLACE INTO `mob_groups` VALUES (10293,2933,216,60,0,2498,12000,10000,114,117,0); -- Observer
REPLACE INTO `mob_groups` VALUES (10294,2991,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10295,2992,216,60,0,2555,12000,2000,114,117,0); -- Orapodium
REPLACE INTO `mob_groups` VALUES (10296,3074,216,60,0,2727,12000,200000,118,120,0); -- Overking apkallu
REPLACE INTO `mob_groups` VALUES (10297,3077,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10298,3210,216,60,0,2832,12000,11999,114,117,0); -- Protoamban
REPLACE INTO `mob_groups` VALUES (10299,3247,216,60,0,0,100000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10300,3266,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10301,3329,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10302,3508,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10303,3610,216,60,0,3190,12000,10000,114,117,0); -- Shore Spider
REPLACE INTO `mob_groups` VALUES (10304,3635,216,0,128,3211,70000,200000,118,120,0); -- Sirrush
REPLACE INTO `mob_groups` VALUES (10305,3661,216,60,0,3231,12000,10000,114,117,0); -- Slasher
REPLACE INTO `mob_groups` VALUES (10306,3695,216,0,128,3273,110000,10000,118,120,0); -- Sobek
REPLACE INTO `mob_groups` VALUES (10307,3748,216,60,0,9261,12000,10000,114,117,0); -- Squib
REPLACE INTO `mob_groups` VALUES (10308,3798,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10309,3813,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10310,4007,216,60,0,3592,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10311,4056,216,0,128,9242,70000,10000,118,120,0); -- Tuskertrap
REPLACE INTO `mob_groups` VALUES (10312,4229,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10313,4230,216,60,0,0,10000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10314,58,217,60,0,31,12000,1000,114,117,0); -- Aestutaur
REPLACE INTO `mob_groups` VALUES (10315,245,217,0,128,9223,60000,20999,118,120,0); -- Armillaria
REPLACE INTO `mob_groups` VALUES (10316,308,217,900,0,221,70000,100000,118,120,0); -- Ayravata
REPLACE INTO `mob_groups` VALUES (10319,442,217,60,0,315,12000,10000,114,117,0); -- Bladejaw Pugil
REPLACE INTO `mob_groups` VALUES (10320,572,217,0,128,424,110000,0,118,120,0); -- Bukhis
REPLACE INTO `mob_groups` VALUES (10321,712,217,0,128,9224,60000,10000,118,120,0); -- Chhir Batti
REPLACE INTO `mob_groups` VALUES (10322,734,217,60,0,534,10000,10000,114,117,0); -- Clammy Imp
REPLACE INTO `mob_groups` VALUES (10323,757,217,60,0,554,12000,10000,114,117,0); -- Coccinelle
REPLACE INTO `mob_groups` VALUES (10327,1014,217,60,0,718,12000,10000,114,117,0); -- Devegetator
REPLACE INTO `mob_groups` VALUES (10329,1053,217,600,0,9225,60000,10000,118,120,0); -- Dive e Sepid
REPLACE INTO `mob_groups` VALUES (10330,1140,217,0,128,9226,110000,20999,118,120,0); -- Durinn
REPLACE INTO `mob_groups` VALUES (10331,1148,217,0,128,9227,90000,10000,118,120,0); -- Dvalinn
REPLACE INTO `mob_groups` VALUES (10336,1436,217,600,0,9213,80000,10000,118,120,0); -- Fulmotondro
REPLACE INTO `mob_groups` VALUES (10337,1629,217,0,128,9214,70000,20999,118,120,0); -- Gnatworth Gary
REPLACE INTO `mob_groups` VALUES (10338,1828,217,60,0,1589,12000,12000,114,117,0); -- Gruesome Gargoile
REPLACE INTO `mob_groups` VALUES (10339,1890,217,900,0,1628,70000,200000,118,120,0); -- Hanuman
REPLACE INTO `mob_groups` VALUES (10340,1929,217,60,0,1667,12000,21000,114,117,0); -- Helter Skelter
REPLACE INTO `mob_groups` VALUES (10342,1998,217,900,0,1708,70000,200000,118,120,0); -- Hrosshvalur
REPLACE INTO `mob_groups` VALUES (10343,2056,217,900,0,1774,70000,200000,118,120,0); -- Ikatomi
REPLACE INTO `mob_groups` VALUES (10344,2057,217,0,128,9215,70000,10000,118,120,0); -- Iku-Turso
REPLACE INTO `mob_groups` VALUES (10346,2092,217,900,0,9729,90000,200000,118,120,0); -- Ironclad Executioner
REPLACE INTO `mob_groups` VALUES (10347,2142,217,60,0,1841,12000,100000,114,117,0); -- Jasconius
REPLACE INTO `mob_groups` VALUES (10348,2178,217,0,128,9216,70000,20999,118,120,0); -- Kadraeth the Hatespawn
REPLACE INTO `mob_groups` VALUES (10349,2194,217,0,128,9217,80000,10000,118,120,0); -- Karkadann
REPLACE INTO `mob_groups` VALUES (10351,2218,217,0,128,9218,70000,20999,118,120,0); -- Khalkotaur
REPLACE INTO `mob_groups` VALUES (10352,2440,217,900,0,2080,90000,200000,118,120,0); -- Lord Varney
REPLACE INTO `mob_groups` VALUES (10353,2749,217,60,0,2356,12000,10000,114,117,0); -- Morose Marid
REPLACE INTO `mob_groups` VALUES (10356,3101,217,0,128,9728,70000,200000,118,120,0); -- Pascerpot
REPLACE INTO `mob_groups` VALUES (10357,3110,217,60,0,2755,12000,10000,114,117,0); -- Peapuk
REPLACE INTO `mob_groups` VALUES (10358,3161,217,60,0,2805,12000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10359,3247,217,60,0,0,12000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10360,3266,217,60,0,0,12000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10361,3278,217,0,128,9219,80000,10000,118,120,0); -- Quasimodo
REPLACE INTO `mob_groups` VALUES (10362,3314,217,0,128,9220,70000,10000,118,120,0); -- Rakshas
REPLACE INTO `mob_groups` VALUES (10363,3329,217,60,0,0,12000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10364,3372,217,60,0,2977,12000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10365,3417,217,60,0,3018,12000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10366,3508,217,60,0,0,12000,10000,114,117,0);
REPLACE INTO `mob_groups` VALUES (10368,3528,217,0,128,3106,110000,100000,118,120,0); -- Sedna
REPLACE INTO `mob_groups` VALUES (10369,3547,217,0,128,9221,80000,20999,118,120,0); -- Seps
REPLACE INTO `mob_groups` VALUES (10370,3594,217,60,0,3181,12000,10000,114,117,0); -- Sheriwhile
REPLACE INTO `mob_groups` VALUES (10371,3632,217,900,0,3210,110000,200000,118,120,0); -- Sippoy
REPLACE INTO `mob_groups` VALUES (10372,3665,217,60,0,3232,12000,10000,114,117,0); -- Slaughterhouse Smilodon
REPLACE INTO `mob_groups` VALUES (10373,3673,217,60,0,3237,12000,10000,114,117,0); -- Slough Bats
REPLACE INTO `mob_groups` VALUES (10374,3726,217,60,0,3299,12000,10000,114,117,0); -- Speltercap
REPLACE INTO `mob_groups` VALUES (10375,3735,217,60,0,3311,12000,10000,114,117,0); -- Spittin gSpider
REPLACE INTO `mob_groups` VALUES (10382,4347,217,60,0,9262,12000,11000,114,117,0); -- wily opo-opo
REPLACE INTO `mob_groups` VALUES (10383,4392,217,0,128,9222,60000,10000,118,120,0); -- Xan
REPLACE INTO `mob_groups` VALUES (10385,78,218,60,0,48,10000,20000,121,125,0); -- Akrab Aby Altep
REPLACE INTO `mob_groups` VALUES (10386,102,218,0,128,61,110000,300000,126,128,0); -- Amarok Aby Altep
REPLACE INTO `mob_groups` VALUES (10387,161,218,600,0,118,80000,300000,126,128,0); -- Ansherekh Aby Altep
REPLACE INTO `mob_groups` VALUES (10388,229,218,60,0,48,10000,20000,121,125,0); -- Arid Limule Aby Altep
REPLACE INTO `mob_groups` VALUES (10389,321,218,60,0,227,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10390,323,218,60,0,48,10000,20000,121,125,0); -- Baelfyr Aby Altep
REPLACE INTO `mob_groups` VALUES (10391,350,218,60,0,249,10000,20000,121,125,0); -- Barrens Trant Aby Altep
REPLACE INTO `mob_groups` VALUES (10392,368,218,60,0,257,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10393,391,218,0,128,273,110000,350000,126,128,0); -- Bennu Aby Altep
REPLACE INTO `mob_groups` VALUES (10394,499,218,60,0,369,10000,20000,121,125,0); -- Bonfire Aby Altep
REPLACE INTO `mob_groups` VALUES (10395,544,218,60,0,406,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10396,570,218,0,128,423,10000,30000,126,128,0); -- Bugul Noz Aby Altep
REPLACE INTO `mob_groups` VALUES (10397,593,218,60,0,48,10000,20000,121,125,0); -- Byrgen Aby altep
REPLACE INTO `mob_groups` VALUES (10398,615,218,60,0,452,10000,20000,121,125,0); -- Camelpardalis Aby Altep
REPLACE INTO `mob_groups` VALUES (10399,713,218,0,128,523,75000,30000,126,128,0); -- Chickharney Aby Altep
REPLACE INTO `mob_groups` VALUES (10400,859,218,600,0,611,90000,300000,126,128,0); -- Cuijatender Aby Altep
REPLACE INTO `mob_groups` VALUES (10401,1005,218,60,0,9263,10000,20000,121,125,0); -- Desert Clinoid Aby Altep
REPLACE INTO `mob_groups` VALUES (10402,1008,218,60,0,712,10000,20000,121,125,0); -- Desert Puk Aby Altep
REPLACE INTO `mob_groups` VALUES (10403,1106,218,0,128,788,110000,300000,126,128,0); -- Dragua Aby Altep
REPLACE INTO `mob_groups` VALUES (10404,1136,218,60,0,810,10000,20000,121,125,0); -- Dune Cockatrice Aby Altep
REPLACE INTO `mob_groups` VALUES (10405,1137,218,60,0,811,10000,20000,121,125,0); -- Dune Cockatrice Aby Altep
REPLACE INTO `mob_groups` VALUES (10406,1160,218,60,0,834,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10407,1210,218,0,128,867,100000,300000,126,128,0); -- Emperador de Altepa Aby Altep
REPLACE INTO `mob_groups` VALUES (10408,1253,218,60,0,897,10000,20000,121,125,0); -- Ergdrake Aby Altep
REPLACE INTO `mob_groups` VALUES (10409,1311,218,60,0,937,10000,20000,121,125,0); -- Fear Dearg Aby Altep
REPLACE INTO `mob_groups` VALUES (10410,1341,218,60,0,960,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10411,1476,218,60,0,1087,10000,20000,121,125,0); -- Gastornis Aby Altep
REPLACE INTO `mob_groups` VALUES (10412,1487,218,60,0,0,10000,20000,121,125,0); -- Gefyrst Aby Altep
REPLACE INTO `mob_groups` VALUES (10413,1908,218,600,0,1645,90000,300000,126,128,0); -- Hazhidiha Aby Altep
REPLACE INTO `mob_groups` VALUES (10414,1913,218,600,0,1649,110000,300000,126,128,0); -- Hedjedjet Aby Altep
REPLACE INTO `mob_groups` VALUES (10415,2096,218,0,128,1798,90000,300000,126,128,0); -- Ironclad Smiter Aby Altep
REPLACE INTO `mob_groups` VALUES (10416,2278,218,60,0,1951,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10417,2432,218,600,0,2075,90000,200000,121,125,0); -- Battlerigged Chariot Aby Altep
REPLACE INTO `mob_groups` VALUES (10418,2551,218,60,0,2194,9000,20000,121,125,0); -- Manigordo Aby Altep
REPLACE INTO `mob_groups` VALUES (10419,2804,218,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10420,2805,218,60,0,2415,10000,20000,121,125,0); -- Nannakola Aby Altep
REPLACE INTO `mob_groups` VALUES (10421,2930,218,60,0,9264,10000,20000,121,125,0); -- Oasis Amoeban Aby Altep
REPLACE INTO `mob_groups` VALUES (10422,3061,218,0,128,2721,110000,300000,126,128,0); -- Orhtrus Aby Altep
REPLACE INTO `mob_groups` VALUES (10423,3071,218,600,0,2725,90000,300000,126,128,0); -- Ouzelum Aby Altep
REPLACE INTO `mob_groups` VALUES (10424,3323,218,0,128,2925,110000,300999,120,120,0); -- Rani Aby Altep
REPLACE INTO `mob_groups` VALUES (10425,3457,218,60,0,3048,10000,20000,121,125,0); -- Sand Murex Aby Altep
REPLACE INTO `mob_groups` VALUES (10426,3458,218,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10427,3460,218,60,0,3051,10000,20000,121,125,0); -- Sand Sweepeer Aby Altep
REPLACE INTO `mob_groups` VALUES (10428,3585,218,0,128,3176,90000,10000,126,128,0); -- Sharabha
REPLACE INTO `mob_groups` VALUES (10429,3589,218,0,128,3180,90000,10000,126,128,0); -- Shaula
REPLACE INTO `mob_groups` VALUES (10430,3798,218,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10431,3813,218,60,0,0,10000,20000,121,125,0); -- Surveyor Aby Altep
REPLACE INTO `mob_groups` VALUES (10432,3832,218,0,128,3422,90000,10000,126,128,0); -- Tabilla
REPLACE INTO `mob_groups` VALUES (10434,4116,218,0,128,3673,90000,10000,126,128,0); -- Vadleany
REPLACE INTO `mob_groups` VALUES (10436,4316,218,0,128,4123,90000,10000,126,128,0); -- Waugyl
REPLACE INTO `mob_groups` VALUES (10636,48,253,60,0,28,10000,10000,121,125,0); -- Adasauras
REPLACE INTO `mob_groups` VALUES (10637,135,253,0,128,97,100000,90000,121,125,0); -- Anemic Aloysius Aby U
REPLACE INTO `mob_groups` VALUES (10638,195,253,0,128,151,110000,300000,126,128,0); -- Apedemac
REPLACE INTO `mob_groups` VALUES (10639,284,253,0,128,203,90000,3000000,126,128,0); -- Audumbla
REPLACE INTO `mob_groups` VALUES (10640,296,253,900,0,212,100000,3000000,126,128,0); -- Awahondo
REPLACE INTO `mob_groups` VALUES (10641,323,253,60,0,0,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10642,392,253,60,0,9265,10000,100000,126,128,0); -- Benumbed Vodorgia
REPLACE INTO `mob_groups` VALUES (10643,446,253,0,128,319,100000,100000,126,128,0); -- Blanga
REPLACE INTO `mob_groups` VALUES (10644,480,253,60,0,351,10000,1000,121,125,0); -- Bluffalo
REPLACE INTO `mob_groups` VALUES (10645,593,253,60,0,0,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10646,720,253,0,128,526,70000,10000,126,128,0); -- Chillwing_Hwitti
REPLACE INTO `mob_groups` VALUES (10647,722,253,60,0,527,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10648,1206,253,60,0,587,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10649,1025,253,0,128,727,90000,300000,126,128,0); -- Dhorme Khim
REPLACE INTO `mob_groups` VALUES (10650,1173,253,60,0,840,10000,10000,121,125,0); -- Ectozoon
REPLACE INTO `mob_groups` VALUES (10651,1212,253,900,0,869,75000,75000,121,125,0); -- Empousa
REPLACE INTO `mob_groups` VALUES (10652,1256,253,60,0,899,10000,10000,121,125,0); -- Ermit Imp
REPLACE INTO `mob_groups` VALUES (10653,1371,253,60,0,980,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10654,1430,253,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10655,1487,253,60,0,0,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10656,1966,253,60,0,1692,10000,10000,121,125,0); -- Hoarmite
REPLACE INTO `mob_groups` VALUES (10657,2040,253,60,0,0,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10658,2043,253,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10659,2069,253,600,0,1781,80000,10000,126,128,0); -- Impervious Chariot
REPLACE INTO `mob_groups` VALUES (10660,2075,253,900,0,1786,90000,300000,126,128,0); -- Indrik
REPLACE INTO `mob_groups` VALUES (10661,2098,253,0,128,1800,90000,300000,126,128,0); -- Ironclad Triturator
REPLACE INTO `mob_groups` VALUES (10662,2106,253,0,128,1810,110000,350000,126,128,0); -- Isgebind
REPLACE INTO `mob_groups` VALUES (10663,2277,253,0,128,1950,70000,10000,126,128,0); -- Koghatu
REPLACE INTO `mob_groups` VALUES (10664,2298,253,720,0,1970,10000,10000,121,125,0); -- Kur
REPLACE INTO `mob_groups` VALUES (10665,2460,253,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10666,2603,253,60,0,2236,10000,10000,121,125,0); -- Mechanical Menace
REPLACE INTO `mob_groups` VALUES (10667,2952,253,60,0,2513,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10668,2972,253,60,0,2534,10000,10000,121,125,0); -- Olyphant
REPLACE INTO `mob_groups` VALUES (10669,3092,253,0,128,2743,110000,300000,126,128,0); -- Pankorator
REPLACE INTO `mob_groups` VALUES (10670,3322,253,60,0,0,10000,9990,121,125,0);
REPLACE INTO `mob_groups` VALUES (10671,3348,253,60,0,2946,10000,9000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10672,3356,253,0,128,2951,120000,100000,126,128,0); -- Resheph
REPLACE INTO `mob_groups` VALUES (10673,3387,253,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10674,3623,253,60,0,3198,10000,10000,121,125,0); -- Sierra Tiger
REPLACE INTO `mob_groups` VALUES (10675,3636,253,900,0,3212,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10676,3686,253,60,0,3266,10000,10000,121,125,0); -- Snowflake
REPLACE INTO `mob_groups` VALUES (10677,3722,253,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10678,3798,253,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10679,3804,253,60,0,3398,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10680,3817,253,60,0,3410,10000,10000,121,125,0); -- Svelldrake
REPLACE INTO `mob_groups` VALUES (10681,4006,253,60,0,0,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10683,4104,253,0,128,3664,70000,10000,126,128,0); -- Upas-Kamuy
REPLACE INTO `mob_groups` VALUES (10684,4222,253,60,0,4008,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10685,4223,253,0,128,4009,70000,10000,126,128,0); -- Veri_Selen
REPLACE INTO `mob_groups` VALUES (10687,4403,253,0,128,4210,90000,300000,126,128,0); -- Yaguarogui
REPLACE INTO `mob_groups` VALUES (10690,83,254,0,128,52,120000,300000,126,128,0); -- Alfard Aby Grauberg
REPLACE INTO `mob_groups` VALUES (10691,114,254,0,128,81,120000,300000,126,128,0); -- Ampithrite Aby Grauberg
REPLACE INTO `mob_groups` VALUES (10692,270,254,900,0,196,90000,130000,126,128,0); -- Assailer Chariot Aby Graub
REPLACE INTO `mob_groups` VALUES (10693,309,254,0,128,222,110000,300000,126,128,0); -- Azdaja Aby Graub
REPLACE INTO `mob_groups` VALUES (10695,492,254,0,128,365,80000,300000,126,128,0); -- Bomblix Flamefinger Aby Graub
REPLACE INTO `mob_groups` VALUES (10696,587,254,0,128,438,80000,30000,126,128,0); -- Burstrox Powderplate Aby Graub
REPLACE INTO `mob_groups` VALUES (10699,950,254,090,0,667,90000,10000,126,128,0); -- Deelgeed Aby Graub
REPLACE INTO `mob_groups` VALUES (10700,961,254,60,0,675,10000,1000,121,125,0); -- Deimobugard Aby graub
REPLACE INTO `mob_groups` VALUES (10701,1305,254,60,0,936,10000,10000,121,125,0); -- Faunus Wyvern Aby graub
REPLACE INTO `mob_groups` VALUES (10702,1367,254,600,0,975,100000,100000,126,128,0); -- fleshflayer Aby graub
REPLACE INTO `mob_groups` VALUES (10704,1434,254,600,0,1057,90000,1500000,126,128,0); -- Fuath Aby Graub
REPLACE INTO `mob_groups` VALUES (10707,1619,254,60,0,1184,10000,10000,121,125,0); -- Glade Wivre aby graub
REPLACE INTO `mob_groups` VALUES (10708,1621,254,60,0,1185,10000,10000,121,125,0); -- Glen Crab Aby graub
REPLACE INTO `mob_groups` VALUES (10709,1686,254,60,0,1370,10000,100000,121,125,0); -- Goblin Meatgrinder aby graub
REPLACE INTO `mob_groups` VALUES (10710,1700,254,60,0,1416,10000,100000,121,125,0); -- Goblin Plunderer aby graub
REPLACE INTO `mob_groups` VALUES (10712,2055,254,0,128,1773,80000,10000,126,128,0); -- Ika-Roa Aby Graub
REPLACE INTO `mob_groups` VALUES (10713,2097,254,0,128,9210,90000,10000,126,128,0); -- Ironclad Sunderer
REPLACE INTO `mob_groups` VALUES (10714,2122,254,600,0,1821,80000,100000,126,128,0); -- Jaculus Aby graub
REPLACE INTO `mob_groups` VALUES (10716,2441,254,0,128,9211,90000,20999,126,128,0); -- Lorelei
REPLACE INTO `mob_groups` VALUES (10718,2613,254,600,0,2242,80000,200000,126,128,0); -- Melo Melo Aby graub
REPLACE INTO `mob_groups` VALUES (10719,2665,254,0,128,2292,80000,100000,126,128,0); -- Minaruja Aby Graub
REPLACE INTO `mob_groups` VALUES (10720,2733,254,60,0,9266,20000,10000,121,125,0); -- Monitor aby graub
REPLACE INTO `mob_groups` VALUES (10721,2887,254,0,128,2473,110000,100000,126,128,0); -- Ningishzida Aby Graub
REPLACE INTO `mob_groups` VALUES (10722,3108,254,60,0,9267,10000,10000,121,125,0); -- Peak Pugil aby graub
REPLACE INTO `mob_groups` VALUES (10724,3173,254,60,0,2816,10000,1900,121,125,0); -- Pond Amoeban aby graub
REPLACE INTO `mob_groups` VALUES (10725,3237,254,60,0,2880,10000,10000,121,125,0); -- Putrid Peapuk aby graub
REPLACE INTO `mob_groups` VALUES (10726,3313,254,0,128,2920,110000,999900,126,128,0); -- Raja Aby Graub
REPLACE INTO `mob_groups` VALUES (10727,3350,254,600,0,2947,80000,100000,126,128,0); -- Rencounter Chariot Aby graub
REPLACE INTO `mob_groups` VALUES (10728,3538,254,60,0,3112,10000,10000,121,125,0); -- Seelie aby graub
REPLACE INTO `mob_groups` VALUES (10729,3542,254,60,0,3122,10000,11900,120,120,0); -- Sensenmann aby graub
REPLACE INTO `mob_groups` VALUES (10730,3631,254,60,0,3209,10000,10000,121,125,0);
REPLACE INTO `mob_groups` VALUES (10734,3802,254,60,0,3391,10000,10000,121,125,0); -- Stygian Dijinn aby graub
REPLACE INTO `mob_groups` VALUES (10735,3859,254,0,128,3443,100000,100000,126,128,0); -- teekesselchen aby graub
REPLACE INTO `mob_groups` VALUES (10736,3883,254,0,128,9212,90000,10000,126,128,0); -- Teugghia
REPLACE INTO `mob_groups` VALUES (10737,4099,254,60,0,0,10000,99900,121,125,0); -- Ungeweder aby graub
REPLACE INTO `mob_groups` VALUES (10738,4101,254,60,0,3660,10000,20000,121,125,0); -- Unseelie aby graub
REPLACE INTO `mob_groups` VALUES (10740,4395,254,0,128,4204,90000,200000,126,128,0); -- Xibalba aby graub
REPLACE INTO `mob_groups` VALUES (10850,344,28,330,0,8999,0,0,81,84,0); -- Aqueduct Spider
REPLACE INTO `mob_groups` VALUES (10891,4594,72,0,128,4381,60000,60000,115,120,0); -- Wulgaru
REPLACE INTO `mob_groups` VALUES (11004,4656,81,0,128,9603,80000,100000,120,120,0); -- Cottus 81
REPLACE INTO `mob_groups` VALUES (11190,5137,52,10800,0,9309,80000,100000,110,112,0); -- Harvestman
REPLACE INTO `mob_groups` VALUES (12950,4534,45,60,0,9250,10000,0,106,110,0); -- Thalassinon Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12951,4533,45,60,0,9251,10000,10000,106,110,0); -- Vermes Carnium Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12952,4535,45,60,0,9252,10000,20000,106,110,0); -- Wiederganger Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12953,4536,45,60,0,9253,10000,10000,106,110,0); -- Nematocera Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12954,4537,45,60,0,9254,10000,20000,106,110,0); -- Bog Body Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12955,4543,45,0,128,9727,90000,22999,113,116,0); -- Vetehinen
REPLACE INTO `mob_groups` VALUES (12956,4544,45,0,128,9723,90000,20000,113,116,0); -- Ophanim
REPLACE INTO `mob_groups` VALUES (12957,4545,45,0,128,9255,80000,10000,113,116,0); -- cannered noz
REPLACE INTO `mob_groups` VALUES (12958,4546,45,0,128,9726,80000,20000,113,116,0); -- treble Noctules
REPLACE INTO `mob_groups` VALUES (12959,4547,45,0,128,9713,80000,20000,113,116,0); -- Gancanagh
REPLACE INTO `mob_groups` VALUES (12960,4548,45,0,128,9715,80000,10000,113,116,0); -- Hedetet
REPLACE INTO `mob_groups` VALUES (12961,4549,45,0,128,9707,80000,0,113,116,0); -- Abas Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12962,4550,45,0,128,9709,80000,10000,113,116,0); -- Alectryon
REPLACE INTO `mob_groups` VALUES (12963,4551,45,0,128,9725,80000,20000,113,116,0); -- Tefenet
REPLACE INTO `mob_groups` VALUES (12964,4552,45,0,128,9721,80000,20000,113,116,0); -- Muscaliet
REPLACE INTO `mob_groups` VALUES (12965,4553,45,0,128,9717,80000,20000,113,116,0); -- Lachrymater
REPLACE INTO `mob_groups` VALUES (12966,4554,45,0,128,9710,110000,10000,113,116,0); -- Chloris Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12967,4555,45,0,128,9714,110000,25999,113,116,0); -- Glavoid Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12968,4556,45,0,128,9718,110000,100000,113,116,0); -- Lacovie
REPLACE INTO `mob_groups` VALUES (12969,4557,45,600,0,9712,60000,10000,113,116,0); -- Cuelebre
REPLACE INTO `mob_groups` VALUES (12970,4558,45,900,0,9732,110000,10000,113,116,0); -- Mictlantecuhtli
REPLACE INTO `mob_groups` VALUES (12971,4559,45,600,0,9711,110000,10000,113,116,0); -- Chukwa
REPLACE INTO `mob_groups` VALUES (12972,4560,45,600,0,9720,80000,20000,113,116,0); -- minhocao
REPLACE INTO `mob_groups` VALUES (12973,4561,45,600,0,9708,60000,0,113,116,0); -- Adze Abyssea-Tharongi
REPLACE INTO `mob_groups` VALUES (12974,4562,45,600,0,9724,60000,20000,113,116,0); -- Quetzalli
REPLACE INTO `mob_groups` VALUES (12975,4563,45,600,0,9719,60000,20000,113,116,0); -- Manananaggal
REPLACE INTO `mob_groups` VALUES (12976,4564,45,600,0,9722,60000,20000,113,116,0); -- Myrmecoleon
REPLACE INTO `mob_groups` VALUES (12977,4565,45,60,0,0,10000,10000,106,110,0);
REPLACE INTO `mob_groups` VALUES (12978,4566,45,600,0,9706,110000,99999,113,116,0); -- Iratham
REPLACE INTO `mob_groups` VALUES (12979,4542,45,0,128,9716,60000,9990,113,116,0); -- Halimede
REPLACE INTO `mob_groups` VALUES (12980,4538,45,60,0,0,10000,10000,106,110,0);
REPLACE INTO `mob_groups` VALUES (12981,4539,45,600,0,9256,60000,10000,113,116,0); -- Bhumi
REPLACE INTO `mob_groups` VALUES (12982,4540,45,60,0,0,10000,10000,106,110,0);
REPLACE INTO `mob_groups` VALUES (12983,4541,45,60,0,0,10000,10000,106,110,0);
REPLACE INTO `mob_groups` VALUES (13380,5191,61,0,128,9673,120000,100000,127,127,0); -- Vanasarvik
REPLACE INTO `mob_groups` VALUES (13650,4669,4,0,128,9662,140000,100000,132,132,0); -- Bismarck
REPLACE INTO `mob_groups` VALUES (13651,4668,68,0,128,9674,140000,100000,132,132,0); -- Morta
REPLACE INTO `mob_groups` VALUES (13724,4679,89,0,128,9642,110000,100000,128,128,0); -- Ocythoe
REPLACE INTO `mob_groups` VALUES (13726,4681,90,10800,0,9319,80000,100000,110,112,0); -- Croque-Mitaine
REPLACE INTO `mob_groups` VALUES (13729,4684,97,0,128,9614,110000,100000,120,120,0); -- Akupara 97
REPLACE INTO `mob_groups` VALUES (13730,4735,117,0,128,9640,110000,100000,125,125,0); -- Smierc
REPLACE INTO `mob_groups` VALUES (13731,4734,118,0,128,9645,110000,100000,128,128,0); -- Botulus_Rex
REPLACE INTO `mob_groups` VALUES (13732,4732,121,0,128,9652,110000,100000,127,127,0); -- Cath_Palug
REPLACE INTO `mob_groups` VALUES (13733,4731,121,0,128,0,15000,100000,120,120,0); -- Grwnan
REPLACE INTO `mob_groups` VALUES (13734,4725,122,0,128,0,30000,100000,115,115,0); -- Mimic_Mage
REPLACE INTO `mob_groups` VALUES (13735,4726,122,0,128,0,30000,100000,115,115,0); -- Mimic_Jester
REPLACE INTO `mob_groups` VALUES (13736,4727,122,0,128,9654,110000,100000,127,127,0); -- Mimic_King
REPLACE INTO `mob_groups` VALUES (13737,4720,130,0,128,9655,120000,100000,128,128,0); -- Aello
REPLACE INTO `mob_groups` VALUES (13738,4721,130,0,128,0,15000,100000,110,110,0); -- Aello_Handmaiden
REPLACE INTO `mob_groups` VALUES (13739,4719,177,0,128,9657,120000,100000,128,128,0); -- Uptala
REPLACE INTO `mob_groups` VALUES (13740,4718,177,0,128,0,15000,100000,120,120,0); -- Bisa
REPLACE INTO `mob_groups` VALUES (13742,4712,178,0,128,0,40000,100000,120,120,0); -- XuanWu
REPLACE INTO `mob_groups` VALUES (13743,4713,178,0,128,0,40000,100000,120,120,0); -- ZhuQue
REPLACE INTO `mob_groups` VALUES (13744,4714,178,0,128,0,40000,100000,120,120,0); -- QingLong
REPLACE INTO `mob_groups` VALUES (13745,4715,178,0,128,0,40000,100000,120,120,0); -- BaiHu
REPLACE INTO `mob_groups` VALUES (13746,4716,178,0,128,9656,120000,100000,128,128,0); -- Qilin
REPLACE INTO `mob_groups` VALUES (13747,4711,95,0,128,9605,80000,100000,120,120,0); -- Pancimanci 95
REPLACE INTO `mob_groups` VALUES (13749,4709,116,0,128,9637,110000,100000,125,125,0); -- RwNwPrtMHrw
REPLACE INTO `mob_groups` VALUES (13750,4708,96,0,128,9643,110000,100000,128,128,0); -- Kalasutrax
REPLACE INTO `mob_groups` VALUES (13753,4705,197,10800,0,9320,80000,100000,110,112,0); -- Aqrabuamelu
REPLACE INTO `mob_groups` VALUES (13754,4704,197,0,128,9628,90000,100000,122,122,0); -- Mellonia
REPLACE INTO `mob_groups` VALUES (13755,4703,110,0,128,9622,80000,100000,122,122,0); -- Yatagarasu
REPLACE INTO `mob_groups` VALUES (13757,4701,91,0,128,9623,80000,100000,122,122,0); -- Agathos
REPLACE INTO `mob_groups` VALUES (13758,4700,171,0,128,0,70000,100000,122,122,0); -- Kalos_eunomia
REPLACE INTO `mob_groups` VALUES (13759,4699,171,0,128,9629,30000,100000,122,122,0); -- Nympha_eunomia
REPLACE INTO `mob_groups` VALUES (13761,4697,171,10800,0,9322,80000,100000,110,112,0); -- Abatwa
REPLACE INTO `mob_groups` VALUES (13763,4695,127,0,128,9634,110000,100000,125,125,0); -- Pil-VNM
REPLACE INTO `mob_groups` VALUES (13764,4694,126,0,128,9632,110000,100000,125,125,0); -- Kaggen
REPLACE INTO `mob_groups` VALUES (13766,4693,103,0,128,9644,110000,100000,128,128,0); -- Ig-Alima
REPLACE INTO `mob_groups` VALUES (13767,4692,24,0,128,9659,120000,100000,128,128,0); -- Abununnu
REPLACE INTO `mob_groups` VALUES (13775,5145,164,10800,0,9310,80000,100000,110,112,0); -- Citadel_Pipistrelles
REPLACE INTO `mob_groups` VALUES (13776,5146,164,0,128,9627,90000,100000,122,122,0); -- Laidly_Laurence
REPLACE INTO `mob_groups` VALUES (13777,5147,200,0,128,9626,80000,100000,122,122,0); -- Roly_Poly
REPLACE INTO `mob_groups` VALUES (13778,5148,115,0,128,9604,80000,100000,120,120,0); -- Virvatuli 115
REPLACE INTO `mob_groups` VALUES (13779,5149,120,0,128,9620,80000,100000,122,122,0); -- Goji
REPLACE INTO `mob_groups` VALUES (13780,5150,98,0,128,9621,80000,100000,122,122,0); -- Gugalanna
REPLACE INTO `mob_groups` VALUES (13782,5152,104,0,128,9611,110000,100000,120,120,0); -- Belphoebe 104
REPLACE INTO `mob_groups` VALUES (13783,5153,82,0,128,9612,110000,100000,120,120,0); -- Kholomodumo 82
REPLACE INTO `mob_groups` VALUES (13800,5159,153,0,128,9653,110000,100000,127,127,0); -- Modron
REPLACE INTO `mob_groups` VALUES (13801,5160,153,0,128,0,15000,100000,120,120,0); -- Modrons_Druid
REPLACE INTO `mob_groups` VALUES (13802,5161,198,0,128,9608,90000,100000,120,120,0); -- Ogbunabali 198
REPLACE INTO `mob_groups` VALUES (13803,5162,184,0,128,9633,110000,100000,125,125,0); -- Akvan
REPLACE INTO `mob_groups` VALUES (13804,5163,108,0,128,9639,110000,100000,125,125,0); -- Gwynn_ap_Nudd
REPLACE INTO `mob_groups` VALUES (13805,5164,190,0,128,9616,130000,100000,120,120,0); -- Hahava 190
REPLACE INTO `mob_groups` VALUES (13806,5165,101,0,128,9602,80000,100000,120,120,0); -- Sarimanok 101
REPLACE INTO `mob_groups` VALUES (13807,5166,100,0,128,9635,110000,100000,125,125,0); -- Lancing_Lamorak
REPLACE INTO `mob_groups` VALUES (13808,5167,102,0,128,9638,110000,100000,125,125,0); -- Stachysaurus
REPLACE INTO `mob_groups` VALUES (13809,5168,193,0,128,9607,90000,100000,120,120,0); -- Krabimanjaro 193
REPLACE INTO `mob_groups` VALUES (13813,5172,83,10800,0,9302,80000,100000,110,112,0); -- Warabouc
REPLACE INTO `mob_groups` VALUES (13814,5173,83,0,128,9641,110000,100000,128,128,0); -- Gaunab
REPLACE INTO `mob_groups` VALUES (13815,5175,205,0,128,9648,90000,100000,122,122,0); -- Ildebrann
REPLACE INTO `mob_groups` VALUES (13817,5177,175,10800,0,9311,80000,100000,110,112,0); -- Laelaps
REPLACE INTO `mob_groups` VALUES (13818,5178,175,0,128,9631,90000,100000,122,122,0); -- Giltine
REPLACE INTO `mob_groups` VALUES (13819,5179,195,0,128,0,30000,100000,122,122,0); -- Gasha-1stform
REPLACE INTO `mob_groups` VALUES (13820,5180,174,0,128,9651,90000,100000,125,125,0); -- Tangaroa
REPLACE INTO `mob_groups` VALUES (13821,5181,174,0,128,0,15000,100000,115,115,0); -- Koura
REPLACE INTO `mob_groups` VALUES (13822,5182,174,0,128,0,15000,100000,115,115,0); -- Pekapeka
REPLACE INTO `mob_groups` VALUES (13823,5183,174,0,128,0,15000,100000,115,115,0); -- Moki
REPLACE INTO `mob_groups` VALUES (13824,5184,84,0,128,9625,80000,100000,122,122,0); -- Taweret
REPLACE INTO `mob_groups` VALUES (13825,5185,105,0,128,9624,80000,100000,122,122,0); -- Cherufe
REPLACE INTO `mob_groups` VALUES (13828,5189,119,0,128,9613,110000,100000,120,120,0); -- Lord_Asag 119
REPLACE INTO `mob_groups` VALUES (13829,5190,61,10800,0,9305,80000,100000,110,112,0); -- Chary_Apkallu
REPLACE INTO `mob_groups` VALUES (13837,5198,54,0,128,9670,5000000,100000,127,127,0); -- Dimgruzub
REPLACE INTO `mob_groups` VALUES (13838,5199,54,0,128,0,60000,10000,120,120,0); -- Assassins_Apprentice
REPLACE INTO `mob_groups` VALUES (13852,5207,79,0,128,9671,120000,100000,128,128,0); -- Brekekex
REPLACE INTO `mob_groups` VALUES (13853,5208,79,0,128,0,10000,100000,120,120,0); -- Chorus_toad
REPLACE INTO `mob_groups` VALUES (14087,3604,255,0,128,9730,200000,180000,130,130,0); -- Shinryu
REPLACE INTO `mob_groups` VALUES (14097,5324,204,10800,0,9318,80000,100000,110,112,0); -- Jenglot
REPLACE INTO `mob_groups` VALUES (14100,5325,33,1056,0,2535,0,5000,75,78,0);
REPLACE INTO `mob_groups` VALUES (14101,5326,33,1056,0,2535,0,0,75,78,0);
REPLACE INTO `mob_groups` VALUES (14102,5327,33,1056,0,2535,0,0,75,78,0);
REPLACE INTO `mob_groups` VALUES (14103,5328,33,1056,0,2535,0,0,75,78,0);
REPLACE INTO `mob_groups` VALUES (14104,5329,33,1056,0,2535,0,0,75,78,0);
REPLACE INTO `mob_groups` VALUES (14105,5330,33,1056,0,2535,0,5000,75,78,0);
REPLACE INTO `mob_groups` VALUES (14106,5331,33,1056,0,2535,0,5000,75,78,0);
REPLACE INTO `mob_groups` VALUES (14107,5332,33,1056,0,2535,0,5000,75,78,0);
REPLACE INTO `mob_groups` VALUES (14108,5333,33,1056,0,2535,0,0,75,78,0);
REPLACE INTO `mob_groups` VALUES (14109,5334,33,1056,0,2535,0,5000,75,78,0);
REPLACE INTO `mob_groups` VALUES (14110,5335,33,1056,0,2535,0,0,75,78,0);
REPLACE INTO `mob_groups` VALUES (14111,5336,33,1056,0,2535,0,5000,75,78,0);
REPLACE INTO `mob_groups` VALUES (14112,5337,33,1056,0,2535,0,5000,75,78,0);
REPLACE INTO `mob_groups` VALUES (14113,5338,33,1056,0,2535,0,0,75,78,0);
REPLACE INTO `mob_groups` VALUES (14117,2112,48,0,128,0,17000,17000,107,112,0);
REPLACE INTO `mob_groups` VALUES (14174,5424,7,10800,0,9303,80000,100000,110,112,0); -- Sargas
REPLACE INTO `mob_groups` VALUES (14175,5425,113,10800,0,9308,80000,100000,110,112,0); -- Tegmine
REPLACE INTO `mob_groups` VALUES (14176,5426,122,10800,0,9301,80000,100000,110,112,0); -- Martinet
REPLACE INTO `mob_groups` VALUES (14547,4662,215,0,128,9246,90000,20999,118,120,0); -- Svarbhanu
REPLACE INTO `mob_groups` VALUES (15107,3909,48,0,128,9106,60000,60000,122,127,0); -- Thunderbolt_Piraal_Ja
REPLACE INTO `mob_groups` VALUES (15117,4269,48,0,128,9106,60000,60000,128,130,0); -- Vyurvarjur_the_Nimble
-- Temp to be re-ID'd by Teo later
INSERT INTO `mob_groups` VALUES (89997,24998,169,10800,0,9317,80000,100000,110,112,0); -- Canal_Moocher -- DSP fuck up, overlapping group id 8833
INSERT INTO `mob_groups` VALUES (89998,24999,51,10800,0,9307,80000,100000,110,112,0); -- Chelicerata -- DSP fuck up, overlapping group id 1624
INSERT INTO `mob_groups` VALUES (89999,25000,169,10800,0,9300,80000,100000,110,112,0); -- Konjac -- DSP fuck up, overlapping group id 8819
-- --------------------
-- Legion
-- Hall of An
INSERT INTO `mob_groups` VALUES (90000,9000,183,0,128,9000,60000,10000,90,92,0); -- Lofty_Behemoth
INSERT INTO `mob_groups` VALUES (90001,9001,183,0,128,9001,70000,10000,95,97,0); -- Lofty_Zilant
INSERT INTO `mob_groups` VALUES (90002,9002,183,0,128,9002,60000,10000,90,92,0); -- Lofty_Adamantoise
INSERT INTO `mob_groups` VALUES (90003,9003,183,0,128,9003,70000,10000,95,97,0); -- Lofty_Elasmoth
INSERT INTO `mob_groups` VALUES (90004,9004,183,0,128,9004,60000,10000,90,92,0); -- Lofty_Wyrm
INSERT INTO `mob_groups` VALUES (90005,9005,183,0,128,9005,70000,10000,95,97,0); -- Lofty_Ferromantoise
INSERT INTO `mob_groups` VALUES (90006,9006,183,0,128,9006,70000,10000,100,102,0); -- Lofty_Harpeia
-- Hall of Ki
INSERT INTO `mob_groups` VALUES (90007,9007,183,0,128,9007,60000,10000,95,97,0); -- Mired_Cerberus
INSERT INTO `mob_groups` VALUES (90008,9008,183,0,128,9008,60000,10000,95,97,0); -- Mired_Khim
INSERT INTO `mob_groups` VALUES (90009,9009,183,0,128,9009,60000,10000,95,97,0); -- Mired_Hydra
INSERT INTO `mob_groups` VALUES (90010,9010,183,0,128,9010,80000,10000,100,102,0); -- Mired_Orthrus
INSERT INTO `mob_groups` VALUES (90011,9011,183,0,128,9011,80000,10000,100,102,0); -- Mired_Khrysokhimaira
INSERT INTO `mob_groups` VALUES (90012,9012,183,0,128,9012,80000,10000,100,102,0); -- Mired_Alfard
INSERT INTO `mob_groups` VALUES (90013,9013,183,0,128,9013,80000,10000,105,107,0); -- Mired_Mantis
-- Hall of Im
INSERT INTO `mob_groups` VALUES (90014,9014,183,0,128,9014,60000,10000,100,102,0); -- Soaring_Corse
INSERT INTO `mob_groups` VALUES (90015,9015,183,0,128,9015,60000,10000,100,102,0); -- Soaring_Dvergr
INSERT INTO `mob_groups` VALUES (90016,9016,183,0,128,9016,60000,10000,100,102,0); -- Soaring_Vampyr
INSERT INTO `mob_groups` VALUES (90017,9017,183,0,128,9017,80000,10000,105,107,0); -- Soaring_Kumakatok
INSERT INTO `mob_groups` VALUES (90018,9018,183,0,128,9018,80000,10000,105,107,0); -- Soaring_Dweorg
INSERT INTO `mob_groups` VALUES (90019,9019,183,0,128,9019,80000,10000,105,107,0); -- Soaring_Strigoi
INSERT INTO `mob_groups` VALUES (90020,9020,183,0,128,9020,80000,10000,110,112,0); -- Soaring_Naraka
-- Hall of Muru
INSERT INTO `mob_groups` VALUES (90021,9021,183,0,128,9021,60000,10000,105,107,0); -- Veiled_Amphiptere
INSERT INTO `mob_groups` VALUES (90022,9022,183,0,128,9022,60000,10000,105,107,0); -- Veiled_Ixion
INSERT INTO `mob_groups` VALUES (90023,9023,183,0,128,9023,60000,10000,105,107,0); -- Veiled_Sandworm
INSERT INTO `mob_groups` VALUES (90024,9024,183,0,128,9024,80000,10000,110,112,0); -- Veiled_Sanguiptere
INSERT INTO `mob_groups` VALUES (90025,9025,183,0,128,9025,80000,10000,110,112,0); -- Veiled_Alicorn
INSERT INTO `mob_groups` VALUES (90026,9026,183,0,128,9026,80000,10000,110,112,0); -- Veiled_Gigaworm
INSERT INTO `mob_groups` VALUES (90027,9027,183,0,128,9027,80000,10000,115,117,0); -- Veiled_Ironclad
-- Hall of Mul
INSERT INTO `mob_groups` VALUES (90028,9028,183,0,128,9028,70000,100000,115,120,0); -- Lofty Harpeia Alt
INSERT INTO `mob_groups` VALUES (90029,9029,183,0,128,9029,70000,100000,115,120,0); -- Mired Mantis Alt
INSERT INTO `mob_groups` VALUES (90030,9030,183,0,128,9030,70000,100000,115,120,0); -- Soaring Naraka Alt
INSERT INTO `mob_groups` VALUES (90031,9031,183,0,128,9031,70000,100000,115,120,0); -- Veiled Ironclad Alt
INSERT INTO `mob_groups` VALUES (90032,9032,183,0,128,9034,70000,100000,122,124,0); -- Paramount Naraka
INSERT INTO `mob_groups` VALUES (90033,9033,183,0,128,9032,70000,100000,130,132,0); -- Paramount Harpeia
INSERT INTO `mob_groups` VALUES (90034,9034,183,0,128,9033,70000,100000,124,126,0); -- Paramount Mantis
INSERT INTO `mob_groups` VALUES (90035,9035,183,0,128,9035,70000,100000,120,122,0); -- Paramount Ironclad
INSERT INTO `mob_groups` VALUES (90036,9036,183,0,128,9036,90000,100000,134,136,0); -- Paramount Gallu
INSERT INTO `mob_groups` VALUES (90037,9037,183,0,128,9037,90000,100000,132,134,0); -- Paramount Botulus
-- Misc
INSERT INTO `mob_groups` VALUES (90038,9038,183,0,128,9038,20000,20000,90,95,0); -- Auspicious Entity Air
INSERT INTO `mob_groups` VALUES (90039,9039,183,0,128,9039,20000,20000,90,95,0); -- Auspicious Entity Dark
INSERT INTO `mob_groups` VALUES (90040,9040,183,0,128,9040,20000,20000,90,95,0); -- Auspicious Entity Earth
INSERT INTO `mob_groups` VALUES (90041,9041,183,0,128,9041,20000,20000,90,95,0); -- Auspicious Entity Fire
INSERT INTO `mob_groups` VALUES (90042,9042,183,0,128,9042,20000,20000,90,95,0); -- Auspicious Entity Ice
INSERT INTO `mob_groups` VALUES (90043,9043,183,0,128,9043,20000,20000,90,95,0); -- Auspicious Entity Light
INSERT INTO `mob_groups` VALUES (90044,9044,183,0,128,9044,20000,20000,90,95,0); -- Auspicious Entity Lighting
INSERT INTO `mob_groups` VALUES (90045,9045,183,0,128,9045,20000,20000,90,95,0); -- Auspicious Entity Water
-- Custom Halls
-- 90046 reserved! Frog_Lady
-- 90048 reserved! Frog
-- 90049 reserved! Son_Goku
-- 90050 reserved!
-- --------------------
-- Test Zone Custom Section
INSERT INTO `mob_groups` VALUES (90080,9080,49,1800,0,9080,60000,60000,125,130,0); -- Hades V1
INSERT INTO `mob_groups` VALUES (90081,9081,49,1800,0,9081,60000,120000,140,141,0); -- Hades V2
INSERT INTO `mob_groups` VALUES (90084,9084,103,0,0,9084,160000,100000,120,120,0); -- Tchakka
INSERT INTO `mob_groups` VALUES (90085,9085,5,0,0,9085,180000,100000,120,120,0); -- Kumhau
INSERT INTO `mob_groups` VALUES (90089,9089,7,0,0,9089,180000,100000,120,120,0); -- Achuka
INSERT INTO `mob_groups` VALUES (90090,9090,117,0,0,9090,170000,100000,120,120,0); -- Hurkan
INSERT INTO `mob_groups` VALUES (90091,9091,123,0,0,9091,180000,10000,120,120,0); -- Darrcuiln
INSERT INTO `mob_groups` VALUES (90092,9092,49,1800,0,9092,80000,10000,140,142,0); -- Ashrakk
INSERT INTO `mob_groups` VALUES (90093,9093,49,1800,0,9093,60000,10000,130,135,0); -- Balamor
INSERT INTO `mob_groups` VALUES (90094,4654,49,1800,0,9093,160000,10000,140,145,0); -- Prov Watcher
INSERT INTO `mob_groups` VALUES (90095,4927,159,0,0,9093,160000,10000,130,130,0); -- Colkhab
INSERT INTO `mob_groups` VALUES (90096,4791,49,1800,0,9093,60000,10000,130,135,0); -- Sharptusk_razz
INSERT INTO `mob_groups` VALUES (90097,5500,49,1800,0,9093,60000,10000,130,135,0); -- Dhokmak
INSERT INTO `mob_groups` VALUES (90098,4778,49,1800,0,9093,60000,10000,130,135,0); -- Matamata
INSERT INTO `mob_groups` VALUES (90100,4913,49,1800,0,9093,60000,10000,130,135,0); -- Trembling_Tulfaire
INSERT INTO `mob_groups` VALUES (90101,4899,49,1800,0,9093,60000,10000,130,135,0); -- Velkk_vaticinator
INSERT INTO `mob_groups` VALUES (90102,4900,49,1800,0,9093,60000,10000,130,135,0); -- Velkk_punisher
INSERT INTO `mob_groups` VALUES (90103,4902,49,1800,0,9093,60000,10000,130,135,0); -- Velkk_ravager
INSERT INTO `mob_groups` VALUES (90104,4903,49,1800,0,9093,60000,10000,130,135,0); -- Velkk_manipulator
INSERT INTO `mob_groups` VALUES (90105,5214,4,0,0,9105,160000,100000,120,120,0); -- Custom Ravenous_Cracklaw
INSERT INTO `mob_groups` VALUES (90304,9104,122,10800,0,9304,80000,100000,110,112,0); -- Nargun
INSERT INTO `mob_groups` VALUES (90306,9106,12,10800,0,9306,80000,100000,110,112,0); -- Sword_Sorcerer_Solisoq
INSERT INTO `mob_groups` VALUES (90312,9112,113,10800,0,9312,80000,100000,110,112,0); -- Zmey_Gorynych
INSERT INTO `mob_groups` VALUES (90313,24996,126,10800,0,9313,80000,100000,110,112,0); -- Atkorkamuy
INSERT INTO `mob_groups` VALUES (90315,9115,5,10800,0,9315,80000,100000,110,112,0); -- Frost_Flambeau
INSERT INTO `mob_groups` VALUES (90316,9116,5,10800,0,9316,80000,100000,110,112,0); -- Skvader
INSERT INTO `mob_groups` VALUES (90321,9121,114,10800,0,9321,80000,100000,110,112,0); -- Sabotender_Corrido
INSERT INTO `mob_groups` VALUES (90323,9123,65,10800,0,9323,80000,100000,110,112,0); -- Venomfang
INSERT INTO `mob_groups` VALUES (90324,9911,201,0,128,9733,0,0,120,120,0); -- HTB Avatars: Garuda
INSERT INTO `mob_groups` VALUES (90325,9912,202,0,128,9734,0,0,120,120,0); -- HTB Avatars: Ramuh
INSERT INTO `mob_groups` VALUES (90326,9913,203,0,128,9735,0,0,120,120,0); -- HTB Avatars: Shiva
INSERT INTO `mob_groups` VALUES (90327,9914,207,0,128,9736,0,0,120,120,0); -- HTB Avatars: Ifrit
INSERT INTO `mob_groups` VALUES (90328,9915,209,0,128,9737,0,0,120,120,0); -- HTB Avatars: Titan
INSERT INTO `mob_groups` VALUES (90329,9916,211,0,128,9738,0,0,120,120,0); -- HTB Avatars: Leviathan
INSERT INTO `mob_groups` VALUES (90330,9330,33,0,128,0,40000,40000,100,100,0); -- AV Wyverns
INSERT INTO `mob_groups` VALUES (90331,3271,33,0,128,0,10000,10000,100,100,0); -- JoJ Xzomits
INSERT INTO `mob_groups` VALUES (90332,3270,33,0,128,0,10000,10000,100,100,0); -- JoL Hpemde
INSERT INTO `mob_groups` VALUES (90333,3271,33,0,128,0,10000,10000,100,100,0); -- Jol Xzomits
INSERT INTO `mob_groups` VALUES (90334,3422,33,0,128,0,10000,10000,100,100,0); -- JoL Phaubo
INSERT INTO `mob_groups` VALUES (90335,9335,35,0,128,0,75000,75000,90,90,0); -- Ix DRG Wynav
-- INSERT INTO `mob_groups` VALUES (90330,9917,zoneid,0,128,9739,0,0,120,120,0); -- HTB Avatars: Fenrir Prime
-- INSERT INTO `mob_groups` VALUES (90331,9918,zoneid,0,128,9740,0,0,120,120,0); -- HTB Avatars: Carbuncle Prime
-- INSERT INTO `mob_groups` VALUES (90332,9919,zoneid,0,128,9741,0,0,120,120,0); -- HTB Avatars: Diabolos Prime
-- INSERT INTO `mob_groups` VALUES (90333,9920,zoneid,0,128,9742,0,0,120,120,0); -- HTB Kam'lanaut
-- INSERT INTO `mob_groups` VALUES (90334,9921,zoneid,0,128,9743,0,0,120,120,0); -- HTB Eald'narche
-- INSERT INTO `mob_groups` VALUES (90335,9922,zoneid,0,128,9744,0,0,120,120,0); -- HTB Shadow Lord
-- INSERT INTO `mob_groups` VALUES (90336,9923,zoneid,0,128,9745,0,0,120,120,0); -- HTB Ouryu
-- INSERT INTO `mob_groups` VALUES (90337,9924,zoneid,0,128,9746,0,0,120,120,0); -- HTB Tenzen
-- INSERT INTO `mob_groups` VALUES (90338,9925,zoneid,0,128,9747,0,0,120,120,0); -- HTB Shikaree X
-- INSERT INTO `mob_groups` VALUES (90339,9926,zoneid,0,128,9748,0,0,120,120,0); -- HTB Shikaree Y
-- INSERT INTO `mob_groups` VALUES (90340,9927,zoneid,0,128,9749,0,0,120,120,0); -- HTB Shikaree Z
-- INSERT INTO `mob_groups` VALUES (90341,9928,zoneid,0,128,9750,0,0,120,120,0); -- HTB Omega
-- INSERT INTO `mob_groups` VALUES (90342,9929,zoneid,0,128,9751,0,0,120,120,0); -- HTB Ultima
-- INSERT INTO `mob_groups` VALUES (90343,9930,zoneid,0,128,9752,0,0,120,120,0); -- HTB Promathia
-- INSERT INTO `mob_groups` VALUES (90344,9931,zoneid,0,128,9753,0,0,120,120,0); -- HTB Lancelord Gaheel Ja
-- INSERT INTO `mob_groups` VALUES (90345,9932,zoneid,0,128,9754,0,0,120,120,0); -- HTB Gessho
-- INSERT INTO `mob_groups` VALUES (90346,9933,zoneid,0,128,9755,0,0,120,120,0); -- HTB Ark Angel Hume
-- INSERT INTO `mob_groups` VALUES (90347,9934,zoneid,0,128,9756,0,0,120,120,0); -- HTB Ark Angel Tarutaru
-- INSERT INTO `mob_groups` VALUES (90348,9935,zoneid,0,128,9757,0,0,120,120,0); -- HTB Ark Angel Mithra
-- INSERT INTO `mob_groups` VALUES (90349,9936,zoneid,0,128,9758,0,0,120,120,0); -- HTB Ark Angel Elvaan
-- INSERT INTO `mob_groups` VALUES (90350,9937,zoneid,0,128,9759,0,0,120,120,0); -- HTB Ark Angel Galka
-- GroupID 90351 Reserved / PoolID 9938 / DropID 9760
-- GroupID 90352 Reserved / PoolID 9939 / DropID 9761
-- GroupID 90353 Reserved / PoolID 9940 / DropID 9762
-- GroupID 90354 Reserved / PoolID 9941 / DropID 9763
-- GroupID 90355 Reserved / PoolID 9942 / DropID 9764
INSERT INTO `mob_groups` VALUES (90356,9943,154,0,128,9765,100000,40000,127,127,0); -- Ultimate Zilant war/blm
INSERT INTO `mob_groups` VALUES (90357,9944,127,0,128,9766,100000,40000,127,127,0); -- Ultimate Behemoth war/blm
INSERT INTO `mob_groups` VALUES (90358,9945,128,0,128,9767,100000,40000,127,127,0); -- Ultimate Adamantoise pld/rdm
INSERT INTO `mob_groups` VALUES (90359,9946,208,0,128,9768,60000,0,90,90,0); -- Augustus (Lotto off Antican Consul) war/rdm
INSERT INTO `mob_groups` VALUES (90360,9947,176,0,128,9769,60000,0,90,90,0); -- Sekolah (Lotto off Abyss Sahagin) mnk/whm
INSERT INTO `mob_groups` VALUES (90361,9948,159,0,128,9770,60000,0,90,90,0); -- Uggalepih's Hand (Lotto off Tonberry Pontifex) nin/blm
INSERT INTO `mob_groups` VALUES (90362,9949,130,3600,0,9771,40000,4000,120,120,0); -- Air Horror (1hr repop) blue sea monk, war/rdm
INSERT INTO `mob_groups` VALUES (90363,9950,130,0,128,9772,100000,80000,127,127,0); -- Cthulhu (Lotto Off Air Horror) blue soulflayer rdm/war
INSERT INTO `mob_groups` VALUES (90364,9951,84,18000,0,0,0,0,118,118,0); -- Woodward (5hr repop) war/pld
INSERT INTO `mob_groups` VALUES (90365,9952,84,0,128,0,0,0,115,115,0); -- Slapping Sapling (x8 spawned on Woodward death)
INSERT INTO `mob_groups` VALUES (90366,9953,84,0,128,9773,0,0,127,127,0); -- Whomping Willow (Replaces last of 8 Slapping Sapping) treant, mnk/war
INSERT INTO `mob_groups` VALUES (90367,9954,104,14400,0,9774,120000,60000,127,127,0); -- Sir Mordred (6-9hr repop) crab, drk/rdm
INSERT INTO `mob_groups` VALUES (90368,9955,104,0,128,12000,600,0,118,118,0); -- Mordred's Knight (Spawned by Mordred) crab, drk/war
INSERT INTO `mob_groups` VALUES (90400,9800,106,0,128,9600,80000,100000,120,120,0); -- Sallow_Seymour 106
INSERT INTO `mob_groups` VALUES (90401,9801,88,0,128,9601,80000,100000,120,120,0); -- Ushumgal 88
INSERT INTO `mob_groups` VALUES (90406,9806,196,0,128,9606,90000,100000,120,120,0); -- Lorbulcrud 196
INSERT INTO `mob_groups` VALUES (90409,9809,109,0,128,9609,110000,100000,120,120,0); -- Murk-Veined_Baneberry 109
INSERT INTO `mob_groups` VALUES (90410,9810,90,0,128,9610,110000,100000,120,120,0); -- Melancholic_Moira 90
INSERT INTO `mob_groups` VALUES (90415,9815,191,0,128,9615,130000,100000,120,120,0); -- Celano 191
INSERT INTO `mob_groups` VALUES (90417,9817,194,0,128,9617,130000,100000,120,120,0); -- Voidwrought 194
INSERT INTO `mob_groups` VALUES (90437,9837,107,0,128,9636,110000,100000,125,125,0); -- Bhishani
INSERT INTO `mob_groups` VALUES (90447,9847,195,0,128,0,30000,100000,125,125,0); -- Gasha
INSERT INTO `mob_groups` VALUES (90448,9848,195,0,128,9630,40000,100000,128,128,0); -- Gasha
INSERT INTO `mob_groups` VALUES (90450,9850,123,0,128,9646,90000,100000,122,122,0); -- Holy_Moly
INSERT INTO `mob_groups` VALUES (90451,9851,123,0,128,0,15000,100000,115,115,0); -- Moly
INSERT INTO `mob_groups` VALUES (90452,9852,159,0,128,9647,90000,100000,122,122,0); -- Neith
INSERT INTO `mob_groups` VALUES (90453,9853,159,0,128,0,15000,100000,115,115,0); -- Neiths_Bobbin
INSERT INTO `mob_groups` VALUES (90455,9855,205,0,128,0,40000,100000,115,115,0); -- Hraun_Dragon
INSERT INTO `mob_groups` VALUES (90456,9856,125,0,128,9649,90000,100000,125,125,0); -- Sabotender_Campeador
INSERT INTO `mob_groups` VALUES (90457,9857,125,0,128,0,15000,100000,115,115,0); -- Sabotender_Mercenario
INSERT INTO `mob_groups` VALUES (90458,9858,208,0,128,9650,90000,100000,125,125,0); -- Malleator_Maurrok
INSERT INTO `mob_groups` VALUES (90459,9859,208,0,128,0,15000,100000,115,115,0); -- Peon_Pounder
INSERT INTO `mob_groups` VALUES (90478,9878,177,0,128,0,15000,100000,120,120,0); -- Trna
INSERT INTO `mob_groups` VALUES (90481,9881,7,0,128,9658,120000,100000,127,127,0); -- Fjalar
INSERT INTO `mob_groups` VALUES (90482,9882,7,0,128,0,20000,100000,124,124,0); -- Bloody_Skull
INSERT INTO `mob_groups` VALUES (90484,9884,24,0,128,0,60000,100000,124,124,0); -- Gloam_Servitor_Melee
INSERT INTO `mob_groups` VALUES (90485,9885,24,0,128,0,60000,100000,124,124,0); -- Gloam_Servitor_Mage
INSERT INTO `mob_groups` VALUES (90486,9886,25,0,128,9660,120000,100000,128,128,0); -- Tsui-Goab
INSERT INTO `mob_groups` VALUES (90487,9887,25,0,128,0,15000,100000,124,124,0); -- Bloodswiller_Fly
INSERT INTO `mob_groups` VALUES (90488,9888,5,0,128,9661,120000,100000,127,127,0); -- Isarukitsck
INSERT INTO `mob_groups` VALUES (90489,9889,5,0,128,0,20000,100000,124,124,0); -- Little_Wingman
INSERT INTO `mob_groups` VALUES (90491,9891,4,0,128,0,8000,100000,124,124,0); -- Primordial_Pugil
INSERT INTO `mob_groups` VALUES (90496,9896,65,0,128,9672,120000,100000,128,128,0); -- Yalungur
INSERT INTO `mob_groups` VALUES (90497,9897,65,0,128,0,15000,100000,120,120,0); -- Predatory_Colibri
INSERT INTO `mob_groups` VALUES (90499,9899,61,0,128,0,12000,100000,120,120,0); -- Elder_Imp
-- INSERT INTO `mob_groups` VALUES (90500,9350,5,0,0,9500,200000,100000,125,125,0); -- Jormungand (bv2 ver)
-- INSERT INTO `mob_groups` VALUES (90501,9351,190,0,0,9501,200000,100000,125,125,0); -- Vrtra (bv2 ver)
-- INSERT INTO `mob_groups` VALUES (90502,9352,7,0,0,9502,200000,100000,125,125,0); -- Tiamat (bv2 ver)
-- INSERT INTO `mob_groups` VALUES (90503,9353,29,0,128,9503,200000,100000,125,125,0); -- Bahamut
INSERT INTO `mob_groups` VALUES (90506,9901,68,0,128,0,8000,100000,120,120,0); -- Ravishing_Rafflesia
INSERT INTO `mob_groups` VALUES (90507,9902,49,300,0,0,80000,100000,128,128,0); -- Pil-Provenance
INSERT INTO `mob_groups` VALUES (90508,9903,49,300,0,0,80000,100000,128,128,0); -- Rukh
INSERT INTO `mob_groups` VALUES (90509,9904,49,300,0,0,80000,100000,128,128,0); -- Asb
INSERT INTO `mob_groups` VALUES (90510,9905,49,300,0,0,80000,100000,128,128,0); -- Sarbaz
INSERT INTO `mob_groups` VALUES (90511,9906,49,300,0,0,80000,100000,128,128,0); -- Wazir
INSERT INTO `mob_groups` VALUES (90512,9907,49,300,0,0,80000,100000,128,128,0); -- Shah
INSERT INTO `mob_groups` VALUES (90513,9908,49,300,0,0,250000,100000,130,130,0); -- Provenance_Watcher
INSERT INTO `mob_groups` VALUES (90514,9909,49,0,128,0,10000,100000,122,122,0); -- Crystal_Fetter
INSERT INTO `mob_groups` VALUES (90515,9910,111,0,128,9504,180000,100000,130,130,0); -- HKS99 Yeti
-- Group IDs ? to 96550 currently unused
-- New info above this line sorted by Group ID
-- place nothing below this line ---------------
-- REPLACE INTO `mob_groups` VALUES (groupid,poolid,zoneid,respawntime,spawntype,dropid,HP,MP,minLevel,maxLevel,allegiance);
-- April Fools Event
INSERT INTO `mob_groups` VALUES (96551,16593,100,60,128,0,0,0,1,2,0); -- Flying Pig (West Ron)
INSERT INTO `mob_groups` VALUES (96552,16593,101,60,128,0,0,0,1,2,0); -- Flying Pig (East Ron)
INSERT INTO `mob_groups` VALUES (96553,16593,106,60,128,0,0,0,1,2,0); -- Flying Pig (North Gusta)
INSERT INTO `mob_groups` VALUES (96554,16593,107,60,128,0,0,0,1,2,0); -- Flying Pig (South Gusta)
INSERT INTO `mob_groups` VALUES (96555,16593,115,60,128,0,0,0,1,2,0); -- Flying Pig (West Saruta)
INSERT INTO `mob_groups` VALUES (96556,16593,116,60,128,0,0,0,1,2,0); -- Flying Pig (East Saruta)
-- Feast of Swords summer Event
INSERT INTO `mob_groups` VALUES (96557,16594,100,150,128,0,200,11,2,2,0); -- Tatenashi_Armor (Hume) (West Ron)
INSERT INTO `mob_groups` VALUES (96558,16594,101,150,128,0,200,11,2,2,0); -- Tatenashi_Armor (Hume) (East Ron)
INSERT INTO `mob_groups` VALUES (96559,16594,106,150,128,0,200,11,2,2,0); -- Tatenashi_Armor (Hume) (North Gusta)
INSERT INTO `mob_groups` VALUES (96560,16594,107,150,128,0,200,11,2,2,0); -- Tatenashi_Armor (Hume) (South Gusta)
INSERT INTO `mob_groups` VALUES (96561,16594,115,150,128,0,200,11,2,2,0); -- Tatenashi_Armor (Hume) (West Saruta)
INSERT INTO `mob_groups` VALUES (96562,16594,116,150,128,0,200,11,2,2,0); -- Tatenashi_Armor (Hume) (East Saruta)
INSERT INTO `mob_groups` VALUES (96563,16595,100,150,128,0,200,11,2,2,0); -- Hachiryu_Armor (Galka) (West Ron)
INSERT INTO `mob_groups` VALUES (96564,16595,101,150,128,0,200,11,2,2,0); -- Hachiryu_Armor (Galka) (East Ron)
INSERT INTO `mob_groups` VALUES (96565,16595,106,150,128,0,200,11,2,2,0); -- Hachiryu_Armor (Galka) (North Gusta)
INSERT INTO `mob_groups` VALUES (96566,16595,107,150,128,0,200,11,2,2,0); -- Hachiryu_Armor (Galka) (South Gusta)
INSERT INTO `mob_groups` VALUES (96567,16595,115,150,128,0,200,11,2,2,0); -- Hachiryu_Armor (Galka) (West Saruta)
INSERT INTO `mob_groups` VALUES (96569,16595,116,150,128,0,200,11,2,2,0); -- Hachiryu_Armor (Galka) (East Saruta)
INSERT INTO `mob_groups` VALUES (96570,16596,100,150,128,0,200,11,2,2,0); -- Hizamaru_Armor (Elvaan) (West Ron)
INSERT INTO `mob_groups` VALUES (96571,16596,101,150,128,0,200,11,2,2,0); -- Hizamaru_Armor (Elvaan) (East Ron)
INSERT INTO `mob_groups` VALUES (96572,16596,106,150,128,0,200,11,2,2,0); -- Hizamaru_Armor (Elvaan) (North Gusta)
INSERT INTO `mob_groups` VALUES (96573,16596,107,150,128,0,200,11,2,2,0); -- Hizamaru_Armor (Elvaan) (South Gusta)
INSERT INTO `mob_groups` VALUES (96574,16596,115,150,128,0,200,11,2,2,0); -- Hizamaru_Armor (Elvaan) (West Saruta)
INSERT INTO `mob_groups` VALUES (96575,16596,116,150,128,0,200,11,2,2,0); -- Hizamaru_Armor (Elvaan) (East Saruta)
INSERT INTO `mob_groups` VALUES (96576,16597,100,150,128,0,200,11,2,2,0); -- Ubuginu_Armor (Tarutaru) (West Ron)
INSERT INTO `mob_groups` VALUES (96577,16597,101,150,128,0,200,11,2,2,0); -- Ubuginu_Armor (Tarutaru) (East Ron)
INSERT INTO `mob_groups` VALUES (96578,16597,106,150,128,0,200,11,2,2,0); -- Ubuginu_Armor (Tarutaru) (North Gusta)
INSERT INTO `mob_groups` VALUES (96579,16597,107,150,128,0,200,11,2,2,0); -- Ubuginu_Armor (Tarutaru) (South Gusta)
INSERT INTO `mob_groups` VALUES (96580,16597,115,150,128,0,200,11,2,2,0); -- Ubuginu_Armor (Tarutaru) (West Saruta)
INSERT INTO `mob_groups` VALUES (96581,16597,116,150,128,0,200,11,2,2,0); -- Ubuginu_Armor (Tarutaru) (East Saruta)
INSERT INTO `mob_groups` VALUES (96582,16598,100,300,128,0,600,11,2,2,0); -- Omodaka_Armor (Mithra) (West Ron)
INSERT INTO `mob_groups` VALUES (96583,16598,101,300,128,0,600,11,2,2,0); -- Omodaka_Armor (Mithra) (East Ron)
INSERT INTO `mob_groups` VALUES (96584,16598,106,300,128,0,600,11,2,2,0); -- Omodaka_Armor (Mithra) (North Gusta)
INSERT INTO `mob_groups` VALUES (96585,16598,107,300,128,0,600,11,2,2,0); -- Omodaka_Armor (Mithra) (South Gusta)
INSERT INTO `mob_groups` VALUES (96586,16598,115,300,128,0,600,11,2,2,0); -- Omodaka_Armor (Mithra) (West Saruta)
INSERT INTO `mob_groups` VALUES (96587,16598,116,300,128,0,600,11,2,2,0); -- Omodaka_Armor (Mithra) (East Saruta)
-- Xmas Event
INSERT INTO `mob_groups` VALUES (96588,16599,100,0,128,0,11,11,1,1,0); -- Holiday_Gift_Box (West Ron)
INSERT INTO `mob_groups` VALUES (96589,16600,100,15,128,0,800000,8000,2,2,0); -- Twinkling Treant (West Ron)
INSERT INTO `mob_groups` VALUES (96590,16599,101,0,128,0,11,11,1,1,0); -- Holiday_Gift_Box (East Ron)
INSERT INTO `mob_groups` VALUES (96591,16600,101,15,128,0,800000,8000,2,2,0); -- Twinkling Treant (East Ron)
INSERT INTO `mob_groups` VALUES (96592,16599,106,0,128,0,11,11,1,1,0); -- Holiday_Gift_Box (North Gusta)
INSERT INTO `mob_groups` VALUES (96593,16600,106,15,128,0,800000,8000,2,2,0); -- Twinkling Treant (North Gusta)
INSERT INTO `mob_groups` VALUES (96594,16599,107,0,128,0,11,11,1,1,0); -- Holiday_Gift_Box (South Gusta)
INSERT INTO `mob_groups` VALUES (96595,16600,107,15,128,0,800000,8000,2,2,0); -- Twinkling Treant (South Gusta)
INSERT INTO `mob_groups` VALUES (96596,16599,115,0,128,0,11,11,1,1,0); -- Holiday_Gift_Box (West Saruta)
INSERT INTO `mob_groups` VALUES (96597,16600,115,15,128,0,800000,8000,2,2,0); -- Twinkling Treant (West Saruta)
INSERT INTO `mob_groups` VALUES (96598,16599,116,0,128,0,11,11,1,1,0); -- Holiday_Gift_Box (East Saruta)
INSERT INTO `mob_groups` VALUES (96599,16600,116,15,128,0,800000,8000,2,2,0); -- Twinkling Treant (East Saruta)
-- Unity NMs start
-- INSERT INTO `mob_groups` VALUES (96600,16601,107,0,128,16601,0,0,76,76,0); -- Bounding Belinda
-- INSERT INTO `mob_groups` VALUES (96601,16602,101,0,128,16602,0,0,76,76,0); -- Hugemaw Harold
-- INSERT INTO `mob_groups` VALUES (96602,16603,116,0,128,16603,0,0,76,76,0); -- Prickly Pitriv
-- INSERT INTO `mob_groups` VALUES (96603,16604,102,0,128,16604,0,0,99,99,0); -- Ironhorn Baldurno
-- INSERT INTO `mob_groups` VALUES (96604,16605,108,0,128,16605,0,0,99,99,0); -- Sleepy Mabel
-- INSERT INTO `mob_groups` VALUES (96605,16606,117,0,128,16606,0,0,119,119,0); -- Serpopard Ninlil
-- INSERT INTO `mob_groups` VALUES (96606,16607,118,0,128,16607,0,0,119,119,0); -- Abyssdiver
-- INSERT INTO `mob_groups` VALUES (96607,16608,24,0,128,16608,0,0,119,119,0); -- Immanibugard
-- INSERT INTO `mob_groups` VALUES (96608,16609,4,0,128,16609,0,0,119,119,0); -- Intuila
-- INSERT INTO `mob_groups` VALUES (96609,16611,126,0,128,16611,0,0,119,119,0); -- Jester Malatrix
-- INSERT INTO `mob_groups` VALUES (96611,16612,2,0,128,16612,0,0,119,119,0); -- Orcfeltrap
-- INSERT INTO `mob_groups` VALUES (96612,16613,123,0,128,0,0,0,111,111,0); -- Steamy Samantha (phase 1)
-- INSERT INTO `mob_groups` VALUES (96613,16614,123,0,128,0,0,0,115,115,0); -- Sultry Samantha (phase 2)
-- INSERT INTO `mob_groups` VALUES (96614,16615,123,0,128,16613,0,0,119,119,0); -- Sybaritic Samantha (phase 3)
-- INSERT INTO `mob_groups` VALUES (96615,16616,103,0,128,16614,0,0,119,119,0); -- Valkurm Imperator
-- INSERT INTO `mob_groups` VALUES (96616,16617,zoneid,0,128,16615,HP,MP,122,122,0); -- Cactrot Veloz
-- INSERT INTO `mob_groups` VALUES (96617,16618,zoneid,0,128,16616,HP,MP,122,122,0); -- Emperor Arthro
-- INSERT INTO `mob_groups` VALUES (96618,16619,zoneid,0,128,16617,HP,MP,122,122,0); -- Joyous Green
-- INSERT INTO `mob_groups` VALUES (96619,16620,zoneid,0,128,16618,HP,MP,122,122,0); -- Keeper of Heiligtum
-- INSERT INTO `mob_groups` VALUES (96620,16621,zoneid,0,128,16619,HP,MP,122,122,0); -- Tiyanak
-- INSERT INTO `mob_groups` VALUES (96621,16622,zoneid,0,128,16620,HP,MP,122,122,0); -- Voso
-- INSERT INTO `mob_groups` VALUES (96622,16623,zoneid,0,128,16621,HP,MP,122,122,0); -- Warblade Beak
-- INSERT INTO `mob_groups` VALUES (96623,16624,zoneid,0,128,16622,HP,MP,122,122,0); -- Woodland Mender
-- INSERT INTO `mob_groups` VALUES (96624,16625,zoneid,0,128,16623,HP,MP,125,125,0); -- Arke
-- INSERT INTO `mob_groups` VALUES (96625,16626,zoneid,0,128,16624,HP,MP,125,125,0); -- Ayapec
-- INSERT INTO `mob_groups` VALUES (96626,16627,zoneid,0,128,16625,HP,MP,125,125,0); -- Beist
-- INSERT INTO `mob_groups` VALUES (96627,16628,zoneid,0,128,16626,HP,MP,125,125,0); -- Coca
-- INSERT INTO `mob_groups` VALUES (96628,16629,zoneid,0,128,16627,HP,MP,125,125,0); -- Douma Weapon
-- INSERT INTO `mob_groups` VALUES (96629,16630,zoneid,0,128,0,HP,MP,125,125,0); -- Katashiro weapon
-- INSERT INTO `mob_groups` VALUES (96630,16631,zoneid,0,128,16628,HP,MP,125,125,0); -- King_Uropygid
-- INSERT INTO `mob_groups` VALUES (96631,16632,zoneid,0,128,16629,HP,MP,125,125,0); -- Largantua
-- INSERT INTO `mob_groups` VALUES (96632,16633,zoneid,0,128,16630,HP,MP,125,125,0); -- Lumber Jill
-- INSERT INTO `mob_groups` VALUES (96633,16634,zoneid,0,128,16631,HP,MP,125,125,0); -- Mephitas
-- INSERT INTO `mob_groups` VALUES (96634,16635,zoneid,0,128,16632,HP,MP,125,125,0); -- Muut
-- INSERT INTO `mob_groups` VALUES (96635,16636,zoneid,0,128,0,HP,MP,100,100,0); -- Muut's Sacrifice
-- INSERT INTO `mob_groups` VALUES (96636,16637,zoneid,0,128,0,HP,MP,100,100,0); -- Muut's Hound Warrior
-- INSERT INTO `mob_groups` VALUES (96637,16638,zoneid,0,128,16633,HP,MP,125,125,0); -- Specter Worm
-- INSERT INTO `mob_groups` VALUES (96638,16639,zoneid,0,128,16634,HP,MP,125,125,0); -- Strix
-- INSERT INTO `mob_groups` VALUES (96639,16640,zoneid,0,128,16635,HP,MP,128,128,0); -- Azrael
-- INSERT INTO `mob_groups` VALUES (96640,16641,zoneid,0,128,16636,HP,MP,128,128,0); -- Borealis Shadow
-- INSERT INTO `mob_groups` VALUES (96641,16642,zoneid,0,128,0,HP,MP,104,104,0); -- Orientalis Shadow
-- INSERT INTO `mob_groups` VALUES (96642,16643,zoneid,0,128,0,HP,MP,104,104,0); -- Australis Shadow
-- INSERT INTO `mob_groups` VALUES (96643,16644,zoneid,0,128,0,HP,MP,104,104,0); -- Occidentalis Shadow
-- INSERT INTO `mob_groups` VALUES (96644,16645,zoneid,0,128,16637,HP,MP,128,128,0); -- Camahueto
-- INSERT INTO `mob_groups` VALUES (96645,16646,zoneid,0,128,16638,HP,MP,128,128,0); -- Vedrfolnir
-- Unity NMs End
-- Super experimental z49 mobs, will not spawn without script or GM command.
-- INSERT INTO `mob_groups` VALUES (96661,16661,49,0,128,dropid,HP,MP,lv,lv,0); -- Benkei
-- INSERT INTO `mob_groups` VALUES (96662,16662,49,0,128,dropid,HP,MP,lv,lv,0); -- Druk
-- INSERT INTO `mob_groups` VALUES (96663,16663,49,0,128,dropid,HP,MP,lv,lv,0); -- Zomok
-- INSERT INTO `mob_groups` VALUES (96664,16664,49,0,128,dropid,HP,MP,lv,lv,0); -- Abzu
INSERT INTO `mob_groups` VALUES (96665,16665,91,3600,0,16665,154000,75000,131,131,0); -- The Jumping Crab
-- INSERT INTO `mob_groups` VALUES (96666,16666,49,0,128,16666,136666,6666,106,106,0); -- SlenderMan
-- INSERT INTO `mob_groups` VALUES (96667,16667,49,0,128,0,6666,3333,90,90,0); -- Zombaru
-- INSERT INTO `mob_groups` VALUES (97600,16760,49,0,128,16760,185000,7600,128,128,0); -- Mars
-- INSERT INTO `mob_groups` VALUES (97777,16777,49,0,128,16777,444000,7777,140,140,0); -- Minerva
-- Dummy, never dies and never fights back.
INSERT INTO `mob_groups` VALUES (99999,99999,49,0,0,0,1000000,2500,120,120,0);
-- Thinking of placing a new entry right here? DO NOT.
| true |
7b4ef774e5676989a30dc957d7cfb542e75c0e5e | SQL | r0bis/acc_caseloads | /sql/qsel_CountDCaseloads.sql | UTF-8 | 586 | 3.421875 | 3 | [] | no_license | SELECT main.AllocatedHCPName AS TWList,
Count(main.ClientID) AS Nr,
tbl_TWListPD.notes AS Explanation
FROM main INNER JOIN tbl_TWListPD
ON main.AllocatedHCPName = tbl_TWListPD.AllocatedHCPName
GROUP BY main.AllocatedHCPName, tbl_TWListPD.notes
ORDER BY Count(main.ClientID) DESC
;
-- When pasting in Access, paste only the query; pasting also comments will generate errors
/* List TW-List caseloads by count descending
name: qsel_CountDCaseloads
status: Hidden, old
Overview of Treatment and Waiting List Caseloads
With explanation of caseloads
*/
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.