Use a owcontrol structure to reduce the membership fee to 12
Use a ow-control structure to reduce the membership fee to $120 if any of the clubs charge more than $120. Make sure to reduce $5 each time and reduce only the membership fees of the clubs that overcharge. Run your SQL statement in Query Analyzer.
Tables: club: Clubname , MembershipFee
Solution
control folw structure:
we have two types of control flow statements they are:
conditional structures
iterative structure...
we have to write above program in pl/sql languageb because pl/sql is the procedural extension for the non procedural language SQL.
we have the table club in that we have 2 attributes clubname and membershipfee
following is the code for to decrease the fee
create
or
replace
procedure CHANGE_MFEE(clubname varchar(15)) is
declare
reduce CONSTANT number := 5;
begin
for i in 1..(select count(*) from club) loop
update club set membershipfee = membershipfee - reduce;
end loop;
end;
/
count(*) which is used to get no.of rows in the club table.
