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

SQL SUM function


SUM

To display the total cost of the library items using the SQL SUM function in the library table, you can use the following SQL query:

SELECT SUM(price) AS total_cost FROM library;

In this query, the SUM(price) function calculates the total cost of all the items in the library table. The price data field contains the book's cost.

Copyright © 2024 · All Rights Reserved · PrimaSoft PC