- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 102字
- 2021-07-03 00:19:27
Creating a table
Let's create a table within our users keyspace to store personal information. You can create a table by issuing the following command:
CREATE TABLE "personal_info" (id int PRIMARY KEY, name text, dob text);
I will be omitting cqlsh> in the text from now on. You should always run the commands after entering cqlsh.
So we created the table personal_info with three columns: id , which is a unique integer identifier for a user which also happens to be the primary key for this table, name, and dob (date of birth) columns which are text values (strings).