-- get_tax_rate.sql

CREATE OR REPLACE FUNCTION get_tax_rate (snum NUMBER)
  RETURN NUMBER
AS
  rate store.sales_tax_rate%TYPE;
BEGIN
  SELECT sales_tax_rate INTO rate FROM store
   WHERE store_number = snum;
  RETURN rate;
END;
/
