From 92a93902e9f01b4cab0263f1f57d052fdef060cc Mon Sep 17 00:00:00 2001
From: ppc19 <ppc19@inf.ufpr.br>
Date: Mon, 6 Dec 2021 10:48:15 -0300
Subject: [PATCH] create curso_ens_superior_count.sql

---
 curso_ens_superior_count.sql | 41 ++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 curso_ens_superior_count.sql

diff --git a/curso_ens_superior_count.sql b/curso_ens_superior_count.sql
new file mode 100644
index 0000000..6abbf56
--- /dev/null
+++ b/curso_ens_superior_count.sql
@@ -0,0 +1,41 @@
+/*
+Copyright (C) 2021 Centro de Computacao Cientifica e Software Livre
+Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
+
+This file is part of HOTMapper.
+
+HOTMapper is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License AS published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+HOTMapper is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with HOTMapper.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+-- depends: curso_ens_superior, localoferta_ens_superior
+
+CREATE TABLE curso_ens_superior_count
+AS 
+SELECT
+    DISTINCT(localoferta_ens_superior.cod_curso) AS "cod_curso",
+    localoferta_ens_superior.cod_municipio AS "cod_municipio",
+    curso_ens_superior.ano_censo  AS "ano_censo",
+    curso_ens_superior.nome_curso AS "nome_curso",
+    curso_ens_superior.cod_grau_academico AS "cod_grau_academico"
+FROM 
+  curso_ens_superior
+INNER JOIN localoferta_ens_superior ON
+    (curso_ens_superior.ano_censo=localoferta_ens_superior.ano_censo AND
+    curso_ens_superior.cod_curso=localoferta_ens_superior.cod_curso)
+GROUP BY
+    localoferta_ens_superior.cod_curso,
+    localoferta_ens_superior.cod_municipio,
+    curso_ens_superior.ano_censo,
+    curso_ens_superior.nome_curso,
+    curso_ens_superior.cod_grau_academico;
-- 
GitLab