Last active
August 2, 2017 12:49
-
-
Save ciceroverneck/9fd2605ed831cb9013a3764b163f9d7e to your computer and use it in GitHub Desktop.
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
-- Quantidade de músicas c/ Letras (todos) | |
SELECT COUNT(*) | |
FROM mp3 | |
INNER JOIN artistas as a ON (a.id = mp3.id_artista) | |
WHERE a.ativo = 1 | |
AND mp3.id_letras IS NOT NULL OR (mp3.letra IS NOT NULL and mp3.letra != ""); | |
-- Quantidade de músicas c/ Clipes (todos) | |
SELECT COUNT(*) | |
FROM mp3 | |
INNER JOIN artistas as a ON (a.id = mp3.id_artista) | |
WHERE a.ativo = 1 | |
AND mp3.id_video IS NOT NULL | |
-- Quantidade de músicas c/ Cifra (todos) | |
SELECT COUNT(*) | |
FROM mp3 | |
INNER JOIN artistas as a ON (a.id = mp3.id_artista) | |
WHERE a.ativo = 1 | |
AND mp3.id_cifra IS NOT NULL | |
-- Quantidade de músicas p/ Downloads (todos) | |
SELECT COUNT(*), mp3.proibir_download | |
FROM mp3 | |
INNER JOIN artistas as a ON (a.id = mp3.id_artista) | |
WHERE a.ativo = 1 | |
GROUP BY mp3.proibir_download | |
-- Quantidade de álbuns (todos) | |
SELECT COUNT(*) | |
FROM artistas as a | |
INNER JOIN discografias as d ON (d.id_artista = a.id) | |
WHERE a.ativo = 1 | |
-- Quantidade de releases preenchidos (todos) | |
SELECT COUNT(*) | |
FROM artistas as a | |
WHERE a.ativo = 1 and (a.release_txt IS NOT NULL OR a.release_txt != "") | |
-- Artista com <10 fotos | |
SELECT COUNT(*) | |
FROM artistas as a | |
INNER JOIN fotos f ON (f.id_artista = a.id) | |
WHERE a.ativo = 1 | |
GROUP BY a.id | |
HAVING COUNT(*) < 10 | |
-- Artista com >=10 and <30 fotos | |
SELECT COUNT(*) | |
FROM artistas as a | |
INNER JOIN fotos f ON (f.id_artista = a.id) | |
WHERE a.ativo = 1 | |
GROUP BY a.id | |
HAVING COUNT(*) >= 10 AND COUNT(*) < 30 | |
-- Artista com >=10 and <30 fotos | |
SELECT COUNT(*) | |
FROM artistas as a | |
INNER JOIN fotos f ON (f.id_artista = a.id) | |
WHERE a.ativo = 1 | |
GROUP BY a.id | |
HAVING COUNT(*) >= 30 AND COUNT(*) < 50 | |
-- Quantidade média de shows cadastrados (todos) | |
SELECT AVG(v.a) | |
FROM ( | |
SELECT COUNT(*) as a | |
FROM artistas as a | |
LEFT JOIN agenda ag ON (ag.id_artista = a.id) | |
WHERE a.ativo = 1 | |
GROUP BY a.id | |
) as v | |
-- Suspensão do Palco MP3 feita pelo próprio artista/banda | |
SELECT COUNT(*) | |
FROM artistas as a | |
WHERE a.ativo = -1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment