select f.title, f.rating
from film f
join inventory i on f.film_id = i.film_id
join rental r on i.inventory_id = r.inventory_id
join customer c on r.customer_id = c.customer_id
where c.first_name = 'KATIE' and c.last_name = 'ELLIOTT'
order by case when f.rating = 'R' then 0 else 1 end, f.title asc
;
show status like 'Last_query_cost';