Update tblgradek12Set GenAve =
--select IDNO,LastName, FirstName, MI,YearLevel,SectionName,GenAve,
(
CASE
WHEN YearLevel='LC7' and SectionName='FirstYearSection1' THEN
Round((((ISNULL(Speech,0) * 1.2) + (ISNULL(English,0) * 1.5) + (ISNULL(Math,0) * 1.5) + (ISNULL(Science,0) * 1.8) + (ISNULL([Literature],0) * 1.2) +
(ISNULL(TLEComputer,0) * 1.2) + (ISNULL(MAPEH,0) * 1.2) + (ISNULL(CLE,0) * 0.9) + (ISNULL([Earth Science],0) * 1))/11.5),3)
WHEN YearLevel='LC8' and SectionName='SecondYearSection1' THEN
Round((((ISNULL(Speech,0) * 1.2) + (ISNULL(English,0) * 1.5) + (ISNULL(Math,0) * 1.5) + (ISNULL(Science,0) * 1.8) + (ISNULL([Literature],0) * 1.2) +
(ISNULL(TLEComputer,0) * 1.2) + (ISNULL(MAPEH,0) * 1.2) + (ISNULL(CLE,0) * 0.9) + (ISNULL(Geometry,0) * 1))/11.5),3)
WHEN YearLevel='LC9' and SectionName='ThirdYearSection1' THEN
Round((((ISNULL(Speech,0) * 1.2) + (ISNULL(English,0) * 1.5) + (ISNULL(Math,0) * 1.5) + (ISNULL(Science,0) * 1.8) + (ISNULL([Literature],0) * 1.2) +
(ISNULL(TLEComputer,0) * 1.2) + (ISNULL(MAPEH,0) * 1.2) + (ISNULL(CLE,0) * 0.9) + (ISNULL(Research1,0) * 1) + (ISNULL([Adv Biology],0) *1))/12.5),3)
WHEN YearLevel='LC10' and SectionName='FourthYearSection1' THEN
Round((((ISNULL(Speech,0) * 1.2) +(ISNULL(English,0) * 1.5) + (ISNULL(Math,0) * 1.5) + (ISNULL(Science,0) * 1.8) + (ISNULL([Literature],0) * 1.2) +
(ISNULL(TLEComputer,0) * 1.2) + (ISNULL(MAPEH,0) * 1.2) + (ISNULL(CLE,0) * 0.9) + (ISNULL(Research2,0) * 1) + (ISNULL([Adv Chemistry],0) * 1) +
(ISNULL(CAT3,0) * 0.3))/12.8),3)
WHEN YearLevel='LC10' and SectionName <> 'FourthYearSection1' THEN
Round((((ISNULL(Speech,0) * 1.2) + (ISNULL(English,0) * 1.5) + (ISNULL(Math,0) * 1.5) + (ISNULL(Science,0) * 1.8) + (ISNULL([Literature],0) * 1.2) +
(ISNULL(TLEComputer,0) * 1.2) + (ISNULL(MAPEH,0) * 1.2) + (ISNULL(CLE,0) * 0.9) + (ISNULL(CAT,0) * 0.3))/10.8),3)
ELSE
Round((((ISNULL(Speech,0) * 1.2) + (ISNULL(English,0) * 1.5) + (ISNULL(Math,0) * 1.5) + (ISNULL(Science,0) * 1.8) + (ISNULL([Literature],0) * 1.2) +
(ISNULL(TLEComputer,0) * 1.2) + (ISNULL(MAPEH,0) * 1.2) + (ISNULL(CLE,0) * 0.9))/10.5),3)
END
)
FROM TBLGRADEK12
--Second Grading
Update tblgradek12
Set GenAve2 =
--select IDNO,LastName, FirstName, MI,YearLevel,SectionName,GenAve,
(
CASE
WHEN YearLevel='LC7' and SectionName='FirstYearSection1' THEN
Round((((ISNULL(Speech2,0) * 1.2) + (ISNULL(English2,0) * 1.5) + (ISNULL(Math2,0) * 1.5) + (ISNULL(Science2,0) * 1.8) + (ISNULL([Literature2],0) * 1.2) +
(ISNULL(TLEComputer2,0) * 1.2) + (ISNULL(MAPEH2,0) * 1.2) + (ISNULL(CLE2,0) * 0.9) + (ISNULL([Earth Science2],0) * 1))/11.5),3)
WHEN YearLevel='LC8' and SectionName='SecondYearSection1' THEN
Round((((ISNULL(Speech2,0) * 1.2) + (ISNULL(English2,0) * 1.5) + (ISNULL(Math2,0) * 1.5) + (ISNULL(Science2,0) * 1.8) + (ISNULL([Literature2],0) * 1.2) +
(ISNULL(TLEComputer2,0) * 1.2) + (ISNULL(MAPEH2,0) * 1.2) + (ISNULL(CLE2,0) * 0.9) + (ISNULL(Geometry2,0) * 1))/11.5),3)
WHEN YearLevel='LC9' and SectionName='ThirdYearSection1' THEN
Round((((ISNULL(Speech2,0) * 1.2) + (ISNULL(English2,0) * 1.5) + (ISNULL(Math2,0) * 1.5) + (ISNULL(Science2,0) * 1.8) + (ISNULL([Literature2],0) * 1.2) +
(ISNULL(TLEComputer2,0) * 1.2) + (ISNULL(MAPEH2,0) * 1.2) + (ISNULL(CLE2,0) * 0.9) + (ISNULL(Research1_2,0) * 1) + (ISNULL([Adv Biology2],0) *1))/12.5),3)
WHEN YearLevel='LC10' and SectionName='FourthYearSection1' THEN
Round((((ISNULL(Speech2,0) * 1.2) +(ISNULL(English2,0) * 1.5) + (ISNULL(Math2,0) * 1.5) + (ISNULL(Science2,0) * 1.8) + (ISNULL([Literature2],0) * 1.2) +
(ISNULL(TLEComputer2,0) * 1.2) + (ISNULL(MAPEH2,0) * 1.2) + (ISNULL(CLE2,0) * 0.9) + (ISNULL(Research2_2,0) * 1) + (ISNULL([Adv Chemistry2],0) * 1) +
(ISNULL(CAT3,0) * 0.3))/12.8),3)
WHEN YearLevel='LC10' and SectionName <> 'FourthYearSection1' THEN
Round((((ISNULL(Speech2,0) * 1.2) + (ISNULL(English2,0) * 1.5) + (ISNULL(Math2,0) * 1.5) + (ISNULL(Science2,0) * 1.8) + (ISNULL([Literature2],0) * 1.2) +
(ISNULL(TLEComputer2,0) * 1.2) + (ISNULL(MAPEH2,0) * 1.2) + (ISNULL(CLE2,0) * 0.9) + (ISNULL(CAT2,0) * 0.3))/10.8),3)
ELSE
Round((((ISNULL(Speech2,0) * 1.2) + (ISNULL(English2,0) * 1.5) + (ISNULL(Math2,0) * 1.5) + (ISNULL(Science2,0) * 1.8) + (ISNULL([Literature2],0) * 1.2) +
(ISNULL(TLEComputer2,0) * 1.2) + (ISNULL(MAPEH2,0) * 1.2) + (ISNULL(CLE2,0) * 0.9))/10.5),3)
END
)
FROM TBLGRADEK12
--Third Grading
Update tblgradek12
Set GenAve3 =
--select IDNO,LastName, FirstName, MI,YearLevel,SectionName,GenAve,
(
CASE
WHEN YearLevel='LC7' and SectionName='FirstYearSection1' THEN
Round((((ISNULL(Speech3,0) * 1.2) + (ISNULL(English3,0) * 1.5) + (ISNULL(Math3,0) * 1.5) + (ISNULL(Science3,0) * 1.8) + (ISNULL([Literature3],0) * 1.2) +
(ISNULL(TLEComputer,0) * 1.2) + (ISNULL(MAPEH3,0) * 1.2) + (ISNULL(CLE3,0) * 0.9) + (ISNULL([Earth Science3],0) * 1))/11.5),3)
WHEN YearLevel='LC8' and SectionName='SecondYearSection1' THEN
Round((((ISNULL(Speech3,0) * 1.2) + (ISNULL(English3,0) * 1.5) + (ISNULL(Math3,0) * 1.5) + (ISNULL(Science3,0) * 1.8) + (ISNULL([Literature3],0) * 1.2) +
(ISNULL(TLEComputer3,0) * 1.2) + (ISNULL(MAPEH3,0) * 1.2) + (ISNULL(CLE3,0) * 0.9) + (ISNULL(Geometry3,0) * 1))/11.5),3)
WHEN YearLevel='LC9' and SectionName='ThirdYearSection1' THEN
Round((((ISNULL(Speech3,0) * 1.2) + (ISNULL(English3,0) * 1.5) + (ISNULL(Math3,0) * 1.5) + (ISNULL(Science3,0) * 1.8) + (ISNULL([Literature3],0) * 1.2) +
(ISNULL(TLEComputer3,0) * 1.2) + (ISNULL(MAPEH3,0) * 1.2) + (ISNULL(CLE3,0) * 0.9) + (ISNULL(Research1_3,0) * 1) + (ISNULL([Adv Biology3],0) *1))/12.5),3)
WHEN YearLevel='LC10' and SectionName='FourthYearSection1' THEN
Round((((ISNULL(Speech3,0) * 1.2) +(ISNULL(English3,0) * 1.5) + (ISNULL(Math3,0) * 1.5) + (ISNULL(Science3,0) * 1.8) + (ISNULL([Literature3],0) * 1.2) +
(ISNULL(TLEComputer3,0) * 1.2) + (ISNULL(MAPEH3,0) * 1.2) + (ISNULL(CLE3,0) * 0.9) + (ISNULL(Research2_3,0) * 1) + (ISNULL([Adv Chemistry3],0) * 1) +
(ISNULL(CAT3,0) * 0.3))/12.8),3)
WHEN YearLevel='LC10' and SectionName <> 'FourthYearSection1' THEN
Round((((ISNULL(Speech3,0) * 1.2) + (ISNULL(English3,0) * 1.5) + (ISNULL(Math3,0) * 1.5) + (ISNULL(Science3,0) * 1.8) + (ISNULL([Literature3],0) * 1.2) +
(ISNULL(TLEComputer3,0) * 1.2) + (ISNULL(MAPEH3,0) * 1.2) + (ISNULL(CLE3,0) * 0.9) + (ISNULL(CAT3,0) * 0.3))/10.8),3)
ELSE
Round((((ISNULL(Speech3,0) * 1.2) + (ISNULL(English3,0) * 1.5) + (ISNULL(Math3,0) * 1.5) + (ISNULL(Science3,0) * 1.8) + (ISNULL([Literature3],0) * 1.2) +
(ISNULL(TLEComputer3,0) * 1.2) + (ISNULL(MAPEH3,0) * 1.2) + (ISNULL(CLE3,0) * 0.9))/10.5),3)
END
)
FROM TBLGRADEK12
--Fourth Grading
Update tblgradek12
Set GenAve4 =
--select IDNO,LastName, FirstName, MI,YearLevel,SectionName,GenAve,
(
CASE
WHEN YearLevel='LC7' and SectionName='FirstYearSection1' THEN
Round((((ISNULL(Speech4,0) * 1.2) + (ISNULL(English4,0) * 1.5) + (ISNULL(Math4,0) * 1.5) + (ISNULL(Science4,0) * 1.8) + (ISNULL([Literature4],0) * 1.2) +
(ISNULL(TLEComputer4,0) * 1.2) + (ISNULL(MAPEH4,0) * 1.2) + (ISNULL(CLE4,0) * 0.9) + (ISNULL([Earth Science4],0) * 1))/11.5),3)
WHEN YearLevel='LC8' and SectionName='SecondYearSection1' THEN
Round((((ISNULL(Speech4,0) * 1.2) + (ISNULL(English4,0) * 1.5) + (ISNULL(Math4,0) * 1.5) + (ISNULL(Science4,0) * 1.8) + (ISNULL([Literature4],0) * 1.2) +
(ISNULL(TLEComputer4,0) * 1.2) + (ISNULL(MAPEH4,0) * 1.2) + (ISNULL(CLE4,0) * 0.9) + (ISNULL(Geometry4,0) * 1))/11.5),3)
WHEN YearLevel='LC9' and SectionName='ThirdYearSection1' THEN
Round((((ISNULL(Speech4,0) * 1.2) + (ISNULL(English4,0) * 1.5) + (ISNULL(Math4,0) * 1.5) + (ISNULL(Science4,0) * 1.8) + (ISNULL([Literature4],0) * 1.2) +
(ISNULL(TLEComputer4,0) * 1.2) + (ISNULL(MAPEH4,0) * 1.2) + (ISNULL(CLE4,0) * 0.9) + (ISNULL(Research1_4,0) * 1) + (ISNULL([Adv Biology4],0) *1))/12.5),3)
WHEN YearLevel='LC10' and SectionName='FourthYearSection1' THEN
Round((((ISNULL(Speech4,0) * 1.2) +(ISNULL(English4,0) * 1.5) + (ISNULL(Math4,0) * 1.5) + (ISNULL(Science4,0) * 1.8) + (ISNULL([Literature4],0) * 1.2) +
(ISNULL(TLEComputer4,0) * 1.2) + (ISNULL(MAPEH4,0) * 1.2) + (ISNULL(CLE4,0) * 0.9) + (ISNULL(Research2_4,0) * 1) + (ISNULL([Adv Chemistry4],0) * 1) +
(ISNULL(CAT3,0) * 0.3))/12.8),3)
WHEN YearLevel='LC10' and SectionName <> 'FourthYearSection1' THEN
Round((((ISNULL(Speech4,0) * 1.2) + (ISNULL(English4,0) * 1.5) + (ISNULL(Math4,0) * 1.5) + (ISNULL(Science4,0) * 1.8) + (ISNULL([Literature4],0) * 1.2) +
(ISNULL(TLEComputer4,0) * 1.2) + (ISNULL(MAPEH4,0) * 1.2) + (ISNULL(CLE4,0) * 0.9) + (ISNULL(CAT4,0) * 0.3))/10.8),3)
ELSE
Round((((ISNULL(Speech4,0) * 1.2) + (ISNULL(English4,0) * 1.5) + (ISNULL(Math4,0) * 1.5) + (ISNULL(Science4,0) * 1.8) + (ISNULL([Literature4],0) * 1.2) +
(ISNULL(TLEComputer4,0) * 1.2) + (ISNULL(MAPEH4,0) * 1.2) + (ISNULL(CLE4,0) * 0.9))/10.5),3)
END
)
FROM TBLGRADEK12