Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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");

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote