table-race-times

INSERT INTO cycling.race_times (
  race_name, cyclist_name, race_time, race_date
) VALUES (
  '17th Santos Tour Down Under', 'Rohan DENNIS', '19:15:18', '2017-04-14'
);

INSERT INTO cycling.race_times (
  race_name, cyclist_name, race_time, race_date
) VALUES (
  '17th Santos Tour Down Under', 'Richie PORTE', '19:15:20', '2017-04-14'
);

INSERT INTO cycling.race_times (
  race_name, cyclist_name, race_time, race_date
) VALUES (
  '17th Santos Tour Down Under', 'Cadel EVANS', '19:15:38', '2017-04-14'
);

INSERT INTO cycling.race_times (
  race_name, cyclist_name, race_time, race_date
) VALUES (
  '17th Santos Tour Down Under', 'Tom DUMOULIN', '19:15:40', '2017-04-14'
);
INSERT INTO cycling.race_times (
  finish_time, race_name, cyclist_name, race_date
) VALUES (
  1h4m48s20ms,
  '17th Santos Tour Down Under', 'Rohan DENNIS', '2017-04-14'
);
SELECT * FROM cycling.race_times;
SELECT * FROM cycling.race_times
  WHERE race_name = '17th Santos Tour Down Under'
    AND cyclist_name = 'Rohan DENNIS'
    AND race_date = '2017-04-14';
SELECT * FROM cycling.race_times
  WHERE race_date = '2017-04-15' - 1d;
ALTER TABLE cycling.race_times RENAME date TO race_date;
CREATE TABLE IF NOT EXISTS cycling.race_times (
  race_name text,
  race_time time,
  finish_time duration,
  race_date date,
  cyclist_name text,
  PRIMARY KEY (race_date, race_name, cyclist_name)
);
DESCRIBE TABLE cycling.race_times;
DROP TABLE IF EXISTS cycling.race_times;
UPDATE cycling.race_times SET finish_time = 2h5m22s14ms
WHERE race_name = '17th Santos Tour Down Under'
  AND cyclist_name = 'Rohan DENNIS'
  AND race_date = '2017-04-14';

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com