Inserting data using CQL in DataStax Studio
-
Create the schema.
To add data to a table from a cell in your notebook:
-
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');
Inserting CQL data 1 -
To display the inserted data, use the CQL command :
SELECT * FROM inventory.product_info;
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.