Access to all courses
Aggregates - Sum
In this lesson, we will learn how to use the sum aggregate function in Prisma. We will use the .aggregate() method to calculate the sum of a column in a table. We will also learn how to filter the rows before calculating the sum. ## Sum Sum is the total of a column in a table. Let's say we wanted to get the total price of all the products in the products table. We can use the sum aggregate function to calculate the total price. I want to buy everything in the products table! ```javascript //
The rest of this lesson is waiting.
Join JS Mastery Pro to unlock it.





Get Full Access
$149 /month
Lock in a year & save—2 months free!
Quizzes, mini-challenges, AI summaries, inline sandboxes
Participation in a private community
Build real production-grade apps
Mock interviews & project reviews
Weekly live sessions & member-only access