I have the following table:
CREATE TABLE ALUNO (
RA NUMBER(9),
DISCIPLINA VARCHAR2(30),
MEDIA NUMBER(3,1),
CARGA_HORA NUMBER(2),
FALTAS NUMBER(2),
RESULTADO VARCHAR2(10)
);
And the following data:
INSERT INTO ALUNO VALUES (1,'SQL',7.5,80,20,'');
INSERT INTO ALUNO VALUES (2,'PLSQL',5.5,80,20,'');
INSERT INTO ALUNO VALUES (3,'MBD',7.5,80,40,'');
I have the following sql:
select ra,
Disciplina,
Media,
Carga_Hora,
Faltas,
case when (Media >= 7) and (trunc((Faltas / Carga_Hora * 100)) <= 25) then 'APROVADO'
when (Media between 5 and 6.9) and (trunc((Faltas / Carga_Hora * 100)) <= 25) then 'EXAME'
else 'REPROVADO' end Resultado
from student order by ra
I need to create a block to fill the result field:
APROVADO
. EXAME
. REPROVADO
.