SQL Avg

The SQL AVG function is used to calculate the average value of a numeric column in a table.


SQL Avg Syntax

SELECT AVG(column_name)
FROM table_name



SQL Avg Example

SQL Avg Number of Prescribed Medications Example

This query calculates the average number of medications prescibed to patients, based on the Prescriptions table.

SELECT AVG(prescription_id) AS avg_prescriptions
FROM Prescriptions;




SQL Avg Visual Diagram



SQL Avg Labs

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top