Skip to content

Latest commit

 

History

History
75 lines (69 loc) · 1.89 KB

step2.md

File metadata and controls

75 lines (69 loc) · 1.89 KB
Nodetool ℹ️ For technical support, please contact us via email.
⬅️ Back Next ➡️ Step 2 of 3
Create the killrvideo keyspace and the videos table

✅ Start cqlsh

./cqlsh

✅ Create the killrvideo keyspace:

CREATE KEYSPACE IF NOT EXISTS killrvideo
WITH replication = {
  'class':'SimpleStrategy', 
  'replication_factor': 1
};

✅ Use the keyspace:

use killrvideo;

✅ Create the videos table:

CREATE TABLE IF NOT EXISTS videos (
  video_id TIMEUUID,
  added_date TIMESTAMP,
  title TEXT,
  PRIMARY KEY (video_id)
);

✅ Populate the videos table:

COPY videos(video_id, added_date, title)
FROM '/workspace/ds201-lab06/data-files/videos.csv'
WITH HEADER=TRUE;

✅ Verify that the data was loaded:

SELECT * from videos;

You should see that six rows have been added to the table.

✅ Exit cqlsh:

exit
⬅️ Back Next ➡️