|
@@ -416,14 +416,14 @@
|
|
|
else 0 end) actualCount,
|
|
|
sum(case when s.is_absent = 1 or s.omr_absent = 1 then 1 else 0 end) absentCount,
|
|
|
sum(case when s.is_breach = 1 then 1 else 0 end) breachCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
|
|
|
else 0 end) passCount,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
|
|
|
else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
@@ -445,14 +445,14 @@
|
|
|
SELECT s.college,
|
|
|
count(*) studentCount,
|
|
|
sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
|
|
|
else 0 end) passCount,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
|
|
|
else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
@@ -468,14 +468,14 @@
|
|
|
SELECT s.class_name,
|
|
|
count(*) studentCount,
|
|
|
sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
|
|
|
else 0 end) passCount,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
|
|
|
else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
@@ -491,14 +491,14 @@
|
|
|
SELECT s.teacher,
|
|
|
count(*) studentCount,
|
|
|
sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
|
|
|
else 0 end) passCount,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
|
|
|
else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|
|
@@ -559,14 +559,14 @@
|
|
|
s.class_name,
|
|
|
count(*) studentCount,
|
|
|
sum(case when s.is_absent = 1 then 1 else 0 end) absentCount,
|
|
|
- avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
|
|
|
- max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
|
|
|
- min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
|
|
|
+ avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
|
|
|
+ max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
|
|
|
+ min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
|
|
|
else 0 end) passCount,
|
|
|
sum(case
|
|
|
- when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
|
|
|
+ when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
|
|
|
else 0 end) excellentCount
|
|
|
FROM mark_student s
|
|
|
left join mark_paper t on s.exam_id = t.exam_id
|