This file contains 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 | |
avg(Milliseconds)/60000 AS MW | |
FROM Track; |
This file contains 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 | |
Composer, | |
count(TrackId) as Anzahl, | |
avg(Milliseconds)/60000 as MW, | |
min(Milliseconds)/60000 as Minimum, | |
max(Milliseconds)/60000 as Maximum | |
FROM Track | |
GROUP BY Composer | |
ORDER BY Composer; |
This file contains 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 | |
substr(Name,1,1) as [Index], | |
count(TrackId) AS Anzahl, | |
avg(Milliseconds)/600000 as MW | |
FROM Track | |
WHERE substr(Name,1,1) in ('A','E','I','O','U') | |
GROUP BY substr(Name,1,1) | |
HAVING count(TrackId) > 50 | |
ORDER BY substr(Name,1,1); |
This file contains 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 | |
TrackId, | |
Name AS Trackname, | |
Track.AlbumId, | |
Title AS Albumname | |
FROM Track | |
INNER JOIN Album ON Track.AlbumId=Album.AlbumId; |
This file contains 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 | |
InvoiceId, | |
c.Name as Genre, | |
count(a.TrackId) AS AnzahlProKauf | |
FROM InvoiceLine a | |
INNER JOIN Track b on a.TrackId=b.TrackId | |
LEFT JOIN Genre c on b.GenreId=c.GenreId | |
GROUP BY InvoiceId, b.GenreId; |
This file contains 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 | |
Genre, | |
count(InvoiceId) AS Anzahl, | |
avg(AnzahlProKauf) AS MWAnzahlProKauf | |
FROM ( | |
SELECT | |
InvoiceId, | |
c.Name AS Genre, | |
count(a.TrackId) AS AnzahlProKauf | |
FROM InvoiceLine a |
OlderNewer