select sp.nm_pess,sp.nm_cpf_pess,pf.nm_progr_form,sv.NU_ANO_ADMIS,sti.ds_tp_ingrs, case sv.CD_TIPO_COTA when '0' then '0 - NAO_REDE_PUBLICA //Livre Concorrência// Sem Cota' when '3' then '3 - ESCOLA PÚBLICA + SOCIAL/RENDA + ÉTNICO' when '4' then '4 - ESCOLA PÚBLICA + SOCIAL/RENDA' when '5' then '5 - ESCOLA PÚBLICA + ÉTNICO' when '6' then '6 - ESCOLA PÚBLICA' when '7' then '7 - PESSOA COM DEFICIÊNCIA' when '8' then '8 - OUTROS' end as Tipo_Cota, case sp.NM_COR_RACA when '1' then '1 - Branca' when '2' then '2 - Preta' when '3' then '3 - Parda' when '4' then '4 - Amarela' when '5' then '5 - Indígena' when '6' then '6 - Não dispõe' when '7' then '7 - Não declarou' end as Cor_Raca, case sv.NM_ORIGEM_ENSINOMEDIO when '1' then '1 - Não informado/Não dispõe' when '2' then '2 - Privada' when '3' then '3 - Pública' end as Origem_Ensino_medio from siga_pessoa sp, siga_vinculo sv, siga_programa_formacao pf, siga_tipo_ingresso sti where sp.NM_CPF_PESS = sv.NM_CPF_PESS and sv.CD_PROGR_FORM = pf.CD_PROGR_FORM and sv.NU_ANO_ADMIS > 2012 and pf.CD_NIVEL = '1' -- Ano admissão a partir de 2013 dos cursos de graduacao presencial e a distancia and ((sv.CD_TIPO_COTA is null or sv.CD_TIPO_COTA = '') or (sp.NM_COR_RACA in ('6','7') or sp.NM_COR_RACA is null or sp.NM_COR_RACA = '') or (sv.NM_ORIGEM_ENSINOMEDIO is null or sv.NM_ORIGEM_ENSINOMEDIO = '' or sv.NM_ORIGEM_ENSINOMEDIO = '1')) and sti.CD_TP_INGRS = sv.CD_TP_INGRS order by sp.nm_pess;