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