table-cyclist-stats

INSERT INTO cycling.cyclist_stats
  (id, lastname, basics)
  VALUES (
    6cbc55e9-1943-47dc-91f2-f8f9e95992eb,
    'VIGANO',
    { birthday:'1984-06-12', nationality:'Italy', weight:'67 kg', height:'1.82 m' }
  );
INSERT INTO cycling.cyclist_stats
  (id, lastname, basics)
  VALUES (
    e7ae5cf3-d358-4d99-b900-85902fda9bb0,
    'FRAME',
    { birthday:'1993-06-18', nationality:'New Zealand', weight:null, height:null }
  );
INSERT INTO cycling.cyclist_stats
  (id, lastname, basics)
  VALUES (
    220844bf-4860-49d6-9a4b-6b5d3a79cbfb,
    'TIRALONGO',
    { birthday:'1977-07-08', nationality:'Italy', weight:'63 kg', height:'1.78 m' }
  );
SELECT * FROM cycling.cyclist_stats
  WHERE id = 220844bf-4860-49d6-9a4b-6b5d3a79cbfb;;
DESCRIBE TABLE cycling.cyclist_stats;
ALTER TABLE cycling.cyclist_stats
  DROP basics;
CREATE TABLE IF NOT EXISTS cycling.cyclist_stats (
  id UUID PRIMARY KEY,
  lastname text,
  basics basic_info
);
DESCRIBE TABLE cycling.cyclist_stats;
DROP TABLE IF EXISTS cycling.cyclist_stats;
# CREATE TYPE IF NOT EXISTS cycling.basic_info (
#   birthday timestamp,
#   nationality text,
#   height text,
#   weight text
# );
UPDATE cycling.cyclist_stats SET basics.birthday = '2000-12-12'
  WHERE id = 220844bf-4860-49d6-9a4b-6b5d3a79cbfb;

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