Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Please can you post Kata-specific problems on the discourse page for that Kata instead of the forum which is for general topics. Each Kata has an automatic discourse page in which you can mark your comment as a question, which means it's easier for me to help (since it's easier to find). Also, since this is a forum page, I can't mark your comment as a spoiler, meaning people can look at your code and use it themselves, however on the discourse page I can hide your solution.
SELECT c.customer_id,c.email,COUNT(c.customer_id) AS payments_count,SUM(c.customer_id ) AS total_amount
FROM customer c JOIN payment p
ON (c.customer_id = p.customer_id)
ORDER BY c.customer_id limit 10;
I have done this for the SQL Basics: Top 10 customers by total payments amount question but it still does not work it also wants to return a float number as well for the total amount
Overview
For this kata we will be using the DVD Rental database.
Your are working for a company that wants to reward its top 10 customers with a free gift. You have been asked to generate a simple report that returns the top 10 customers by total amount spent. Total number of payments has also been requested.
The query should output the following columns:
customer_id [int4]
email [varchar]
payments_count [int]
total_amount [float]
and has the following requirements:
only returns the 10 top customers, ordered by total amount spent
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution