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, 22.06.2019 00:40
Write a function 'music_func' that takes 3 parameters -- music type, music group, vocalist -- and prints them all out as shown in the example below. in case no input is provided by the user, the function should assume these values for the parameters: "classic rock", "the beatles", "freddie mercury". for example: input: alternative rock,pearl jam,chris cornell output: the best kind of music is alternative rock the best music group is pearl jam the best lead vocalist is chris cornell note: the print statements will go inside the for example: print("the best kind of music is"
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
What can you prevent issues related to downloading content form the internet
Answers: 1
question
Computers and Technology, 24.06.2019 10:40
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
5.a fishing rod is formed from a composite material of 0.5 kg of glass fibers embedded in a matrix of 0.5 kg of epoxy resin. the glass fibers are assumed to be long, continuous and unidirectional. to achieve a greater stiffness it is proposed to use a different composite that is comprised of long continuous carbon fibers that will be embedded in a matrix of 0.5 kg of epoxy resin. if the modulus of elasticity of the carbon fiber composite is 10% greater than the elastic modulus of the glass fiber composite, estimate the mass of carbon fibers that will be used to make the carbon fiber composite. assume the applied tensile stress is parallel to the direction of the long axis of the fibers. the epoxy resin, glass fiber, and carbon fiber have an elastic modulus of 5, 86, and 350 gpa respectively and a density of 1100, 2500, and 1800 respectively.
Answers: 3
You know the right answer?
Create 7 tables for the following parameters: A. users: userid (int, primary key), name (text)
Questions
Questions on the website: 13722363