What do you see in above table creation definition assuming combination of these three columns course_id,Category,Created_year to be unique across all data.
1. It is a good design of table, it can avoid the upserts.
2. It is a good design of table, and you can easily do the range query on Created_year column.
4. Its not a good or bad design. Itas based on requirement.
Correct Answer : Get Lastest Questions and Answer : Explanation: Certainly its a bad table design in Cassandra. As you know it will not take care of record uniqueness also you can not make range query based on Created_year column.
In this case last rows will be kept in table, because it will apply the upserts and which is not good design.
Question : 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.
Correct Answer : Get Lastest Questions and Answer : Explanation: 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
SELECT * FROM HadoopExam where Category='BigData' and Created_year=2017; SELECT * FROM HadoopExam where Category='BigData' and Created_year < 2017;
Below query will not be supported SELECT * FROM HadoopExam where Created_year < 2017;
Question : You have wrongly loaded all the data in Cassandra table and want to delete all the rows from that table. Which of the following will help you to do this? 1. DROP
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.