How to count the amount of values grouped by some column? I need to create a view based on data from another table and grouped by some column value. Here is a source table:

CREATE TABLE source
AS
  SELECT *
  FROM ( VALUES
    ( 6, 1000 ),
    ( 6, 2000 ),
    ( 7, 5000 ),
    ( 7, 6000 )
  ) AS t(client_id, score);


and the desired view is:

 client_id | score
----+---------+---
 6         | 3000 
 7         | 11000


As far as I know, it's convenient to use window functions in this case. But what way will be most effective for grouping by client_id field?

Thank you.
You really don't need a view for something this simple. But this is what it would look like

CREATE VIEW desired_view
AS
  SELECT client_id, sum(score)
  FROM source
  GROUP BY client_id;


Output 

 client_id |  sum  
-----------+-------
         6 |  3000
         7 | 11000
(2 rows)