cyclist_cat_pts

Track cyclists by category and point total.

Track cyclists by category and point total.

// Track cyclists by category and point total

source '0_create_keyspace.cql';


// CREATE TABLE CATEGORIZED POINTS

DROP TABLE IF EXISTS cycling.cyclist_cat_pts;

// START-table
CREATE TABLE cycling.cyclist_cat_pts ( 
   category text, 
   points int, 
   id UUID, 
   lastname text, 
   PRIMARY KEY (category, points)); 
// END-table

// START-inserts
INSERT INTO cycling.cyclist_cat_pts (category, points, id, lastname) VALUES 
('GC', 780, 829aa84a-4bba-411f-a4fb-38167a987cda, 'SUTHERLAND');
INSERT INTO cycling.cyclist_cat_pts (category, points, id, lastname) VALUES 
('GC', 1269, 220844bf-4860-49d6-9a4b-6b5d3a79cbfb, 'TIRALONGO');
// END-inserts

// Query to view inserted data
// To fine tune the display order, use the ORDER BY clause
// The partition key must be defined in the WHERE clause 
// The ORDER BY clause defines the clustering column to use

SELECT * FROM cycling.cyclist_cat_pts WHERE category = 'GC' ORDER BY points ASC;