- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 210字
- 2021-07-03 00:19:33
Working with status updates
Now that we've got our status updates table ready, let's create our first status update:
INSERT INTO "user_status_updates"
("username", "id", "body")
VALUES (
'alice',
76e7a4d0-e796-11e3-90ce-5f98e903bf02,
'Learning Cassandra!'
);
This will look pretty familiar; we specify the table we want to insert data into, the list of columns we're going to provide data for, and the values for these columns in the given order.
Let's give bob a status update too by inserting the following row in the user_status_updates table:
INSERT INTO "user_status_updates"
("username", "id", "body")
VALUES (
'bob',
97719c50-e797-11e3-90ce-5f98e903bf02,
'Eating a tasty sandwich.'
);
Now we have two rows, each identified by the combination of the username and id columns. Let's take a look at the contents of our table using the following SELECT statement:
SELECT * FROM "user_status_updates";
We'll be able to see the two rows that we inserted, as follows:
Note that, as we saw in the users table, the rows are not returned in lexical order of username; indeed, they're in the same order as the user records themselves are. Recall from the Paginating through results section of Chapter 2, The First Table, that the username column is ordered by an internally generated token, which is deterministic but meaningless from the application's perspective.
- Java編程全能詞典
- R Data Mining
- 樂高機器人EV3設(shè)計指南:創(chuàng)造者的搭建邏輯
- Julia 1.0 Programming
- 機器學(xué)習(xí)與大數(shù)據(jù)技術(shù)
- 工業(yè)機器人入門實用教程(KUKA機器人)
- 大數(shù)據(jù)挑戰(zhàn)與NoSQL數(shù)據(jù)庫技術(shù)
- VB語言程序設(shè)計
- 統(tǒng)計學(xué)習(xí)理論與方法:R語言版
- Hybrid Cloud for Architects
- 走近大數(shù)據(jù)
- 網(wǎng)絡(luò)安全技術(shù)及應(yīng)用
- 格蠹匯編
- 三菱FX/Q系列PLC工程實例詳解
- ZigBee無線通信技術(shù)應(yīng)用開發(fā)