Question

I am having trouble writing these queries in MYSQL. Using the schema listed below, please write...

I am having trouble writing these queries in MYSQL. Using the schema listed below, please write the following queries in MYSQL:

1) Find all the Comments created by “Mike_34” with a score bigger than 80

2) Find the Film title from all the movies with an actor with first name “TOM”.

3) Find the full name of all the actors in the movies with at least a comment with a score equal to 100.

Schema:

Consider a movie relational database schema description provided below which is used to manage a movie database, where:

A movie can have 0 or more actors

A movie can have 1 or more categories

A movie has 1 and only one language

Rating is one of these values: 'G','PG','PG-13','R','NC-17'

People can comment about the movies on a webpage, and the comments are stored in the comments table. The reviewer_name is introduced by the person on each comment, so we don't have a table with “reviewers”. A reviewer can create any number of comments about a movie. The comments will have a score about the movie with values from 0 to 100.

Note, the last update fields are going to be stored as a “timestamp”.

IMPORTANT: 2 entries in the same relation can have the same lastupdate, so, for example, 2 movies can have the same lastupdate value.

The relations are:

ACTOR (actor_id, first_name, last_name, last_update)

LANGUAGE (language_id, name, last_update)

CATEGORY (category_id, name, last_update)

FILM (film_id, title, description, release_year, language_id, length, rating, last_update)

FILM_ACTOR(actor_id, film_id, last_update)

FILM_CATEGORY (film_id, category_id, last_update)

COMMENTS (review_id, film_id, reviewer_name, comment, score, last_update)

Homework Answers

Answer #1

Following are the queries in MSQL for the given questions.

1. SELECT comment from COMMENTS where reviewer_name = ‘Mike_34’ AND score > 80;

2. SELECT FILM.title from FILM INNER JOIN ON FILM.film_id = FILM_ACTOR.film_id INNER JOIN FILM_ACTOR.actor_id = ACTOR.actor_id where ACTOR.first_name = ‘TOM’

3. SELECT CONCAT(ACTOR.first_name, ‘ ’, ACTOR.last_name) FROM ACTOR INNER JOIN COMMENTS.film_id = FILM_ACTOR.film_id INNER JOIN FILM_ACTOR.actor_id = ACTOR.actor_id where COMMENTS.score = 100

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write the following queries in MYSQL: 1) Find the actors that have movies in all the categories. 2) Movies have a length in minutes. Show a list with all the lengths ordered from shorter to longer, and the number of movies for each of the lengths. 3) Show the 10 first results with the first name, last name and average length of the movies for...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write...
I am having trouble writing these queries in MYSQL. Using the schema listed below, please write the following queries in MYSQL: 1) Find the actors that have movies in all the categories. 2) Movies have a length in minutes. Show a list with all the lengths ordered from shorter to longer, and the number of movies for each of the lengths. 3) Show the 10 first results with the first name, last name and average length of the movies for...
Write the following questions as queries in SQL. Use only the operators discussed in class (in...
Write the following questions as queries in SQL. Use only the operators discussed in class (in particular, no outer joins or windows). Type your answers. Before starting, make sure you understand the schema of the database. If you are in doubt about it, please ask the instructor. Assume a database with schema ACTOR(name,age,address,nationality) MOVIE(title,year,genre,budget,director-name,studio) APPEARS(name,title,salary) 1. Find the title, director and studio of the most expensive movie of 2010 (note: there can be ties!). 2. Find the title, director and...
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the...
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the below Relational Database. • Regarding the SQL queries: • Do not use SELECT * in any query. • Do not use any SQL features (including Nullif) that were not covered in this course. • Do not use subqueries IF joins can be used to answer a question. However, some questions may require the use of subqueries. The Movie Database Notes: TheaterNum, MovieNum, and ActorNum...
The following describes the Universe of Discourse for the assignment: With the current popularity of video...
The following describes the Universe of Discourse for the assignment: With the current popularity of video streaming services like ‘Netflix’ and ‘Amazon Prime’, you have been tasked with creating a database for a new up-and-coming streaming service called ‘Home Cinema’. Each product on the site is classified as either a movie or TV show. For each product, the site stores it’s title, a unique code, a brief synopsis and a collection of tags related to it (Action, Adventure, Romance, etc.)....
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first...
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in...
#########################PANDAS LANGUAGE################## #########################MATPLOT LIB######################### # filter the movies with specific actor's name ​# List of top...
#########################PANDAS LANGUAGE################## #########################MATPLOT LIB######################### # filter the movies with specific actor's name ​# List of top 5 Actor per year who has highest rating from the year 2010 - 2017 ​# plot horizontal barcahrt of upper output # visualize those to 10 runtime of movies ​# visualize those to 10 runtime which has highest rating of movies ​# show count all movies which has rating more 3.0 and less than 7.0​ # plot vertical barchart of upper output, movies w.r.t...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT