iWMS interview question

Difference between stored procedure and function