Find all books that is subscribed by a subscriber and support writing year range, with most writing year first then sorted by title.
Consider Mapping Rules
Entities and relationships -> e-Book and e-Subscriber equality search attributes -> subscriber_id, subject inequiality search attributes -> writing_year ordering attributes -> writing_year, title key attributes -> book_id,subscriber_id, subscription_date (because in m to m relationship, we take keys from both the enity as well as from relationship)
Question : You have been given below conceptual data model
And you have below Access pattern , which of the following is valid table design
Correct Answer : Get Lastest Questions and Answer : Explanation: In this case we know, both the attributes are equality operator. Hence, need to be part of primary key and also they satisfy the uniqueness of the row.
Question : As you know, in Cassandra tables, must have primary keys. For primary key, you can use either TimeUUID or UUID only? Which of the following you can say is a Timeuuid?
Correct Answer : Get Lastest Questions and Answer : Explanation: To differentiate between Time UUID, you need to check third set of data and its first value. If first value start with 1 than its time UUID and if starts with 4 than its UUID only.
The uuid() function takes no parameters and generates a random Type 4 UUID suitable for use in INSERT or UPDATE statements.
UUID and TIMEUUID are stored the same way in Cassandra, and they only really represent two different sorting implementations.
IMEUUID columns are sorted by their time components first, and then by their raw bytes, whereas UUID columns are sorted by their version first, then if both are version 1 by their time component, and finally by their raw bytes. Curiosly the time component sorting implementations are duplicated between UUIDType and TimeUUIDType in the Cassandra code, except for different formatting.
I think of the UUID vs. TIMEUUID question primarily as documentation: if you choose TIMEUUID you're saying that you're storing things in chronological order, and that these things can occur at the same time, so a simple timestamp isn't enough. Using UUID says that you don't care about order (even if in practice the columns will be ordered by time if you put version 1 UUIDs in them), you just want to make sure that things have unique IDs.
Even if using NOW() to generate UUID values is convenient, it's also very surprising to other people reading your code.
It probably does not matter much in the grand scheme of things, but sorting non-version 1 UUIDs is a bit faster than version 1, so if you have a UUID column and generate the UUIDs yourself, go for another version.