with rent_cte as (
select staff_id, day(rental_date) as day, count(*) as cnt
from rental
where rental_date like '2005-05%'
group by staff_id, day(rental_date)
order by 2
),
return_cte as (
select staff_id, day(return_date) as day, count(*) as cnt2
from rental
where return_date like '2005-05%'
group by staff_id, day(return_date)
)
select *
from rent_cte r1
full outer join return_cte r2 on r1.day = r2.day
join staff on r1.staff_id = staff.staff_id