Inserting data using CQL in DataStax Studio

To add data to a table from a cell in your notebook:

  1. Use the CQL command to add data to the tables:

    USE inventory;
    
    INSERT INTO product_info (product_id, product_name) VALUES (99051fe9-6a9c-46c2-b949-38ef78858dd0,'Coffee mug');
    INSERT INTO product_info (product_id, product_name) VALUES (b3a76c6b-7c7f-4af6-964f-803a9283c401,'Ethiopian coffee');
    INSERT INTO product_info (product_id, product_name) VALUES (0c3f7e87-f6b6-41d2-9668-2b64d117102c,'Half and half');
    
    INSERT INTO buyer_info (buyer_id, buyer_name) VALUES (f5ca5394-f242-40d3-a8d1-9e36497feb5f,'Jane Doe');
    INSERT INTO buyer_info (buyer_id, buyer_name) VALUES (19af1261-4442-4c23-a34f-2a5b12edc923,'John Smith');
    stdInsertingCQLData1
    Inserting CQL data 1
  2. To display the inserted data, use the CQL command :

    SELECT * FROM inventory.product_info;
    stdInsertingCQLData2
    Inserting CQL data 2

The notebook tutorial Working with CQL is installed with Studio. For more information about DataStax Enterprise CQL, see Accessing data using CQL.

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