events

サイクリング・レースの月と日付を使用して、クラスター化カラム全体の範囲を取得する方法を示します。

サイクリング・レースの月と日付を使用して、クラスター化カラム全体の範囲を取得する方法を示します。

eventsテーブル

DROP table if exists cycling.events;

CREATE TABLE cycling.events (
   Year int,
   Start_Month int,
   Start_Day int,
   End_Month int,
   End_Day int,
   Race TEXT,
   Discipline TEXT,
   Location TEXT,
   UCI_code TEXT,
   PRIMARY KEY ((YEAR, Discipline), Start_Month, Start_Day, Race));

INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,01,null,null,'DVV verzekeringen trofee - GP Sven Nys','Cyclo-cross','Baal','C1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,01,01,03,'Mitchelton Bay Cycling Classic','Road', 'Geelong, Victoria','CRT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,04,01,08,'Cycling Australia Road National Championships',	'Road',	'Ballarat',	'CN');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,08,null,null,'Belgian Cyclo-cross National Championships','Cyclo-cross','Oostende','CN');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,08,null,null,'British Cyclo-cross National Championships','Cyclo-cross','Bradford','CN');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,08,null,null,'Dutch Cyclo-cross National Championships','Cyclo-cross','Holland','CN');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,08,null,null,'USA Cycling Cyclo-Cross National Championships','Cyclo-cross','Hartford', 'CT','CN');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,14,01,17,'Santos Women''s Tour','Road','South Australia','WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,15,01,22,'Tour Down Under','Road','South Australia','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,15,null,null,'UCI Cyclo-cross World Cup Fiuggi Regione Lazio','Cyclo-cross','Fiuggi','CDM');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,22,null,null,'UCI Cyclo-cross World Cup Hoogerheide','Cyclo-cross','Hoogerheide','CDM');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,23,01,29,'Vuelta Ciclista a la Provincia de San Juan','Road','San Juan',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,26,null,null,'Cadel Evans Great Ocean Road Race - Towards Zero Race Melbourne','Road','Melbourne','CRT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,26,null,null,'Challenge Mallorca: Trofeo Porreres-Felanitx-Ses Salines-Campos','Road','Mallorca',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,28,null,null,'Challenge Mallorca: Trofeo Serra de Tramuntana -2017','Road','Mallorca',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,28,null,null,'Cadel Evans Great Ocean Road Race','Road','Geelong', 'WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,28,null,null,'Challenge Mallorca: Trofeo Andratx-Mirador des Colomer','Road','Mallorca',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,28,01,29,'UCI Cyclo-cross World Championships','Cyclo-cross','Bieles','CM');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,29,null,null,'Cadel Evans Great Ocean Road Race','Road','Geelong','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,29,null,null,'Grand Prix Cycliste la Marseillaise','Road','France',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,29,null,null,'Mallorca Challenge: Trofeo Palma','Road','Mallorca',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,29,02,04,'Dubai Tour','Road','Dubai',	'2.1','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,01,31,02,03,'Ladies Tour of Qatar','Road','Qatar','WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,02,01,02,05,'Jayco Herald Sun Tour','Road','Victoria',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,02,01,02,05,'Volta a la Comunitat Valenciana','Road','Valencia',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,02,01,02,05,'Etoile de Besseges','Road','Languedoc-Roussillon',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values (2017,02,04,null,null,'DVV verzekeringen trofee - Krawatencross','Cyclo-cross','Lille','C1');
// second
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,04,null,null,'DVV verzekeringen trofee - Krawatencross','Cyclo-cross','Lille','C1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,05,null,null,'G.P. Costa degli Etruschi','Road','Italy',null);
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,04,null,null,'Superprestige - Hoogstraten - 2017','Cyclo-cross','Belgium','C1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,06,02,10,'Tour of Qatar','Road','Qatar','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,09,02,12,'South African Road Championships','Road','Western Cape','CN');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,11,null,null,'Superprestige - Middelkerke - 2017','Cyclo-cross','Middelkerke','C1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,11,null,null,'Vuelta Ciclista a la Region de Murcia','Road','Murcia	','1.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,12,null,null,'Clasica de Almeria','Road','Almeria','1.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,11,null,null,'Trofeo Laigueglia','Road','Liguria','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,14,02,19,'Tour of Oman','Road','Oman',	'HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,15,02,19,'Volta ao Algarve em Bicicleta','Road','Algarve','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,15,02,19,'Vuelta a Andalucia Ruta Ciclista Del Sol','Road','Andalucia','HC'
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,17,02,19,'UCI Track World Cup III,'Track',	'Cali','CDM');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,18,02,19,'Tour Cycliste International du Haut Var-matin','Road','Provence'	,'2.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,21,02,13,'Tour Cycliste International La Provence','Road','Provence','2.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,22,03,01,'Le Tour de Langkawi','Road','Langkawi','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,23,02,26,'Abu Dhabi Tour','Road','Abu Dhabi','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,25,null,null,'Faun Environnement - Classic de lArdeche Rhone Crussol','Road','Ardeche	','	1.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,25,null,null,'Omloop Het Nieuwsblad Elite','Road','Belgium','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,25,null,null,'Omloop Het Nieuwsblad Elite Women','Road','Gent','WWT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,25,02,26,'UCI Track World Cup IV	Track',null,'Los Angeles','CDM');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,26,null,null,'Kuurne-Brussel-Kuurne','Road','Kuurne','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,02,26,null,null,'Omloop van het Hageland - Tielt-Winge','Road','Belgium','WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,01,null,null,'Le Samyn','Road','Hainaut','1.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,01,null,null,'Le Samyn des Dames','Road','Hainaut','WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,04,null,null,'Strade Bianche','Road','Tuscany','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,04,null,null,'Strade Bianche Women','Road','Tuscany','WWT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,05,null,null,'Dwars door West-Vlaanderen Johan Museeuw Classic','Road','Flanders','	1.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,05,null,null,'GP Industria and Artigianato','Road','Larciano','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,05,03,12,'Paris - Nice','Road','France','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,08,03,11,'Semana Ciclista Valenciana','Road','Valencia','WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,08,03,14,'Tirreno-Adriatico','Road','Italy','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,08,03,14,'Oceania Championships','Road','Canberra','CC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,11,null,null,'Ronde van Drenthe','Road','Netherlands','WWT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,12,null,null,'Drentse Acht van Westerveld','Road','Dwingeloo','WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,15,null,null,'Nokere Koerse - Danilith Classic','Road','Flanders','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,17,null,null,'Handzame Classic','Road','Flanders','1.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,18,null,null,'Classic Loire Atlantique','Road','Loire','1.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,18,null,null,'Milan-San Remo','Road','Italy','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,18,null,null,'Tucson Bicycle Classic','Road','Tucson, Arizona','NE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,19,03,26,'Cape Epic','Mountain Bike','Cape Town','SHC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,19,null,null,'Trofeo Alfredo Binda Comune di Cittiglio','Road','Italy','WWT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,20,03,26,'Volta Ciclista a Catalunya','Road','Catalunya','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,22,null,null,'Dwars Door Vlaanderen','Road','Flanders','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,22,null,null,'Dwars door Vlaanderen women','Road','Waregem','WE');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,23,03,26,'Settimana Internazionale Coppi e Bartali','Road','Emilia-Romagna','2.1');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,24,null,null,'E3 Harelbeke','Road','Flanders','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,26,null,null,'Gent Wevelgem','Road','Flanders','WT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,26,null,null,'Gent Wevelgem Women','Road','Belgium','WWT');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,28,03,30,'Driedaagse De Panne-Koksijde','Road','West Flanders','HC');
INSERT INTO cycling.events (Year,Start_Month,Start_Day,End_Month,End_Day,Race,Discipline,Location,UCI_code) Values
(2017,03,29,null,null,'Pajot Hills Classic','Road','Flemish Brabant','WE' );