Look In File Below
Getting Started
1. Download and unzip movies.zip from the blackboard.
2. Import into MysqL
2A. Under Server Administration on the Home window select the server instance you want to restore database to (Create New Server Instance if doing it first time).
2B. Click on Manage Import/Export
2C. Click on Data Import/Restore on the left side of the screen.
2D. Select Import from Self-Contained File radio button (right side of screen)
2E. Select the path of .sql
2F. Click Start Import button at the right bottom corner of window. (Note: It would take some time to import the file).
3. Now, you can use MYSQL Workbench to write queries.
Understanding
Notice that the movies table has an id column that uniquely identifies each movie, as well as columns for the title of a movie and the year in which the movie was released. The people table also has an id column, and also has columns for each person’s name and birth year.
Movie ratings, meanwhile, are stored in the ratings table. The first column in the table is movie_id: a foreign key that references the id of the movies table. The rest of the row contains data about the rating for each movie and the number of votes the movie has received on IMDb.
Finally, the stars and directors tables match people to the movies in which they acted or directed. (Only
principal
stars and directors are included.) Each table has just two columns: movie_id and person_id, which reference a specific movie and person, respectively.
The challenge ahead of you is to write SQL queries to answer a variety of different questions by selecting data from one or more of these tables.
Specification
For each of the following problems, you should write a single SQL query that outputs the results specified by each problem. Your response must take the form of a single SQL query, though you may nest other queries inside of your query. You should not assume anything about the ids of any particular movies or people: your queries should be accurate even if the id of any particular movie or person were different. Finally, each query should return only the data necessary to answer the question: if the problem only asks you to output the names of movies, for example, then your query should not also output the each movie’s release year.
You’re welcome to check your queries’ results against
IMDb
itself, but realize that ratings on the website might differ from those in the database, as more votes might have been cast since we downloaded the data!
· In 1.sql, write a SQL query to list the titles of all movies released in 2008.
. Your query should output a table with a single column for the title of each movie.
· In 2.sql, write a SQL query to determine the birth year of Emma Stone.
. Your query should output a table with a single column and a single row (plus optional header) containing Emma Stone’s birth year.
. You may assume that there is only one person in the database with the name Emma Stone.
· In 3.sql, write a SQL query to list the titles of all movies with a release date on or after 2018, in alphabetical order.
. Your query should output a table with a single column for the title of each movie.
. Movies released in 2018 should be included, as should movies with release dates in the future.
· In 4.sql, write a SQL query to list the titles and release years of all Harry Potter movies, in chronological order.
. Your query should output a table with two columns, one for the title of each movie and one for the release year of each movie.
. You may assume that the title of all Harry Potter movies will begin with the words “Harry Potter”, and that if a movie title begins with the words “Harry Potter”, it is a Harry Potter movie.
· In 5.sql, write a SQL query to determine the number of movies with an IMDb rating of 10.0.
. Your query should output a table with a single column and a single row (plus optional header) containing the number of movies with a 10.0 rating.
· In 6.sql, write a SQL query to determine the average rating of all movies released in 2012.
. Your query should output a table with a single column and a single row (plus optional header) containing the average rating.
· In 7.sql, write a SQL query to list all movies released in 2010 and their ratings, in descending order by rating. For movies with the same rating, order them alphabetically by title.
. Your query should output a table with two columns, one for the title of each movie and one for the rating of each movie.
. Movies that do not have ratings should not be included in the result.
· In 8.sql, write a SQL query to list the names of all people who starred in Toy Story.
. Your query should output a table with a single column for the name of each person.
. You may assume that there is only one movie in the database with the title Toy Story.
· In 9.sql, write a SQL query to list the names of all people who starred in a movie released in 2004, ordered by birth year.
. Your query should output a table with a single column for the name of each person.
. People with the same birth year may be listed in any order.
. No need to worry about people who have no birth year listed, so long as those who do have a birth year are listed in order.
. If a person appeared in more than one movie in 2004, they should only appear in your results once.
· In 10.sql, write a SQL query to list the names of all people who have directed a movie that received a rating of at least 9.0.
. Your query should output a table with a single column for the name of each person.
· In 11.sql, write a SQL query to list the titles of the five highest rated movies (in order) that Chadwick Boseman starred in, starting with the highest rated.
. Your query should output a table with a single column for the title of each movie.
. You may assume that there is only one person in the database with the name Chadwick Boseman.
· In 12.sql, write a SQL query to list the titles of all movies in which both Johnny Depp and Helena Bonham Carter starred.
. Your query should output a table with a single column for the title of each movie.
. You may assume that there is only one person in the database with the name Johnny Depp.
. You may assume that there is only one person in the database with the name Helena Bonham Carter.
· In 13.sql, write a SQL query to list the names of all people who starred in a movie in which Kevin Bacon also starred.
. Your query should output a table with a single column for the name of each person.
. There may be multiple people named Kevin Bacon in the database. Be sure to only select the Kevin Bacon born in 1958.
. Kevin Bacon himself should not be included in the resulting list.
We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.
Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.
Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.
Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.
Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.
Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.
We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.
Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.
You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.
Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.
Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.
You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.
You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.
Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.
We create perfect papers according to the guidelines.
We seamlessly edit out errors from your papers.
We thoroughly read your final draft to identify errors.
Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!
Dedication. Quality. Commitment. Punctuality
Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.
We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.
We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.
We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.
We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.