The AVG function in SQL calculates averages, something we often use in clinical audits.
For example, if I wanted to find the average duration of vancomycin therapy:
SELECT AVG(DurationDays) AS AvgTherapyLength
FROM MedOrders
WHERE DrugName = 'Vancomycin';
Practical idea:
- Find the average turnaround time for lab results.
- Calculate the average dose per administration for a specific drug.
AVG is another small building block for more complex analytics down the line.