Database Reference
In-Depth Information
Writing to tuples
To write data to a tuple column, we provide values for all of the tuple components, in order,
separated by commas and grouped by parentheses:
UPDATE "users"
SET "education" = ('Big Data University', 2003)
WHERE "username" = 'alice';
When we read alice 's user record back, cqlsh displays tuple data using the same
format:
If we wish to populate some of the components of a tuple but leave others empty, we can
use the null keyword:
UPDATE "users"
SET "education" = ('Cassandra College', null)
WHERE "username" = 'bob';
As a shorthand, we can omit the last value or values when writing a tuple, as long as we
specify at least the first value:
UPDATE "users"
SET "education" = ('BDU')
WHERE "username" = 'alice';
Note, however, that any components that we omit will be assigned null values. Let's take
a look at alice and bob 's rows now:
Search WWH ::




Custom Search