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
| --trecho para tratamento de dados do empregado matr=725, que não consta na tabela EMP_VENC | |
| --tratamento baseado na media aproximada dos salarios totais dos empregados da mesma lotacao | |
| INSERT INTO emp_venc | |
| (cod_venc, matr) | |
| VALUES | |
| (1, 725), | |
| (12, 725); | |
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
| --A) | |
| select | |
| sh.name as nome_escola, | |
| s.enrolled_at dia, | |
| count(*) as qtde_alunos, | |
| sum(c.price) as valor_total | |
| from students s | |
| join courses c on s.course_id::integer = c.id | |
| join schools sh on c.school_id::integer = sh.id |