Question: Cassandra Design and Clustering If needed, please open the Using Redis and Cassandra Databases Locally instructions. Create few tables and add / delete / modify
Cassandra Design and Clustering
If needed, please open the Using Redis and Cassandra Databases Locally instructions.
Create few tables and adddeletemodify data in a Cassandra database. Please seeDatastax documentationLinks to an external site.for variabledata types and additional commands in Cassandra.
Create Cassandra database and keyspace. Create table customer with following columns: customer id int or varint first name text last name text location text and created on timestamp Customer id is the primary key. Add at least ten pieces of customer information to the table.
Create second table called Product with these columns: product id text product name text product description text and date added timestamp Product id would be the primary key. Add at least ten products of your liking to this table. To insert the current time stamp, use toTimeStamptoDatenow
Create third table called CustomerByProductLiked with these columns: Product id of Liked product text title text description text last name text location text liked on timestamp The primary key is the product id of the Liked product and liked on the Add at least ten reviews for some of the products and by some of the customers. This table keeps track of reviews using customer id
Now query the above table CustomerByProductLiked to identify the last five products liked by a customer using a where clause with the customer id and title. Please note you may have to add Allow Filtering options for it to process the query.
Add a fourth table called ProductLikedByCustomer, using these fields: customer id first name, last name, title, id of product liked, and liked on timestamp In this table, customer id and likeon would form the primary key.
Now query the above table ProductLikedByCustomer to identify the last five products liked by a customer using a where clause with the customer id and title. Please note you may have to add Allow Filtering options for it to process the query.
Draw a diagram to describe the database structure.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
