1FUNCTION sal_ok (salary REAL, title VARCHAR2) RETURN BOOLEAN IS
2 min_sal REAL;
3 max_sal REAL;
4BEGIN
5 SELECT losal, hisal INTO min_sal, max_sal FROM sals
6 WHERE job = title;
7 RETURN (salary >= min_sal) AND (salary <= max_sal);
8END sal_ok;
9
10