Answered step by step
Verified Expert Solution
Question
1 Approved Answer
home work A new company is planning to build a new database system for holding information about movies, movies producers and renting movies. 'Producers', 'Movies'
home work
A new company is planning to build a new database system for holding information about movies, movies producers and renting movies. 'Producers', 'Movies' and 'Movies_Rental are part of the information that the new company wants to store in the new database. These tables are shown below in figure 1, figure 2 and figure 3. The new company intends to use MySQL for building the new database. Producer_ID Producer_Company Name Producer_Country 1111 ABC Egypt 5555 DEF Jordan 3333 GHI 2222 JKL Egypt Egypt Jordan Syria 8888 MNO 4444 POR Figure 1: Producers table Movie_ID Producer_ID Movie_Title Movie_Duration Movie_Rating 5858 8888 Easter lunch 50 min 3 Stars 5451 8888 A retired old man 40 min 4 Stars 5393 5555 Watchman 55 min 3 Stars 5156 2222 Wedding 35 min 2 Stars 5036 2222 90 min 5 Satrs A college student Great dreams 5747 3333 70 min 1 Satr 5987 4444 Mother's funeral 75 min 4 Stars 5869 5555 Aleppo 55 min 3 Stars Figure 2: Movies table M275-TMA Page -3 Spring 2020 2021 Movie_ID Customer_ID Date_Rented Due_Date 5451 101 13-May-20 5-Sep-20 5156 110 5393 350 11-May-20 1-Sep-20 4-Sep-20 11-Apr-20 8-May-20 23-Sep-20 5987 222 12-Apr-20 14-May-20 5869 118 Figure 3: Movies_Rental table Based on the above three tables, answer the following 6 questions: You need to provide for every SQL a screen shot that shows the implementation of the SQL and the result of that SQL. 1- Write an SQL statement for creating the Movies table that is shown in figure 1. No need to write any SQL statement for adding any record to the Movies table. [5 marks) 2- Write an SQL statement for adding one record to the Movies table that was created in question-1 above. The added record should be one of the records that are given in the Movies table. (5 marks) 3- Write an SQL statement to list the information of movies whose title either begin with the letter 'A' or end with the letter 'n' but not both. (5 marks) 4- Write an SQL statement to list all movie titles that not rented in 2020. [5 marks) 5- Write an SQL statement to list all movies title that not rented in 2020 along with their producers' company names. (5 marks] 6- Write an SQL statement to list Customer_ID, Movie_ID, Movie_Title, Date_Rented, and Due_Date for all customers who rented a movie in 2020. [5 marks) The EndStep 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