Skip to content Skip to sidebar Skip to footer

How To Solve The Following Case?

Consider the following question: We have 3 tables, 1. Theatre ( theatre_Id, thatre_name ) 2. ShowTime ( showTimeId, theatre_Id, movie_id ) 3. Movies ( movie_id, movie_name )

Solution 1:

If you better phrase the question:

What are the names of movies whose theatre list is the same size as the number of theatres?

you get the query:

selectdistinct movie_name
from Movies m
where movie_id in (
    select movie_id
    from ShowTime
    groupby movie_id
    havingcount(distinct theatre_Id) = (selectcount(*) from Theatre))

Post a Comment for "How To Solve The Following Case?"