table-race-sponsors
DELETE sponsorship FROM cycling.race_sponsors
WHERE race_name = 'Giro d''Italia';
INSERT INTO cycling.race_sponsors (
race_name, sponsorship
) VALUES (
'Tour de France',
{ 'LCL', 'Carrefour', 'Skoda', 'Vittel', 'Krys' }
);
INSERT INTO cycling.race_sponsors (
race_name, sponsorship
) VALUES (
'Tour de Suisse',
{ 'BMC', 'Tag Heuer', 'Assos' }
);
INSERT INTO cycling.race_sponsors (
race_name, sponsorship
) VALUES (
'Criterium du Dauphine',
{ 'LCL', 'Skoda' }
);
INSERT INTO cycling.race_sponsors (
race_name, sponsorship
) VALUES (
'Giro d''Italia',
{ 'Castrelli', 'Tag Heuer', 'Alfa Romeo', 'Unibet', 'Pinarello', 'Selle Italia', 'Rovagnati', 'Scrigno' }
);
INSERT INTO cycling.race_sponsors (
race_year, race_name, sponsorship
) VALUES (
2018, 'Tour de France',
[ 'LCL', 'Carrefour', 'Skoda', 'Vittel', 'Krys' ]
);
DELETE sponsorship[2] FROM cycling.race_sponsors
WHERE race_year = 2018 AND race_name = 'Tour de France';
CREATE INDEX sponsorship_idx ON cycling.race_sponsors (sponsorship);
CREATE CUSTOM INDEX sponsorship_idx ON cycling.race_sponsors (sponsorship)
USING 'StorageAttachedIndex';
DESCRIBE INDEX cycling.sponsorship_idx;
DESCRIBE INDEX cycling.sponsorship_idx;
SELECT * FROM cycling.race_sponsors;
SELECT * FROM cycling.race_sponsors;
SELECT * FROM cycling.race_sponsors;
SELECT * FROM cycling.race_sponsors WHERE sponsorship CONTAINS 'Carrefour';
SELECT * FROM cycling.race_sponsors WHERE sponsorship CONTAINS 'Carrefour';
CREATE TABLE IF NOT EXISTS cycling.race_sponsors (
race_name text PRIMARY KEY,
sponsorship set<text>
);
CREATE TABLE IF NOT EXISTS cycling.race_sponsors (
race_year int,
race_name text,
sponsorship list<text>,
PRIMARY KEY (race_year, race_name)
);
DESCRIBE TABLE cycling.race_sponsors;
DESCRIBE TABLE cycling.birthday_list;
DROP TABLE IF EXISTS cycling.race_sponsors;
DROP TABLE IF EXISTS cycling.race_sponsors;