[{"id":"cassandrabeginner-001","courseId":"cassandra-beginner","domain":"data-modeling","topic":"Query-first table design","prompt":"A hotel app's workflow chains queries together. Put these steps in the order in which each one unlocks the next.","hint":"Find the step whose result gives a later step a key it needs.","explain":"An app's screens form a chain: a step can hand the next one something it needs, such as an identifier. Work out which step produces a value that a later step reads, and which ones only consume.","source":"https://cassandra.apache.org/doc/latest/cassandra/developing/data-modeling/data-modeling_queries.html","interaction":{"type":"sort","items":[{"text":"View hotels near a point of interest","why":"This search returns several hotels along with their unique keys, which later steps need."},{"text":"Look up a selected hotel's details by its key","why":"The key from the search is what lets the app fetch that hotel's name and location."},{"text":"Book a room, which creates a reservation record","why":"Booking writes the reservation, so it comes after the hotel and room have been chosen."},{"text":"Look up the reservation later through other queries","why":"Guests and staff read the reservation at a later time, once it exists."}]},"options":[],"answer":"o:abcd","explanation":"In query-first design, each step of an app's workflow often produces a key or record that the next step needs, so the queries form a chain.","concept":"In query-first design, each step of an app's workflow often produces a key or record that the next step needs, so the queries form a chain.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Each query in a workflow can unlock the next one through the keys it returns."]},{"id":"cassandrabeginner-002","courseId":"cassandra-beginner","domain":"data-modeling","topic":"No joins in Cassandra","prompt":"In Cassandra, a SELECT can combine rows from two tables with a JOIN, as long as the two tables share a key.","hint":"Think about what one read can reach across tables.","explain":"Relational databases can link tables at read time by matching key values. In Cassandra, consider what a single read is able to reach, and where the matching data would have to be stored instead.","source":"https://cassandra.apache.org/doc/latest/cassandra/developing/data-modeling/data-modeling_rdbms.html","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"Cassandra cannot perform joins, even when the tables share a key; the matching has to move to the client or to a denormalized table."},{"id":"b","text":"False","why":"You cannot perform joins in Cassandra, so the model stores a denormalized second table or does the matching in the client."}],"answer":"b","explanation":"Cassandra does not perform joins. Data that a query needs from several tables is either matched on the client or duplicated into a denormalized table.","concept":"Cassandra does not perform joins. Data that a query needs from several tables is either matched on the client or duplicated into a denormalized table.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["If a design needs data from two tables in one read, duplicate it into a table built for that query."]},{"id":"cassandrabeginner-003","courseId":"cassandra-beginner","domain":"data-modeling","topic":"No foreign keys or referential integrity","prompt":"Your orders table stores a customer_id that should match a row in the customers table. What does Cassandra itself do to keep that link valid?","hint":"Think about which checks a relational database runs on your behalf.","explain":"Relational schemas can declare that a value in one table must match a row in another, and the database enforces that. Consider which duties the database keeps in Cassandra, and which fall to you.","source":"https://cassandra.apache.org/doc/latest/cassandra/developing/data-modeling/data-modeling_rdbms.html","interaction":{"type":"single"},"options":[{"id":"a","text":"Nothing: it stores the ID and does not check the link","why":"Cassandra has no referential integrity across tables, so the link is only an ID that your application stores."},{"id":"b","text":"It rejects an order whose customer does not exist","whyNot":"That is a foreign key check, which Cassandra does not perform across tables."},{"id":"c","text":"It deletes that customer's orders automatically","whyNot":"Cascading deletes are not available, so removing a customer leaves its orders in place."},{"id":"d","text":"It copies the customer row into every order","whyNot":"Copying data is denormalization, a design choice you make yourself; the database does not do it to keep references valid."}],"answer":"a","explanation":"Cassandra has no referential integrity across tables: it does not enforce foreign-key style links, and cascading deletes are not available.","concept":"Cassandra has no referential integrity across tables: it does not enforce foreign-key style links, and cascading deletes are not available.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["A customer_id in Cassandra is just a stored value; the application has to manage the link."]},{"id":"cassandrabeginner-004","courseId":"cassandra-beginner","domain":"data-modeling","topic":"Partition key","prompt":"A table is declared as shown. Which rows end up in the same partition?","hint":"The first part of a primary key definition decides the partition.","explain":"Cassandra places a row by hashing part of its primary key. Rows that share the hashed value are kept together on the same replicas. The table definition decides which columns make up that part.","source":"https://cassandra.apache.org/doc/latest/cassandra/developing/cql/ddl.html","interaction":{"type":"single"},"options":[{"id":"a","text":"Rows that have the same sensor_id","why":"sensor_id is the partition key, the first part of the primary key; all rows sharing its value form one partition."},{"id":"b","text":"Rows that have the same reading_time","whyNot":"reading_time is a clustering column; it orders rows inside a partition rather than choosing the partition."},{"id":"c","text":"Rows that have the same sensor_id and reading_time","whyNot":"Those two columns together identify a single row, which is the row's full key, not the partition."},{"id":"d","text":"Rows written by the same INSERT statement","whyNot":"How rows are written has no effect on placement; the hashed partition key value decides where they go."}],"answer":"a","explanation":"The partition key, the first part of the primary key, decides which rows share a partition; rows with the same partition key value are stored together on the same replicas.","concept":"The partition key, the first part of the primary key, decides which rows share a partition; rows with the same partition key value are stored together on the same replicas.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","code":"CREATE TABLE sensor_data (\n  sensor_id int,\n  reading_time timestamp,\n  value double,\n  PRIMARY KEY (sensor_id, reading_time)\n);","takeaways":["The first part of a primary key decides placement; the remaining columns order rows inside a partition."]},{"id":"cassandrabeginner-005","courseId":"cassandra-beginner","domain":"data-modeling","topic":"Clustering columns","prompt":"A table is created with PRIMARY KEY (user_id, sent_at, msg_id). Which TWO statements about its columns are correct?","hint":"Some parts of a key place data; the rest arrange it.","explain":"A key's columns play different roles depending on where they sit. The leading ones pick where data lives; the trailing ones shape how rows lie within that place.","source":"https://cassandra.apache.org/doc/latest/cassandra/developing/cql/ddl.html","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"sent_at and msg_id are clustering columns, because they follow user_id in the key","why":"Columns that follow the partition key in the primary key definition are the clustering columns."},{"id":"b","text":"Within each partition, rows are sorted by sent_at, then msg_id, as the key lists them","why":"The order of the columns in the primary key defines the clustering order."},{"id":"c","text":"user_id is a clustering column, because it is listed first in the key","whyNot":"The first column is the partition key, which decides where rows are stored, not a clustering column."},{"id":"d","text":"The clustering columns decide which node stores each row","whyNot":"Node placement comes from the partition key; clustering columns only arrange rows inside a partition."},{"id":"e","text":"Rows come back in insertion order, whatever the key lists","whyNot":"Read order is set by the clustering columns, not by the order in which rows were written."},{"id":"f","text":"sent_at is a partition key column, because it is used for sorting","whyNot":"Being used for sorting does not make a column part of the partition key; its position in the key does."}],"answer":"ab","explanation":"In a primary key, the first column or columns form the partition key that decides placement; the columns after them are clustering columns, and their order sets the sort order within a partition.","concept":"In a primary key, the first column or columns form the partition key that decides placement; the columns after them are clustering columns, and their order sets the sort order within a partition.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Read the primary key left to right: the first part places rows, and the rest arranges them."]}]