In the codes below in postgre sql pgadmin, LOOP and Update students set average - CalcAv, Letter Grade - CalcLG; Calculating midterm, final, letter grade and Weighted Grade Point Average between how do i write a sql code that prints/fetches.

Bella 1 Reputation point

do $$
Declare std record; --std=student
Declare stdlesson record;

for std in Select studentNo, name, lastname From students Loop

raise notice 'StudentNo: % Name: % Lastname: % NAME LASTNAME: %',
std.studentNo,, std.lastname, || '' || std.lastname;

for stdlesson in Select sl.* from studentlessons sl where sl.studentNo - std.studentNo
average and letter grade calculations were made(In this section, letter grade calculation, midterm final average and weighted grade point average must be calculated.)
Update studentlessons set average - calculusAvr, letterGrade - calculusLG; --Avr=averege LG=Letter Grade

END LOOP; --studentlessons

END loop; --students


Azure SQL Database
Azure Database for PostgreSQL
{count} votes