Skip to content

Latest commit

 

History

History
63 lines (51 loc) · 1.94 KB

File metadata and controls

63 lines (51 loc) · 1.94 KB
Inserts, Updates, Deletes and Upserts in Apache Cassandra® ℹ️ For technical support, please contact us via email or LinkedIn.
⬅️ Back Step 5 of 9 Next ➡️
Updating rows

✅ We need to update information about the following user and his ratings:

SELECT * FROM users WHERE email = 'joe@datastax.com';
SELECT * FROM ratings_by_user WHERE email = 'joe@datastax.com';

✅ Update the user name and age:

UPDATE users SET name = 'Joseph', age = 26
WHERE email = 'joe@datastax.com';

SELECT * FROM users WHERE email = 'joe@datastax.com';

✅ Change the rating left by the user for one of the movies:

Solution
UPDATE ratings_by_user SET rating = 3 
WHERE email = 'joe@datastax.com'
  AND title = 'Alice in Wonderland'
  AND year  = 2010;

SELECT * FROM ratings_by_user WHERE email = 'joe@datastax.com';
⬅️ Back Next ➡️