Intern — Middle
10 clients with the highest total number of purchases
livecode
Task condition
It is necessary to form a list of ten clients with the maximum total number of purchased goods. Use the 'amount' column from the 'carts' table for calculations.
-- Table "public.carts"
-- Column | Type | Modifiers
-- -----------|-----------------------------|-----------------------------
-- sku | bigint | not null
-- country | country_enum | not null
-- customer_id| bigint |
-- amount | bigint | not null
-- updated_at | timestamp without time zone| default now()
-- Table "public.customer"
-- Column | Type | Modifiers
-- -------|-------|----------------
-- id | bigint| not null
-- email | text | not null