⏳ Last days of October! SQLtest.online is free thanks to donations, and we still need to reach this month's goal to keep the site running in November. Every donation counts. Support now →
SQL code copied to buffer
Task 131:

Disk Rental and Return Statistics

MySQL
Write a query that returns data about the daily issuance and return of disks during July 2005. The resulting table should contain the following columns:
- date - date,
- rented_at_store_1 - the number of discs issued at the first rental point,
- returned_at_store_1 - the number of disks returned at the first rental point,
- rented_at_store_2 - the number of discs issued at the second rental point,
- returned_at_store_2 - the number of disks returned at the second rental point,
- total_rented - total number of leases issued,
- total_returned - total number of returned disks
Dates on which there were no transactions should also appear in the resulting table with zero values in all fields.
Expected result Columns: 7 · Rows: 31
date rented_at_store_1 returned_at_store_1 rented_at_store_2 returned_at_store_2 total_rented total_returned

Sample rows open after wrong checks: 0 of 3

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

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