Following is the list of queries for which the SQL statements need to be written
ID: 3807444 • Letter: F
Question
Following is the list of queries for which the SQL statements need to be written and submitted:
Q1: Retrieve all the video tapes that have been rented by the customers with ID 101 and 106.
Q2: Retrieve the names of all the movies rented by the customers whose ID is smaller than 200.
Q3: Retrieve the names of all the customers who live and Florida and have rented (or are currently renting) a movie whose genre is "romantic comedy".
Q4: Retrieve the average salary of the hourly employees working in the store located on Liberty Road.
Q5: Retrieve all the names of all the movies that are on a tape currently rented by a customer who lives in Florida.
Q6: How many copies (quantity) of the movie "Elizabeth" have been ordered?
Explanation / Answer
Following is the list of queries for which the SQL statements need to be written and submitted:
Q1: Retrieve all the video tapes that have been rented by the customers with ID 101 and 106.
Select video_tape from table name where cust_id=101 or cust_id=106
Q2: Retrieve the names of all the movies rented by the customers whose ID is smaller than 200.
Select movies from table name where cust_id<200.
Q3: Retrieve the names of all the customers who live and Florida and have rented (or are currently renting) a movie whose genre is "romantic comedy".
Select cust_name from table name where cust_place=’Florida’ and movie_genre=’ romantic comedy’
Q4: Retrieve the average salary of the hourly employees working in the store located on Liberty Road.
Select avg(salary) from table name where location=’ Liberty Road’
Q5: Retrieve all the names of all the movies that are on a tape currently rented by a customer who lives in Florida.
Select movies from table name where cust_place=’Florida’
Q6: How many copies (quantity) of the movie "Elizabeth" have been ordered?
Select count(Ordered_Copies) from table name where movie_name=’ Elizabeth’
Thank you.