Created
February 19, 2017 22:35
-
-
Save DorotejaMazej/a50ea8e7cc9c3252faaf853e41aa78e5 to your computer and use it in GitHub Desktop.
wd2_2-lesson
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT MAX(Invoice.Total) | |
| FROM Invoice; | |
| SELECT MIN(Invoice.Total) | |
| FROM Invoice; | |
| SELECT COUNT(Track.TrackId) | |
| FROM Track | |
| JOIN MediaType ON Track.MediaTypeId=MediaType.MediaTypeId | |
| WHERE MediaType.Name='Protected AAC audio file'; | |
| SELECT Artist.Name, COUNT(Album.ArtistId) AS NumberOfAlbums | |
| FROM Album | |
| INNER JOIN Artist ON Album.ArtistId=Artist.ArtistId | |
| GROUP BY Album.ArtistId | |
| ORDER BY count(Album.ArtistId) DESC; | |
| SELECT Genre.Name, COUNT(Track.GenreId)AS NumberOfSongs | |
| FROM Track | |
| INNER JOIN Genre ON Track.GenreId=Genre.GenreId | |
| GROUP BY Track.GenreId | |
| ORDER BY count(Track.GenreId) DESC; | |
| SELECT Customer.FirstName, Customer.LastName, Invoice.Total, | |
| MAX(Invoice.Total) | |
| FROM Invoice | |
| INNER JOIN Customer ON Invoice.CustomerId=Customer.CustomerId; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment