Question

I'm making a Report in SQL and need to add Release_Year which is in the Film...

I'm making a Report in SQL and need to add Release_Year which is in the Film table in this query, how can I do that? Thank You

Select Title, count(Rental_ID) as Rentals, (rental_rate*Count(rental_id)) As Revenue

From Film join Inventory on Film.Film_ID = Inventory.Film_ID join rental on

rental.inventory_id = inventory.inventory_id

Group By Title

Order By Revenue Desc

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Select Film.Title,Film.Release_Year, count(rental.Rental_ID) as Rentals, (rental.rental_rate*Count(rental.rental_id)) As Revenue
From Film join Inventory on Film.Film_ID = Inventory.Film_ID join rental on
rental.inventory_id = inventory.inventory_id
Group By Film.Title
Order By rental.Revenue Desc

/*Updated the query with proper table names. This should work without any errors*/

Let me know in case if you have any questions. Thanks and All the best.

Add a comment
Know the answer?
Add Answer to:
I'm making a Report in SQL and need to add Release_Year which is in the Film...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • SQL Queries – in this assignment you will be asked to create several SQL queries relating...

    SQL Queries – in this assignment you will be asked to create several SQL queries relating to the Sakila database that we installed in class. You may freely use DBeaver to create these queries, but I will expect your solution to show me the SQL code to answer or complete the tasks below. Write a query that produces the last name, first name, address, district, and phone number for every customer in the customer table. (You don’t need to include...

  • USING SQL 4. Show me the maximum rental duration and minimum rental duration from the film...

    USING SQL 4. Show me the maximum rental duration and minimum rental duration from the film table. Name the columns MaxRentalDuration and MinRentalDuration respectively. 5. List the actor ID, last name, and first name of each actor and the count of films (name column FilmCount) each is in for those actors who acted in more than 35 films. Order results by FilmCount. (Hint: You will need to use GROUP BY and HAVING in your query.)

  • In this assignment you will combine HTML, PHP, and SQL in order to create a web...

    In this assignment you will combine HTML, PHP, and SQL in order to create a web form that allows a manager to add films to the sakila database. You will also create a method to allow the manager to view a list of all films along with their related information, and a list of actors in the movies. Task 1 Create an initial HTML page titled manager.html with 2 buttons. The first button will be labeled “View Films”, and the...

  • Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName,...

    Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName, City ON Employees; O FIND EmployeeName, City ON Employees; SELECT EmployeeName, City FROM Employees; O RETRIEVE EmployeeName, City FROM Employees; Which SQL statement finds the different cities in which national parks reside with no duplicate rows listed? SELECT DISTINCT city FROM natlpark ORDER BY city; O ORDER BY natlpark DISTINCT city; O ORDER BY city FROM natlpark; O SELECT city FROM natlpark ORDER BY...

  • I need help with certain questions. Please. 18. 4 points For each Rental, list the Rental...

    I need help with certain questions. Please. 18. 4 points For each Rental, list the Rental ID, Rental date, customer ID, customer first name, customer last name, and count of disks rented; sort by Rental ID. Show the Rental date formatted as ‘mm-dd-yyyy.’ Hint: use a GROUP BY clause. 19. 4 points List the disk ID, title name, rating, format description, and fee amount for all copies rented in Rental 3; sort by disk ID. Show the fee amount formatted...

  • 2) What were the total rental fees for each member by member last name? (w3schools-> SQL...

    2) What were the total rental fees for each member by member last name? (w3schools-> SQL Inner Join& SQL Functions Count, Avg, Sum & SOL Group By)- this requires 2 joins 13) What were the total rental fees for members treport Mem num who total fees were greater than $5-change the output label to FeesMoreThan5S? (w3schools->SQL Inner Join & SQL Functions Count, Avg, Sum& SQL Group By & SQL Having) 14) What was the highest fee paid by each member...

  • MYSQL Applied Database I just want to make sure that the syntax looks okay for my...

    MYSQL Applied Database I just want to make sure that the syntax looks okay for my database SQL statements, any help would be much appreciated: 1.A query that asks for customer star review for Tony Stark on Opportunity Detail. SELECT CONCAT (employee_first_name,' ',employee_last_name) AS                            employee_name, review_star_count, FROM customer_reviews, JOIN e employees ON employee_id =employee_id, WHERE employee_id=4 AND opportunity_id=1; 2.A query that shows how many orders Additional Dot Twain License, in an order totaling over $900. SELECT product_name, COUNT(o.OrderID) AS...

  • Using SQL*Plus on OMEGA, access the tables you created in Project 2 and complete the following...

    Using SQL*Plus on OMEGA, access the tables you created in Project 2 and complete the following SQL transactions. Log your statements and results by spooling your file (with echo on). Directions for creating and running SQL files are available in the Assignments and Exams page in Blackboard (in the Project 2 group of files). All column headings must show in their entirety. Be sure to include a cover sheet with your full name, section, and date submitted. 19. 4 points...

  • Top of Form Q1 Which of the following is a valid aggregate function in SQL? Check...

    Top of Form Q1 Which of the following is a valid aggregate function in SQL? Check only those that apply. Question 1 options: AVG LEAST COUNT MIN MOST SUM Q2 Which of the following aggregate functions will only operate on a numeric value expression? Check only those that apply: Question 2 options: MIN MAX AVG COUNT SUM Q3 When applying DISTINCT to the value being calculated in an aggregate function like COUNT, what is the effect? SELECT COUNT(DISTINCT StreetName) FROM...

  • how can i add join sql table in order to get results. product_tble(product_id(pk),product_name,product_descrip) discount_tbl(discount_code,discount_amount) i want...

    how can i add join sql table in order to get results. product_tble(product_id(pk),product_name,product_descrip) discount_tbl(discount_code,discount_amount) i want show the subtotal after(product_price-discount_amount)

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT