- www.gideondsouza.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT title | |
FROM movie | |
WHERE id in (11768, 11955, 21191) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id | |
FROM actor | |
WHERE name='Glenn Close' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id | |
FROM movie | |
Where title = 'Casablanca' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.Name | |
FROM | |
casting c | |
JOIN actor a ON | |
c.actorid = a.id | |
Where movieid = 27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.Name | |
FROM | |
casting c | |
JOIN actor a ON | |
c.actorid = a.id | |
Where movieid IN | |
(SELECT id FROM movie WHERE title = 'Alien'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT m.title | |
FROM | |
movie m | |
JOIN casting c ON | |
m.id = c.movieid | |
WHERE c.actorid IN | |
(Select id FROM actor WHERE name='Harrison Ford'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT m.title | |
FROM | |
movie m | |
JOIN casting c ON | |
m.id = c.movieid AND | |
c.ord <> 1 | |
WHERE c.actorid IN | |
(Select id FROM actor WHERE name='Harrison Ford') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT m.title,a.name | |
FROM casting c JOIN movie m ON | |
m.id = c.movieid | |
JOIN actor a ON | |
a.id = c.actorid AND | |
c.ord = 1 | |
WHERE m.yr = 1962 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT yr,COUNT(title) FROM | |
movie JOIN casting ON movie.id=movieid | |
JOIN actor ON actorid=actor.id | |
WHERE name='John Travolta' | |
GROUP BY yr | |
HAVING COUNT(title)=(SELECT MAX(c) FROM | |
(SELECT yr,COUNT(title) AS c FROM | |
movie JOIN casting ON movie.id=movieid | |
JOIN actor ON actorid=actor.id | |
WHERE name='John Travolta' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT m.title, a.name | |
FROM casting c JOIN movie m ON | |
m.id = c.movieid AND | |
c.ord = 1 | |
JOIN actor a ON | |
a.id = c.actorid | |
WHERE m.id IN ( | |
SELECT m.id | |
FROM casting c JOIN movie m ON | |
m.id = c.movieid |