I created database "Movies" with three column families:
CREATE TABLE movies (
movie_id int primary key,
title text,
avg_rating decimal,
total_ratings int,
genres set<text>
);
# shows all ratings for specific movie
CREATE TABLE ratings_by_movie (
movie_id int,
user_id int,
rating decimal,
ts int,
primary key(movie_id, user_id)
);
# show all ratings of specific user
CREATE TABLE ratings_by_user (
user_id int,
movie_id int,
rating decimal,
ts int,
primary key(user_id, movie_id)
);
Is it possible to make the following queries?
- Show the movie with the most reviews
- Show all movies with the average rating >= 4
- Show 100 best movies based on their ratings