Correct Answer : Get Lastest Questions and Answer : Explanation: In this case we know, the rating is equality operator. Hence, need to be part of primary key. Course_name is enough to uniquely identify the course, hence we need it to course_name as clustering key. publish_date is inequality operator hence, it should be part of clustering key as well. Here, our key attribute(title) != query attributes.
Question : You have been given below conceptual datamodel for HadoopExam Inc online training institute.
Please find the correct query for given access pattern
where author_id = ? (All the courses created by an author)
Correct Answer : Get Lastest Questions and Answer : Explanation: as we know this is a 1 to many relationship. Now criteria for access pattern in author_id. However, to uniquely identify a row , we should have a course_id as well included. Email and author_name must be static column, because they are stored only once per partition. Our partition key is author_id and author will have its own name and email id, which we can store as a static column.
Correct Answer : Get Lastest Questions and Answer : Explanation: as we know this is a 1 to many relationship. Now criteria for access pattern in author_id. However, to uniquely identify a row, we should have a course_id as well included. Email and author_name must be static column, because they are stored only once per partition. Our partition key is author_id and author will have its own name and email id, which we can store as a static column.
As we have range query based on publish date, hence publish_date should be part of primary key as a clustering column.