From the course: Introduction to Cassandra

Unlock the full course today

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

Solution: Make a table

Solution: Make a table

(upbeat synth music) - [Instructor] Now we're ready to take a look at the solution for our challenge. This challenge has three parts. On this slide, we're going to look at the first two parts, creating the UDT and creating the table. Creating the UDT is straightforward. Because we may not be in the LinkedIn space, I chose to specify my key space as LinkedIn. And the type has two fields, first name and last name. Creating the table is a little trickier. Most of the fields are just text fields but the ID needs a UUID and the name is using that user-defined type. As specified, the partition key is the ID and results will be sorted by the clustering key programming language. When inserting the data, I have chosen to include all of the fields, even though only the ID and programming language are required. The ID can use the UUID function to generate a unique id. The rest of the fields are straightforward, except for the name. Note that the field names for the user-defined type are not…

Contents