Nested Aggregate Functions Postgresql W3schools React Js