Question-26: You have defined below table definition
CREATE TABLE he_food_chain(
country_code text,
state text,
city text,
cafe_name text,
opening_date timestamp,
PRIMARY KEY ((country_code, state, city) , opening_date, cafe_name )
) WITH CLUSTERING ORDER BY (opening_date ASC, cafe_name ASC ) ;
Which of the following is valid query?
- SELECT * FROM he_food_chain WHERE country_code = 'IND' and state = 'RAJ' and city = 'UDAIPUR'
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Ans : A,B
Exp : In Option-3 we are not having city column in where clause which is a partition key. Hence, this is not correct. In option-4 it is using clustering column café_name without considering the preceding clustering key column opening_date. Hence, this is also invalid.
You can access to full explanation to question and answer from this page.