Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the Chinook database to write your SQL queries. Add comments or aliases whenever necessary. Don't forget to test your queries to verify their correctness.

Use the Chinook database to write your SQL queries.
Add comments or aliases whenever necessary.
Don't forget to test your queries to verify their correctness.
Copy and paste your queries under each question.
Each question: 15 pts (if you have them all right, there are 105 points to earn)
Display the country and the average total amount spent by customers from that country. Only include countries with an average total amount greater than $20.
Find the customers who have made the highest number of purchases. Display their first and last names along with the number of purchases.
Retrieve the track names, composers, and durations of tracks that have a duration between 180 and 240 seconds (inclusive).
Find the genres where the total number of tracks is greater than 20. Display the genre and the total number of tracks. Order the result by the total number of tracks in descending order.
Retrieve the track names and composers of tracks that belong to either the 'Rock' or 'Pop' genres.
Display the customer ID, first name, last name, and the total number of purchases made by each customer. Order the result by the total number of purchases in descending order.
List the top 5 artists with the most tracks. Display the artist name along with the number of tracks.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

What are three forms of deceptive advertising?

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago