🙏 We need your help! SQLtest.online has no ads and lives only on donations. Even a small amount helps. Donate now →
SQL code copied to buffer
Task 58:

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

By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more

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