SQL Avg

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

Tutorials dojo strip

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

Tutorials dojo strip
Scroll to Top