From the course: Introduction to Cassandra

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Adding data

Adding data

- [Instructor] Now that we've got the table set up, it's time to add rows to the tables with information about one of the monsters in our community. Let's go ahead and think about the CRUD functions for working with data again, create, read, update, and delete. We'll learn how to do each of these tasks in CQL. We already performed the create when we created the tables. Now, we're going to do another kind of create action using insert to add rows to the tables. To add data to your table, the INSERT command is used. This template shows how to craft your INSERT command. Any fields listed in the primary key, your partition keys, or your clustering keys, those are all required when you do an INSERT. The columns for the values must be included in the same order as the column list for the command. When inserting data into tables, only the partition and clustering keys are required as I mentioned. The monsters_by_city table is optimized to return data about the monsters based on the city…

Contents