Transit maintenance needs a reusable list of vehicles due for inspection based on mileage thresholds. Which object should return that list?
Select an answer to reveal the explanation.
Short Explanation
The TVF is the shop clipboard: every bus over the mileage line shows up as a row ready for inspection scheduling. A scalar max-mileage number does not give mechanics a work list.
Full Explanation
Transit maintenance needs a reusable list of vehicles due for inspection when mileage exceeds thresholds—again a multi-row operational roster. A table-valued function encapsulates the threshold logic and returns each due vehicle with identifiers, mileage, and due flags the shop schedule can consume. Mechanics get a work list; planners can pass different threshold parameters without rewriting the query.
A scalar function that returns only the fleet-wide maximum mileage answers a different question and does not list which buses are due. A DEFAULT constraint that sets every new vehicle to Due immediately pollutes insert defaults and still does not produce an inspection due list for existing fleet rows. A columnstore index alone may accelerate scans but is not a query object that returns due vehicles to the maintenance console.
Exam caveat: indexes support access paths; programmability objects (TVFs, procedures, views) define the reusable result contract. Operational check: set two vehicles above and one below the threshold, call the TVF, and assert only the over-threshold vehicles appear with correct mileage columns. Keep threshold parameters explicit (miles, days since last inspection, or both) so maintenance policy changes do not require rewriting every caller. When the same due list must be secured differently for shop floor versus planners, wrap the TVF in a view or procedure that applies role-appropriate filters.