A subprogram has two parts: subprogram specification and subprogram body.
The subprogram specification is the header section, which contains the details such as program name, subprogram type, parameter list, and return clause (for functions).
The subprogram body is a PL/SQL block, which has the declaration, executable, and exception sections.
An anonymous block has no specification or header section. It only consists of a PL/SQL block in the body that contains the declaration, executable, and exception sections.