select title,rating
from IMDB i
left join genre g
on i.movie_id = g.movie_id
where
g.genre like 'C%'
and
i.title like '%2014%'
and
i.budget > 40000000
Problem of the day
From the IMDb dataset, print the title and rating of those movies which have a genre starting from 'C' released in 2014 with a budget higher than 4 Crore. (Download the dataset from console)
Interview problems
Left Join Solution
select title,rating
from IMDB i
left join genre g
on i.movie_id = g.movie_id
where
g.genre like 'C%'
and
i.title like '%2014%'
and
i.budget > 40000000
Interview problems
Without Joins
select title,rating
from IMDB
where movie_id in
(select movie_id
from genre
where genre like 'C%')
and
title like '%2014%'
and
budget > 40000000
Interview problems
vipul's solution
select a.title,a.rating from imdb as a inner join genre as b
on a.movie_id=b.movie_id where b.genre like 'C%' and a.title like '%2014%'
and a.budget>40000000;
Interview problems
IMDb Rating
SELECT
i.title
, i.rating
--, g.genre
--, i.Budget
from IMDB as i
inner join genre as g
on i.Movie_id = g.Movie_id
WHERE
g.genre like 'C%'
AND
i.title LIKE '%2014%'
AND
i.Budget > 40000000;
Interview problems
IMDB Rating || Solution
SELECT Title, Rating
from IMDB
Inner Join genre on IMDB.movie_id = genre.movie_id
where genre.genre like 'C%'
and IMDB.budget>40000000
and IMDB.Title like '%2014%';
Interview problems
BEST SOLUTION || IMDb Rating ||
SELECT i.Title , i.Rating
FROM IMDB as i
LEFT JOIN genre as g
ON i.Movie_id = g.Movie_id
WHERE
g.genre LIKE 'C%' AND i.Budget > 40000000 AND i.Title LIKE '%2014%' ;
Interview problems
what is the error in this
select IMDB.Title,IMDB.Rating from IMDB right outer join genre on IMDB.movie_id = genre.movie_id where IDMB.Budget > 40000000 and genre.genre like 'C'% and IMDB.Title like %2014%;
Interview problems
SQL Solution Using Left Join and LIKE Keyword
SELECT i.Title , i.Rating
FROM IMDB as i
LEFT JOIN genre as g
ON i.Movie_id = g.Movie_id
WHERE
g.genre LIKE 'C%' AND i.Budget > 40000000 AND i.Title LIKE '%2014%' ;
Interview problems
Easy Solution
select a.Title, a.rating from imdb a join genre b on a.Movie_id=b.Movie_id
where genre like 'C%' and title like '%2014%' and a.Budget>40000000;