Databases for Windows  /   Database Blog  /   Organizer Advantage, Handy Library, SQL Tutor  /   SQL Functions   /  SQL Tutor, FUNCTIONS, Avg
28/05/2024

Functions, AVG


AVG

To display the average price of the book in the library table using SQL avg function, you can use the following query:

SELECT AVG(price) AS average_price FROM library;

In this query, we are using the AVG function to calculate the average price of the books stored in the price field of the library table. The result will be displayed as average_price.

Copyright © 2024 · All Rights Reserved · PrimaSoft PC