CSL 333-Set-B
CSL 333-Set-B
SET B
1. Write a PL/SQL program to check whether the number is Armstrong number or not.
using functions.
ANS:
DECLARE
result BOOLEAN;
RETURN BOOLEAN
IS
sum_of_digits NUMBER := 0;
digit NUMBER;
BEGIN
END LOOP;
END;
BEGIN
result := is_armstrong_number(num);
IF result THEN
ELSE
END IF;
END;
2. Create the following tables and insert values into the tables :
Primary keys are underlined. dnum is a foreign key that identifies the department to
which a faculty belongs. odno is a foreign key identifying the department that offers a
course
a. Increment the salary of male faculty members with age more than 50 by 10%.
ANS:
update faculty set salary = salary*1.1 where age>50 and gender='Male';