RienSQL
TASK #131 · Medium · Facebook

Number of orders by each registered customer

Your brief
Given a database with information about purchases and registered customers. The purchases table stores purchase information, the registered_customers table stores registered customer information.

Write a query to identify the number of orders placed by each registered customer. Display the customer ID and the total number of orders placed by each customer.
Expected columnscustomer_id total_ordersFacebook
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
purchasespurchase_id, date, amount, product_id, customer_id
registered_customerscustomer_id, customer_name, join_date, state, country