Explain the key differences between stored procedures and functions in SQL (return values, DML operation capabilities, how they are executed).
Asked in the Technical interview stage. Present the comparison using PostgreSQL terminology and syntax.
aspect, function_behavior, procedure_behavior, and execution_note.| Column | Type | Description |
|---|---|---|
| sort_orderPK | INT | Order in which comparison aspects should appear |
| aspect | VARCHAR(100) | Concept being compared |
| function_behavior | VARCHAR(500) | Behavior of a PostgreSQL function |
| procedure_behavior | VARCHAR(500) | Behavior of a PostgreSQL procedure |
| execution_note | VARCHAR(500) | Relevant invocation or execution detail |