Evaluating bids

Obter Informações base Sql

Published on the September 11, 2017 in IT & Programming

About this project

Open

Este projeto divide-se em 2 partes.

1- Trazer informações referente ao Historico dos Alunos.
2- Trazer informações referentes as parcelas inadimplentes dos Alunos.


PARTE 1 -

Meu cenário é o seguinte, estou utilizando uma base que é um colégio, e preciso buscar informações referentes ao histórico de cada aluno durante os anos (2012, 2013, 2014, 2015, 2016). No entando meu select parece estar duplicando os campos e me trazendo um número gigantesco de registros mesmo eu utilizando a clausula DISTINCT. Cada aluno deve ter mais ou menos 100 registros por ano, com o select que fiz, um único aluno me trouxe 300.000 linhas.


Segue abaixo select em questão. Preciso de uma ajuda para aperfeiçoar o mesmo e me trazer as informações sem duplicá-las.

use (minha base)
select distinct tc.idcurso, TC.nomecurso,
      TS.idserie, TS.nomeserie,
      TP.siglaperiodo,
      TT.idturma,
      TA.idaluno, TA.nomealuno, TA.matricula,
      TEE.idestabelecimentoensino, TEE.nomeestabelecimento, TEE.cidade, TEE.Estado,
      TH.resultadofinal, TH.diasletivos, TH.observacao,
      TD.iddisciplina, TD.nomedisciplina, TD.CodigoAgrupamento, TD.TipoDisciplina,
      TFA.nota01,
      TD.ES_CargaHoraria, TD.NumeroOrdemHistorico
from Tbcurso as tc
inner join tbserie as ts
on ts.IdCurso = TC.Idcurso
inner join tbperiodo as tp
on tp.IdUnidade = TC.Idunidade
inner join tbturma as tt
on tp.IdPeriodo = TT.Idperiodo
inner join tbaluno as ta
on ta.IdUnidade = TP.Idunidade
inner join  tbhistorico as th
on th.IdAluno = TA.Idaluno
inner join tbestabelecimentoensino as tee
on tee.IdEstabelecimentoEnsino = TH.Idestabelecimentoensino
inner join tbfasenotaaluno as tfa
on tfa.IdAluno = TA.Idaluno
inner join tbdisciplina as td
on td.IdDisciplina = TFA.IdDisciplina
where TP.siglaperiodo = '2016'
order by TA.idaluno


PARTE 2 - Ainda sem inicio.

Desde já agradeço a atenção de todos.

Category IT & Programming
Subcategory Web development
What is the scope of the project? Medium-sized change
Is this a project or a position? Project
I currently have I have an idea
Required availability As needed
Experience in this type of projects No (I haven’t managed this kind of project before)
Roles needed Other
Other roles needed DBA - SQL SERVER

Delivery term: September 21, 2017