Support ongoing development - donate to help us maintain and improve the platform. 🖥️ Support sqltest →
SQL code copied to buffer
Task 54:

Customer Rental Summary

MySQL
Write a query to summarize rental activity by customer, specifically counting the number of rentals from two different stores. Your output should include the following columns:
- customer_id: The unique identifier for each customer.
- store_1_rentals: The count of rentals from store 1.
- store_2_rentals: The count of rentals from store 2.

The store defined according store_id in staff table.
Sort the results by customer_id.
Expected result Columns: 3 · Rows: 599
customer_id store_1_rentals store_2_rentals

Sample rows open after wrong checks: 0 of 3

Write your query below and click "Check it!". Tables are described in the right pane.

The query result will appear here. Ctrl+Enter - Run query

Hi! Could we please enable some services and cookies to improve your experience and our website?

Privacy & Cookie Policy.