Question-49: You have been given below metadata for creating Cassandra table.

 

Category text

Created_year int

course_id uuid

published_date timestamp

course_detail text

user_id uuid

In this assuming combination of these three columns course_id, Category, Created_year   to be unique across all data.

Now you need to design a table where allow users to query on Category and possible created_year ranges while avoiding upserts on import. You must also return your results in descending order of created_year.

  1. Get all Questions and Answer from here
  2. You need to have paid subscription to access all questions

D. Thanks for considering Python Certification Material

Correct Answer : 1

Exp : As per the requirement, we should be able to query based on Category. Give me all the courses from a particular Category.

We also want to support range query on a Created_year, hence there is certainly this column go for clustering.

Now as we know, our primary key column should be unique across all the data, hence we need to have course_id should be part of primary key. Hence, correct table definition will be

CREATE TABLE HadoopExam (

 

You can access to full explanation to question and answer from this page.