Question

Hi i need Help. i use MYSQL command line.

Artist << Track सा --00 9-001 3 Artistid Name 5. Album Albumid Title Artistid MediaType A 100-MediaTypeid Name Genre TrackId

THE QUESTION ARE BELOW

please check the answer before you submit because sometimes query gives error thank you

For Full database of SQL you can DOWNLOAD from this link:

https://drive.google.com/file/d/1xh1TcBfMtvKoxvJr7Csgnts68fF53Q1t/view?usp=sharing

-------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

What are the total sales for each year. Note that you will need to use the YEAR function. Order by year with the newest year first.

+-- --+ | Year | Total Sales | -+-- 2013 450.58 | | 2012 477.53 | 2011 469.58 | 2010 481.45 | 2009 | 449.46 -+-- 5 rows in se

-------------------------------------------------------

How many employees have no customers?

+ - + | There are 5 employees that have no customers. +- -+ 1 row in set, 1 warning (0.00 sec)

------------------------------------------------------------------

List the total sales for each genre. Display the genre with the most sales first and the genre's in alphabetical order.

| Genre | Total Sales | | Rock Latin Metal Alternative & Punk | TV Shows Jazz Blues | Drama Classical R&B/Soul Sci Fi & Fanta

-------------------------------------------------------------------------------------

Which artist has generated the most sales in dollars? You CANNOT use the LIMIT keyword.

| Artist | Total Sales | | Iron Maiden | 138.60 | + 1 row in set (0.01 sec)

----------------------------------------------------------------------

List the playlist with the most tracks (songs) including how many tracks are included in the playlist. You CANNOT use the LIMIT keyword.

-+ | Playlist | # of songs in playlist - + | My Music | 3290 - + 1 row in set (0.01 sec)

------------------------------------------------------------------------------------------

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

Query 1

Select Year(InvoiceDate) as Year,sum(total) as "Total Sales" from Invoice group by Year(InvoiceDate) Order by Year(InvoiceDate) desc;

Showing rows 0 - 4 (5 total, Query took 0.0028 seconds.) Select Year(InvoiceDate) as Year, sum(total) as Total Sales from I

Query 2:

Select EmployeeId,LastName,FirstName from Employee where EmployeeId not in(Select SupportRepId from Customer);

Server 127.0.0.1 >> Database: cd > Table Employee Browse Structure L SQL Search * Insert Export Import 3 Privileges Operation

Query 3:
Select Genre.Name as Genre,sum(UnitPrice) as "Total Sales" from Genre inner join Track on Genre.GenreId=Track.GenreId group by Genre.Name order by sum(UnitPrice) desc;

Showing rows 0 - 24 (25 total, Query took 0.0076 seconds.) Select Genre.Name as Genre, sum(UnitPrice) as Total Sales from G

Query 4:


Select Artist.name as "Artist Name",sum(UnitPrice) as "Total Sale" from Track Inner join Album on Track.AlbumId=Album.AlbumId inner join Artist on Artist.ArtistID=Album.ArtistID group by Artist.Name order by sum(UnitPrice) desc limit 1;

phpMyAdmin Server: 127.0.0.1 >> Database: cd >> Table Artist Browse Structure SQL Search * Insert Export Import Privileges Op

if you still have any Problem regarding this question please comment and if you like my code please appreciate me by thumbs up thank you.........


Add a comment
Know the answer?
Add Answer to:
Hi i need Help. i use MYSQL command line. THE QUESTION ARE BELOW please check the...
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
  • The Chinook team would like to throw a promotional Music Festival for their top 10 customers...

    The Chinook team would like to throw a promotional Music Festival for their top 10 customers who have spent the most in a single invoice. Write a query that returns the first name, last name, and invoice total for the top 10 invoices ordered by invoice total descending. MediaType Artist Album Track Artistld Albumld MediaTypeld Trackld Title Name Name Name Artistld Albumld MediaTypeld Genreld Composer Genre Playlist Track Playlist Milliseconds Genreld Playlistld Playlistld Name Bytes Name Trackld UnitPrice InvoiceLine Employee...

  • Write an SQL query against the Chinook Database v1.4. Each query must run successfully using DB...

    Write an SQL query against the Chinook Database v1.4. Each query must run successfully using DB Browser for SQLite. Create the exact query below. Must use sub query. I saw that a similar solution for this question used IF and CONCAT functions which do not work and return errors. If it is possible to use the CASE function in place of IF that would be greatly appreciated. Also I really hate to ask but if it could be organized neatly...

  • Using the database: Write SQL queries for each of the questions below. 1. Find the media...

    Using the database: Write SQL queries for each of the questions below. 1. Find the media type which has 100 or more tracks. Print the name of such media type. Number of rows returned in the result = 3 A) Find the playlists which have one or more tracks that have never been purchased in California (CA). Print the Id, and the name of such playlists. Number of rows returned in the result = 18 B) Find the customers who...

  • I need help in SQL management studio please. Question: Create the same query as query 5,...

    I need help in SQL management studio please. Question: Create the same query as query 5, but only include artists if they have 'Pop' Genre. Previous question: Create a list of all composers and artists in your database. Include two columns in your record set (the names of the returned columns are in brackets): 'Composer/Artist Name' and 'Type' (which will indicate whether your results are from the composer or artist table). Order by 'Composer/Artist Name'. This is the answer for...

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
ADVERTISEMENT