Skip to content

Latest commit

 

History

History
64 lines (52 loc) · 1.93 KB

step2-cassandra.md

File metadata and controls

64 lines (52 loc) · 1.93 KB
Exercise 1.2: Basic CQL Fundamentals ℹ️ For technical support, please contact us via email.
⬅️ Back Step 2 of 4 Next ➡️
Create a keyspace and table in the CQL shell

✅ Start the CQL shell:

cqlsh

✅ Create a keyspace called killrvideo and switch to that keyspace. Use NetworkTopologyStrategy for the replication class and set the replication factor of 1 for datacenter DC-Houston. Remember the USE command switches keyspaces.

CREATE KEYSPACE IF NOT EXISTS killrvideo
WITH replication = {
  'class': 'NetworkTopologyStrategy', 
  'DC-Houston': 1 };

USE killrvideo;

✅ Create a single table called videos with the same structure as shown in the previous step. video_id is the primary key.

CREATE TABLE videos (
  video_id TIMEUUID,
  added_date TIMESTAMP,
  description TEXT,
  title TEXT,
  user_id UUID,
  PRIMARY KEY (video_id)
);
⬅️ Back Next ➡️