order by 12

SQL Basics: Top 10 customers by total payments amount

Overview For this kata we will be using the DVD Rental database. You 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 ordered from highest to lowest. Total number of payments has also been requested. The query should output the following columns: customer_i..

Best-Selling Books (SQL for Beginners #5)

You work at a book store. It's the end of the month, and you need to find out the 5 bestselling books at your store. Use a select statement to list names, authors, and number of copies sold of the 5 books which were sold most. books table schema name author copies_sold Solution: SELECT * FROM books ORDER BY copies_sold DESC LIMIT 5 Result: name author copies_sold The Unbearable Lightness of Bein..