subject
Computers and Technology, 29.01.2021 16:40 leo4687

Create 7 tables for the following parameters: A. users: userid (int, primary key), name (text)
B. movies: movieid (integer, primary key), title (text)
C. taginfo: tagid (int, primary key), content (text)
D. genres: genreid (integer, primary key), name (text)
E. ratings: userid (int, foreign key), movieid (int, foreign key), rating (numeric), timestamp (bigint, seconds since midnight Coordinated Universal Time (UTC) of January 1, 1970)
F. tags: userid (int, foreign key), movieid (int, foreign key), tagid (int, foreign key), timestamp (bigint, seconds since midnight Coordinated Universal Time (UTC) of January 1, 1970).
G. hasagenre: movieid (int, foreign key), genreid (int, foreign key)
Now write queries for the following
Note: Do not put "create/select/drop database", or "set system settings or encoding"
1. Write a SQL query to return the total number of movies for each genre. Your query result should be saved in a table called "query1" which has two attributes: "name" attribute is a list of genres, and "moviecount" list of movie counts for each genre.
2. Write a SQL query to return the average rating per genre. Your query result should be saved in a table called "query2" which has two attributes: "name" attribute is a list of all genres, and "rating" attribute is a list of average rating per genre.
3. Write a SQL query to return the movies which have at least 10 ratings. Your query result should be saved in a table called "query3" which has two attributes: "title" is a list of movie titles, and "CountOfRatings" is a list of ratings.
4. Write a SQL query to return all "Comedy" movies, including movieid and title. Your query result should be saved in a table called "query4" which has two attributes: "movieid" is a list of movie ids, and "title" is a list of movie titles.
5. Write a SQL query to return the average rating per movie. Your query result should be saved in a table called "query5" which has two attributes: "title" is a list of movie titles, and "average" is a list of the average rating per movie.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 25.06.2019 07:50
The “tab” key can a. create extra cells in a word table *b. move from cell to cell in a word table c. move from the top of a column to the bottom of a column in a word table d. none of the above a. none of these answers are correct b. move from cell to cell in a word table c. move from the top of a column to the bottom of a column in a word table d. create extra cells in a word table
Answers: 2
You know the right answer?
Create 7 tables for the following parameters: A. users: userid (int, primary key), name (text)
Questions
question
Social Studies, 29.10.2020 19:10
question
English, 29.10.2020 19:10
Questions on the website: 13722363