pgAdmin 4 pgAdmin File Object v Tools v Help Browser Q > Dashboard Properties S SQL Statistics Dependencies Dependents Processes dvd rental/postgres@PostgreSQL 15* X city_id dvd rental/postgres@PostgreSQL 15 postal_code Y No limit I D V E I V 6 6 V phone Query Query History Scratch Pad x last_update > >Constraints 1 SELECT store_id, customer . customer_id, SUM(payment. amount) AS total_amount, RANK() OVER (PARTITION BY store_id ORDER BY SUM(payment. amount) DESC) AS ranking 5. Select out Top 5 customers for each store based on the total > Indexes IDWN FROM customer payment amount. (Return columns: store_id, customer_id, > GRLS Policies JOIN payment ON payment . customer_id = customer . customer_id total_amount, ranking) > m Rules GROUP BY store_id, customer . customer_id > + Triggers ORDER BY store_id, ranking ASC > category LIMIT 5; > E city > country 10 > customer 11 v film 12 Columns (13) 13 film_id title description release_year language_id rental_duration Data Output Messages Notifications rental_rate length N replacement_co store_id customer_id total_amount ranking smallint [PK] integer 8 numeric bigint rating 148 211.55 last_update 144 189.60 special_features fulltext 459 183.63 CI A W N CI A W N 236 166.61 > Constraints 403 > Indexes 162.67 > RLS Policies > mm Rules > + Triggers > film_actor > film_category inventory v Columns (4) inventory_id Total rows: 5 of 5 Query complete 00:00:00.060 Ln 2, Col 1 20 C Q Search ENG 01:38 bunny IN 02-04-2023
Expert's Answer
Chat with our Experts
Want to contact us directly? No Problem. We are always here for you
![Experts](https://assignmentstudio.net/wp-content/uploads/2021/08/Experts-300x126_c.png)
Your future, our responsibilty submit your task on time.
Order NowGet Online
Assignment Help Services