Database Reference
In-Depth Information
The single row shown in the above figure is precisely what we wrote with the
INSERT
statement earlier. So far, we haven't seen any special behavior for static columns. To see
static columns in action, let's add another status update to the table:
INSERT INTO "users_with_status_updates"
("username", "id", "body")
VALUES ('alice', NOW(), 'Another status update');
Note that in this case, we did not specify values for either of the static columns; we
provided the partition key, the clustering column, and a value for the non-static data
column
body
. Now, let's take a look at the contents of the table:
SELECT * FROM "users_with_status_updates";
The output is as follows:
Now, the effect of the
STATIC
column declaration is clear: both rows have the email ad-
dress we assigned to the first row even though we did not specify an
email
value in our
second
INSERT
query.