How about,
My question is, I have several tables, which I show below where I highlight the relevant data for the query.
I want to ask a question, where do I get the number of students per semester of each Program. Something like this:
I have a consulate that gives me in which semester each student goes:
SELECT idProgram, MAX(Semestre) FROM Alumno,
Materia a INNER JOIN Historial n ON a.idMateria = n.claveMateria
GROUP BY idAlum;
Which is wrong, because it puts me only one program instead of the respective one of each student.
I have other queries that give me indicators by career, however the advantage of them is that the data is in a single table (Student):
SELECT c.idPrograma as Licenciatura, sum(field(a.Estado_Alu,'CURSANDO')) as
CURSANDO, sum(field(a.Estado_Alu,'BAJA TEMPORAL')) as BAJA_TEMPORAL,
sum(field(a.Estado_Alu,'BAJA ABSOLUTA')) as BAJA_ABSOLUTA,
sum(field(a.Estado_Alu,'EGRESADO')) as EGRESADO,
sum(field(a.Estado_Alu,'INTERCAMBIO')) as INTERCAMBIO,
count(a.idAlumno) as Total
FROM alumno a
join Programa c on a.idProgram=c.idPrograma
group by a.idProgram;
Which returns this table to me:
Thank you in advance for your support.