Yurttas/PL/DBL/postgres/F/01/Movies/q04.sql

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2REM
 3REM q04.sql
 4REM
 5REM Find the names and addresses of movie stars
 6REM of movies produced by 'Steven Spielberg'.
 7REM
 8*/
 9
10SELECT current_schema();
11SET search_path to "movies";
12
13SELECT MS.name, MS.address
14FROM MovieStar MS, MovieExec ME, Movie M, StarsIn SI
15WHERE ME.name = 'Steven Spielberg'
16  AND ME.cn = M.producercn
17  AND M.title = SI.title
18  AND SI.name = MS.name;