An emergency-ops dispatch console needs a reusable query that returns open shelters with remaining capacity as a result set. Which object should they create?
Select an answer to reveal the explanation.
Short Explanation
A TVF is the printable roster: many shelter rows with capacity still open, ready for the console to read. A scalar function would hand back one lonely number, not the list dispatch needs.
Full Explanation
An emergency-ops dispatch console that needs a reusable query returning open shelters with remaining capacity needs a rowset, not a single scalar. A table-valued function (inline or multi-statement, as platform rules allow) accepts filters such as region or minimum beds and returns each qualifying shelter with capacity columns the console can bind to a grid. That reuse keeps capacity logic in one place for every dispatch session instead of copying the same SELECT into multiple apps.
A scalar function that returns only a single shelter_id cannot populate a multi-row shelter list. A DEFAULT constraint invents column defaults on insert; it does not generate capacity result sets when shelters are empty. A SEQUENCE that generates shelter names only produces numeric (or sequence) values—it does not query open shelters or remaining capacity for the console.
Exam caveat: choose TVFs when the municipal consumer needs a parameterized table result; choose scalar UDFs when the need is one typed value (for example a formatted label). Prefer inline TVFs where the optimizer can expand them. Operational check: invoke the TVF with a test region, confirm multiple shelter rows with positive remaining capacity, then invoke with a saturated region and confirm an empty or zero-capacity result consistent with source data.