From the course: Cassandra Data Modeling Essential Training

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Solution: Create materialized view

Solution: Create materialized view

(upbeat music) - [Instructor] Here's a solution to our materialized view challenge. We want to use this statement, create materialized view, specify the materialized view name, which in this case could be something like devices by installation date. And then we specified the select clause and we're going to select the ID, device name and installation date. We're going to select it of course, from the devices table. Now we also want to add a where clause where installation date is not null, because we need that as part of the primary key, which we define after the where clause. Notice we're adding installation date to the primary key column that was used in the base table. In this case, it was ID.

Contents