Question
Please answer all the 3 parts of this question. Thank you. Part 1 E-R diagram that shows how these five tables should be related to
Please answer all the 3 parts of this question. Thank you.
Part 1 E-R diagram that shows how these five tables should be related to identifying the correct relationships (one-to-one, one-to-many, many-to-many) along with identifying the primary key and foreign key in each relationship.
Part 2 For each table, complete the table definition including the table name, field names with data type and size, primary key identification. Write the statements consistent with the MySQL syntax of creating a table with the necessary field definition. Note: In order to decide the appropriate data types and data size, review the file MovieDatabaseTableData.txt which is posted in the Modules section of Canvas. This is a critical part of the project because the accuracy of your query solutions will depend on the accuracy of your data definition. The raw data provided will not load correctly if your table properties are not defined correctly.
Part 3 (60% of the project grade) Write MySQL query statements for the questions below including the output that proves the accuracy of your solution. Your answers should be stored in a text file that captures your interaction with MySQL.
1. Find the movieID, title, year and DVDPrice of all movies where the DVD-Price is equal to the discountPrice.
2. Find the actorID, lastName, firstName, middleName, and suffix of all actors whose middleName is not NULL.
3. Suppose you remember a movie quote as Play it again, Sam. However, when you write a query to find this quote, you get no results. Write a query that will find the text of all movie quotes that begin with the word Play.
4. Suppose you remember the role of Joker in one of the Batman movies, but when you write a query to find this role, you get no results. Write a query that will find the roleID and roleName of any role where Joker appears as part of the role name.
5. Find the movieID, title, year, and totalNoms of all movies that were nominated for more than five Awards and were released before 1950.
6. Find the movieID, title, year, and awardsWon of all movies that either won more than five Awards or were released after 1990.
7. Find the movieID, title, year, and discountPrice of all movies with discount prices between $15.00 and $20.00 inclusive.
8. Find the movieID, title, and year of all movies, along with the difference between totalNoms and awardsWon. For the column heading of the calculated column, use nominated but not won.
9. Suppose you have a special membership at a store that qualifies you for 10% off all of your purchases, including discount prices. Find the movieID, title, and year of all movies, along with the discount price minus 10% of the discount price. For the column heading of the calculated column, use my price.
10. Find the gender and the count (of all rows of that gender) in the Actor table, grouped by gender.
11. Find the totalNoms and the maximum number of awardsWon in the Movie table, grouped by totalNoms and ordered by the maximum number of awardsWon.
12. Find the company, year, and sum of awardsWon for movies, grouped by company and year.
13. Find the actorID, lastName, firstName, middleName,suffix, and birthdate of rows in the Actor table where the gender is F. Order the results by the actors date of birth. 14. Find the movieID, title, year, DVDPrice, and half of the DVDPrice (the price for a half-off sale) of movies that have a DVDPrice of at least $20.00.
15. Find the sum of the discount prices of movies made after 1979.
16. Find the awards won and the average discount price of movies made before 1980, grouped by awards won.
17. Find the movieID, title, and year of movies, and the roleID and roleName of roles for the join of the Movie and Role tables where the gender of the role is female.
18. Find the roleID, quoteID, and quoteText in the join between the Quote andRoleQuote tables where the roleID is 00001 or 00003.
19. Find the movie title and the number of roleIDs associated with it. Group the result by movie title, having a count of six or more roles.
20. Find the maximum DVDPrice for a movie with a role played by actorID 00001.
The data and pictures are the same with this question: https://www.chegg.com/homework-help/questions-and-answers/problem-statement-asked-design-database-called-movies-keep-track-various-data-movies-actor-q30456418
Thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started