Using the database schema of our running movie example Movies(title, year, lengt
ID: 672979 • Letter: U
Question
Using the database schema of our running movie example Movies(title, year, length, genre, studioName, producerC#) StarsIn(movieTitle, movieYear, starName) MovieStar(name, address, gender, birthdate) MovieExec(name, address, cert#, netWorth) Studio(name, address, presC#) write the following queries in SQL. Who were the male stars in Titanic? Which stars appeared in movies produced by MGM in 1995? Who is the president of MGM studios? Which movies are longer than Gone With the Wind? Which executives are worth more than Merv Griffin?Explanation / Answer
a) Select name
from MovieStar, StarsIn
where name.MovieStar = starName.StarsIn
and movieTitle = "Titanic";
b) Select name
from MovieStar,Movies, StarsIn
where name.MovieStar = starName.StarsIn
and movietitle.StarsIn = title.Movies
and year = 1995
and producerC# = "MGM";
c) Select presC#
from Studio,
where name = "MGM";
d) Select title
from Movies
where length > some ( select length
from Movies);
Note :- In SQL "Greater than atleast one " is represented by > some.
e) Select name
from MovieExec
where networth > some (select networth
from MovieExec
where name = "Merv Griffin");
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.