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 |
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 | |
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 | |
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 | |
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 | |
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 | |
Name, | |
substr(Name,1,1) AS [Index], | |
CASE WHEN Milliseconds > 360000 THEN '> 6min.' | |
WHEN Milliseconds > 300000 THEN '5-6 min.' | |
WHEN Milliseconds > 240000 THEN '4-5 min.' | |
ELSE 'kurz' | |
END AS Länge | |
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 | |
Name, | |
substr(Name,1,1) AS [Index], | |
CASE WHEN Milliseconds > 300000 THEN '> 5min.' END AS Länge1, | |
CASE WHEN Milliseconds > 300000 THEN '> 5min.' ELSE 'kurz' END AS Länge2 | |
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 DISTINCT | |
Composer | |
FROM Track | |
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 * | |
FROM Track | |
ORDER BY Composer DESC, Name; |
NewerOlder