table-events
SELECT start_month as month, start_day as day, race FROM cycling.events
WHERE year = 2017 AND discipline = 'Road'
AND (start_month, start_day) < (2, 14)
AND (start_month, start_day) > (1, 15);
SELECT start_month, MAX(start_day), COUNT(*) FROM cycling.events
WHERE year = 2017 AND discipline = 'Cyclo-cross';
SELECT start_month, MAX(start_day) FROM cycling.events
WHERE year = 2022
ALLOW FILTERING;
SELECT start_month, MAX(start_day), COUNT(*) FROM cycling.events
WHERE year = 2017 AND discipline = 'Cyclo-cross' AND start_month = 1
AND start_day = 1
ORDER BY race;
SELECT start_month, MAX(start_day), COUNT(*) FROM cycling.events
WHERE year = 2017 AND discipline = 'Cyclo-cross' AND start_month = 1
ORDER BY start_day,race;
SELECT * FROM cycling.events
WHERE year = 2017 AND discipline = 'Cyclo-cross'
AND start_month = 1 AND start_day = 1;
SELECT * FROM cycling.events WHERE race = 'Superprestige - Hoogstraten -2017'
AND start_month IN (1, 2)
ALLOW FILTERING;
COPY cycling.events FROM 'events-data.csv'
WITH HEADER = true AND DELIMITER = '|';
CREATE TABLE IF NOT EXISTS 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
)
);
DESCRIBE TABLE cycling.events;
DROP TABLE IF EXISTS cycling.events;