Last active
August 29, 2015 14:02
-
-
Save joepreludian/ea37dc241747a971e37f to your computer and use it in GitHub Desktop.
Sql do aplicativo LUPANAR, desenvolvido em sala de aula para demonstracao da disciplina de banco de dados.
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 | |
t1.codprog, | |
t1.entradaprog, | |
t2.nomesuite, | |
coalesce((select | |
sum(t3.precoputa) | |
from | |
puta t3 | |
where | |
t3.codputa in ( | |
select | |
t4.puta_codputa | |
from | |
putaprograma t4 | |
where | |
t4.programa_codprograma = t1.codprog) | |
), 0) as total_putas | |
from | |
programa t1, suite t2 | |
where | |
t1.quarto_codquarto = t2.codsuite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment