table-cyclist-races
ALTER TABLE cycling.cyclist_races
ADD manager UUID;
INSERT INTO cycling.cyclist_races (
id,
lastname,
firstname,
races
) VALUES (
5b6962dd-3f90-4c93-8f61-eabfa4a803e2,
'VOS',
'Marianne',
[ {
race_title:'Rabobank 7-Dorpenomloop Aalburg',
race_date:'2015-05-09',
race_time:'02:58:33'},
{
race_title:'Ronde van Gelderland',
race_date:'2015-04-19',
race_time:'03:22:23'
}
]
);
INSERT INTO cycling.cyclist_races (
id, lastname, firstname, races
) VALUES (
e7cd5752-bc0d-4157-a80f-7523add8dbcd, 'VAN DER BREGGEN', 'Anna', [
{
race_title : 'Festival Luxembourgeois du cyclisme feminin Elsy Jacobs - Prologue - Garnich > Garnich',race_date : '2015-05-01', race_time : '08:00:00'
},
{
race_title : 'Festival Luxembourgeois du cyclisme feminin Elsy Jacobs - Stage 2 - Garnich > Garnich', race_date : '2015-05-02', race_time : '06:00:00'
},
{
race_title : 'Festival Luxembourgeois du cyclisme feminin Elsy Jacobs - Stage 3 - Mamer > Mamer', race_date : '2015-05-03', race_time : '06:00:00'
}
]
);
INSERT INTO cycling.cyclist_races (
id,
races
) VALUES (
5b6962dd-3f90-4c93-8f61-eabfa4a803e2,
[ { race_time : '07:00:00'},
{ race_time : '08:00:00' } ]
);
INSERT INTO cycling.cyclist_races (
id,
races
) VALUES (
5b6962dd-3f90-4c93-8f61-eabfa4a803e2,
[ { race_title : 'Rabobank 7-Dorpenomloop Aalburg', race_date : '2015-05-09', race_time : '07:00:00' },
{ race_title : 'Ronde van Gelderland', race_date : '2015-04-19', race_time : '08:00:00' } ]
);
UPDATE cycling.cyclist_races SET races[1] = { race_time : '06:00:00'}
WHERE id = 5b6962dd-3f90-4c93-8f61-eabfa4a803e2 ;
DESCRIBE TABLE cycling.cyclist_races;
DESCRIBE TABLE cycling.cyclist_races;
DESCRIBE TABLE cycling.cyclist_races;
CREATE INDEX IF NOT EXISTS races_idx
ON cycling.cyclist_races (races);
CREATE CUSTOM INDEX IF NOT EXISTS races_idx
ON cycling.cyclist_races (races) USING 'StorageAttachedIndex';
DESCRIBE INDEX cycling.races_idx;
DESCRIBE INDEX cycling.races_idx;
SELECT * FROM cycling.cyclist_races;
SELECT lastname,races FROM cycling.cyclist_races
WHERE id = e7cd5752-bc0d-4157-a80f-7523add8dbcd;
SELECT * FROM cycling.cyclist_races
WHERE races CONTAINS {
race_title:'Rabobank 7-Dorpenomloop Aalburg',
race_date:'2015-05-09',
race_time:'02:58:33'};
SELECT * FROM cycling.cyclist_races
WHERE races CONTAINS {
race_title:'Rabobank 7-Dorpenomloop Aalburg',
race_date:'2015-05-09',
race_time:'02:58:33'};
ALTER TABLE cycling.cyclist_races
ADD completed list<text>;
ALTER TABLE cycling.cyclist_races
DROP manager;
CREATE TABLE IF NOT EXISTS cycling.cyclist_races (
id UUID PRIMARY KEY,
lastname text,
firstname text,
races list<FROZEN <race>>
);
DESCRIBE TABLE cycling.cyclist_races;
DROP TABLE IF EXISTS cycling.cyclist_races;
# CREATE TYPE IF NOT EXISTS cycling.race (
# race_title text,
# race_date timestamp,
# race_time time
# );