Professional Documents
Culture Documents
use mavenmovies;
--------------------
-- question 1 --
--------------------
-- 1. write a SQL query to count the number of characters except for the spaces for each actor --
-- Return the first 10 actors name length along with their names; --
limit 10;
OUTPUT
-- here, since there we no spaces present anyways, we can simply use the above query in case of
present spaces we could've just used --
-- replace function to replace spaces with no spaces and then perform the above query --
--------------------
-- question 2 --
--------------------
-- 2. list all oscar awardees(actors who received the oscar awards) with their full names and the
length of their names --
OUTPUT
MANDATORY ASSIGNMENT W3-D2;
-- here I've use '%' to make sure that the compiler also scans oscar even if its among different awards
--
--------------------
-- question 3 --
--------------------
on a.actor_id = fa.actor_id
on fa.film_id = f.film_id
OUTPUT
MANDATORY ASSIGNMENT W3-D2;
-- a question similar to another question from another assignment( q1 ) , just rename the titles and
you're good to go --
--------------------
-- question 4 --
--------------------
on t_film.film_id = fa.film_id
on fa.actor_id = ac.actor_id
OUTPUT
--------------------
-- question 5 --
--------------------
-- Pull all the films which rented and returned in the month of May --
MANDATORY ASSIGNMENT W3-D2;
on r.inventory_id = inv.inventory_id
on inv.film_id = fl.film_id
OUTPUT
--------------------
-- question 6 --
--------------------
on f.film_id = fc.film_id
on fc.category_id = c.category_id
OUTPUT
MANDATORY ASSIGNMENT W3-D2;