Partitioned Running Totals

Question:

The cats must by ordered first by breed and second by name. They are about to enter an elevator one by one. When all the cats of the same breed have entered they leave.

We would like to know what the running total weight of the cats is.


Return: name, breed, running total weight
Order by: breed, name

Show Table Schema

Click me!

Desired output:

name breed running_total_weight
Charlie British Shorthair 4.8
Smudge British Shorthair 9.7
Tigger British Shorthair 13.5
Millie Maine Coon 5.4
Misty Maine Coon 11.1
Puss Maine Coon 16.2
Smokey Maine Coon 22.3
Ashes Persian 4.5
Felix Persian 9.5
Molly Persian 13.7
Alfie Siamese 5.5
Oscar Siamese 11.6
view answer

Your output: