The warehouse wants a label for each product's stock.
- Create
stock_label(p_id integer), which returnstext. Read the stock of productp_idinto a variable, then return:sold outwhen the stock is 0,lowwhen it is below 10,okotherwise.
- List every product's
nameand its label, in that order. - Replace the function so that it also sends a notice with the product id and the stock it read. Keep the labels the same.
- Run
SELECT stock_label(12);and read the notice.