Database Reference
In-Depth Information
again. Now if the batch failed after the counter was applied, the user will have cred-
it_balance as 2,000, which is undesired.
By default, all the mutations hold the same system timestamp. If you wanted to supply
something different, you could provide it by specifying USING TIMESTAMP
<timestamp_in_microseconds> . It should be noted that the batch level timestamp
does not overwrite the query level timestamp. So, if a query has a different timestamp
than the batch, that query timestamp will be applied on that mutation.
Other CQL commands
CQL provides some commands to quickly get an overview, obtain information, or per-
form operations.
USE
The USE command is used to switch to a keyspace. All the examples in this chapter as-
sume that the client is switched to the keyspace in question. In case you do not want to use
the USE command, you will have to provide a fully-qualified table name or type name to
address any command that involves a table or type.
Note
A fully-qualified table name is the keyspace name followed by a dot followed by the table
name. For example, in the university_ks keyspace, a table named departments
will have a fully-qualified table name as university_ks.departments .
The usage of the USE keyword is as follows:
USE keyspace_name
TRUNCATE
The TRUNCATE command is the same as delete from table_name in SQL. It de-
letes all the data from a table, irreversibly. The syntax of this command is as follows:
TRUNCATE table_name
Search WWH ::




Custom Search