What You’ll Learn: Building on the previous lesson where you were able to create a table, this unit will go into more detail on CQL, where you will execute commands to INSERT data into your created tables as well as run SELECT statements to query your table.



CQL has many commands. Let’s insert some rows of data into our newly created ‘users’ table with an INSERT INTO command.


  • Type ENTER after each statement to insert the row into the table:

  • Now that we have a few rows of data in our table, let’s perform some queries against it. Using a SELECT statement will let us take a peek inside our table. To see all the rows from the users table we’ve created, type:


You should see:



Cassandra allows you to look up rows by their primary key. Remember we set the the last name as the row key, or primary key in CQL terms. Primary key determines where the row is located on disk. When we use a WHERE clause with a SELECT statement, we can query the table by row key.


  • Get the user record for the individual with the last name “Doe”.