~/ learn/ postgresql/ cards/ Functions, Procedures & Triggers
1 of 4

Create a SQL function line_total(qty int, price numeric) RETURNS numeric that returns qty * price, then call line_total(3, 10) as total.

Create a SQL function line_total(qty int, price numeric) RETURNS numeric that returns qty * price, then call line_total(3, 10) as total.

Answer

CREATE FUNCTION line_total(qty int, price numeric) RETURNS numeric AS SELECT qty * price LANGUAGE sql; SELECT line_total(3, 10) AS total;

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/3c397614-a11c-4455-bb83-30c3bb83d27e/flashcard utf-8 LF