subject

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 followingNote: 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.6. Write a SQL query to return the average rating for all "Comedy" movies. Your query result should be saved in a table called "query6" which has one attribute: "average".7. Write a SQL query to return the average rating for all movies and each of these movies is both "Comedy" and "Romance". Your query result should be saved in a table called "query7" which has one attribute: "average".8. Write a SQL query to return the average rating for all movies and each of these movies is "Romance" but not "Comedy". Your query result should be saved in a table called "query8" which has one attribute: "average".9. Find all movies that are rated by a user such that the userId is equal to v1. The v1 will be an integer parameter passed to the SQL query. Your query result should be saved in a table called "query9" which has two attributes: "movieid" is a list of movieid’s rated by userId v1, and "rating" is a list of ratings given by userId v1 for corresponding movieid.10. Write an SQL query to create a recommendation table* for a given user. Given a userID v1, you need to recommend the movies according to the movies he has rated before. In particular, you need to predict the rating P of a movie "i" that the user "Ua" didn’t rate. In the following recommendation model, P(Ua, i) is the predicted rating of movie i for User Ua. L contains all movies that have been rated by Ua. Sim(i, l) is the similarity between i and l. r is the rating that Ua gave to l.11. Your SQL query should return predicted ratings from all movies that the given user hasn’t rated yet. You only return the movies whose predicted ratings are >3.9. Your query result should be saved in a table called "recommendation" which has one attribute: "title".12. In order to produce the recommendation table, you first need to calculate the similarities between every pair of two movies. The similarity is equal to the similarity of the average ratings of two movies (average rating over all users, the average ratings in Query 5). That means, if the average ratings of two movies are more close, the two movies are more similar. The similarity score is a fractional value E [0, 1]. 0 means not similar at all, 1 means very similar.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
We as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in a computer’s language, however, it is preferred to have the operators on the right side of the operands, i.e. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix.write a program that takes an “infix” expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % (example infix expression: (7 - 3) / (2 + 2)postfix expression: 7 3 - 2 2 + /result: 1guidelines: 1. you will need to use stacks in three placesa. one for the parenthesis check [char stack]b. one during infix to postfix [char stack]c. one during evaluation [int stack]for a and b above, you can use same array and same push, pop method as both ofthem are char. but for evaluation you have int stack and you might consider to createanother push pop method to handle it. maybe push_int, pop_int, etc. or find otherstrategy to utilize existing push pop method2. you can create a function for obtaining operator priority. that function should take anoperator as input and return its priority as an integer. this function will you a lot andreduce repeated code3. during evaluation you will need to convert char into integer. example for single digit: char c = '5'; int x = c - '0';
Answers: 2
question
Computers and Technology, 22.06.2019 22:00
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
Read this excerpt from helen keller’s autobiography, the story of my life. have you ever been at sea in a dense fog, when it seemed as if a tangible white darkness shut you in, and the great ship, tense and anxious, groped her way toward the shore with plummet and sounding-line, and you waited with beating heart for something to happen? i was like that ship before my education began, only i was without compass or sounding-line, and had no way of knowing how near the harbour was. "light! give me light! " was the wordless cry of my soul, and the light of love shone on me in that very hour. . the morning after my teacher came she led me into her room and gave me a doll. the little blind children at the perkins institution had sent it and laura bridgman had dressed it; but i did not know this until afterward. when i had played with it a little while, miss sullivan slowly spelled into my hand the word "d-o-l-l." i was at once interested in this finger play and tried to imitate it. when i finally succeeded in making the letters correctly i was flushed with childish pleasure and pride. running downstairs to my mother i held up my hand and made the letters for doll. i did not know that i was spelling a word or even that words existed; i was simply making my fingers go in monkey-like imitation. in the days that followed i learned to spell in this uncomprehending way a great many words, among them pin, hat, cup and a few verbs like sit, stand and walk. based on this excerpt, which words best describe helen keller?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
[java] create an application called registrar that has the following classes: a. a student class that minimally stores the following data fields for a student: - name - student id number - number of credits - total grade points earned and this class should also be provides the following methods: - a constructor that initializes the name and id fields - a method that returns the student name field - a method that returns the student id field - methods to set and retrieve the total number of credits - methods to set and retrieve the total number of grade points earned. - a method that returns the gpa (grade points divided by credits) b. an instructor class that minimally stores the following data fields for an instructor: - name - faculty id number - department the following methods should be provided: - a constructor that initializes the name and id fields - methods to set and retrieve the instructor’s department. c. a course class that minimally stores the following data for a course: - name of the course- course registration code- maximum number of 35 students- instructor- number of students- students registered in the course (an array)the following methods should also be provided: - a constructor that initializes the name, registration code, and maximum number of students- methods to set and retrieve the instructor- a method to search for a student in the course; the search should be based on an id number.- a method to add a student to the course. if the course is hill, then an exception with an appropriate message should be raised (try creating your own exception class for this). also, be sure that the student is not already registered in the course. the list of students should be in the order that they registered.- a method to remove a student from the course. if the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned a method that will allow course objects to be output to a file using object serialization- a method that will allow course objects to be read in from a file created with object serializationyou will note that the student and instructor classes described above have some commonality. create aperson class that captures this commonality and uses it as a base class for student and instructor. this class should be responsible for the name and id fields and also provide atostring method that returns a string of the form name, id. this will be the inheritedtostring method for the student and instructor classes.1. draw a uml diagram for diss application.2. implement the previous classes in java. write a main program that can serve as a test class that tests all of the methods created and demonstrates that they are working
Answers: 2
You know the right answer?
Create 7 tables for the following parameters:A. users: userid (int, primary key), name (text)B. movi...
Questions
question
Biology, 02.12.2020 01:00
question
English, 02.12.2020 01:00
question
Mathematics, 02.12.2020 01:00
question
Mathematics, 02.12.2020 01:00
question
Mathematics, 02.12.2020 01:00
Questions on the website: 13722361