SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
WITH WeeklyRentals AS ( SELECT WEEK(rental_date, 1) AS week_num, COUNT(rental_id) AS total_rentals FROM rental WHERE rental_date BETWEEN '2005-08-01' AND '2005-08-31' GROUP BY week_num HAVING total_rentals > 0 -- Убедитесь, что считаем только недели с арендой ) SELECT AVG(total_rentals) AS weekly_average_rentals_count FROM WeeklyRentals;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear