List Top Daily Rentals Per Customer using a CTE
# horror film rental(answer)
select cus_dtl.name, cus_dtl.phone, hf_cus.title, hf_cus.rental_date, hf_cus.name
from (select c.customer_id, concat(c.first_name, ',', c.last_name) as name, a.phone
      from customer as c, address as a
      where c.address_id = a.address_id) as cus_dtl, (select r.customer_id, r.rental_date, hf_inve.title, hf_inve.name
                                                      from rental as r, (select i.inventory_id, hf_title.film_id, hf_title.title, hf_title.name
                                                                         from inventory as i, (select f.title, horror_FID.film_id, horror_FID.name
                                                                                               from film as f, (select fc.film_id, horror.name
                                                                                                                from film_category as fc, (select category_id, name
                                                                                                                                           from category
                                                                                                                                           where name = 'horror') as horror
                                                                                                                where fc.category_id = horror.category_id) as horror_FID
                                                                                               where f.film_id = horror_FID.film_id) as hf_title
                                                                         where i.film_id = hf_title.film_id) as hf_inve
                                                      where r.inventory_id = hf_inve.inventory_id) as hf_cus
where hf_cus.customer_id = cus_dtl.customer_id
order by cus_dtl.name, hf_cus.title, hf_cus.rental_date desc;


using sub queries..