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_name. However, to uniquely identify a row, we should have a course_id as well included.
Here, we have not added email column as a static column. Because, if we added email as a static column then single partition (author name = “Amit Jain" could not be uniue, which is partition key). And we know static columns are stored per partition. Assume we have multiple author with the same name “Amit Jain" and all author will fall in same partition, now static column (email, if we have decalred it as static) will be stored only once and as soon as you update email id it will be upsert and causes email id to be updated for all the author with same name.
Question : You have been given below conceptual data model for HadoopExam Inc online training institute.
Please find the correct query for given access pattern
where user_id = ? and video_id=? (All the comments by a user)
Correct Answer : Get Lastest Questions and Answer : Explanation: It’s many to many relationship, also we have equality access pattern so user_id and course_id will be partition key. To uniquely identify many to many relationship, we have to use both entity key as well as relationship key.
Regarding static column : Yes, we can have user_emai, course_name and description as a static column. They are stored once for each partition, and here for user_id and course_id is unique for each row, so we can have these columns as static key.
Question : . You have been given below conceptual data model for HadoopExam Inc online training institute.
Please find the correct query for given access pattern
where user_id = ? and comment_date>? (All the comments by a user)
Correct Answer : Get Lastest Questions and Answer : Explanation: : It’s many to many relationship, also we have equality access pattern so user_id will be partition key. To uniquely identify many to many relationship, we have to use both entity key as well as relationship key. However, here we have inequality operator as well, which causes this to be part of clustering key (commnet_date).
Regarding static column: Yes, we can have user_email, as a static column. It is stored once for each partition, and here for user_id is unique for each row, so we can have these columns as static key.
1. After insert query, you have to execute another command named 'replicate-all', using cqlsh. So data can be replicated on three nodes.
2. Before insert query, you have to execute another command named 'replicate-all', using cqlsh, for the session. So data can be replicated on three nodes.