This is using the Sakila Sample database and tables which ca
This is using the Sakila Sample database and tables which can download here:
https://dev.mysql.com/doc/sakila/en
Write a query that produces the last name and first name and film title of all actors who are in Family, Foreign, or Horror films ordered by last name. Next, Write a query that produces the last name and first name and film title and film category of every actor who is in both a Family move and a Horror movie ordered by last name. rename the category from “name” to “category” in your result table. (hint: “AS” keyword)
**Note that you will be performing a query on multiple tables**
Solution
1.
Select actor.last_name,actor.first_name,film.title from actor inner join film_actor on actor.actor_id = film_actor.actor_id inner join film on film_actor.film_id = film.film_id inner join film_category on film_category.film_id = film.film_id inner join category on category.category_id = film _category.category_id where category.name =\'Family\' or category.name = \'Foreign\' or category.name = \'Horror\' order by actor.last_name;
2.
Select actor.last_name,actor.first_name,film.title ,category.name AS category from actor inner join film_actor on actor.actor_id = film_actor.actor_id inner join film on film_actor.film_id = film.film_id inner join film_category on film_category.film_id = film.film_id inner join category on category.category_id = film _category.category_id where category.name =\'Family\' and category.name = \'Horror\' order by actor.last_name;
